Skip to content

gfwilliams/EspruinoCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Espruino Compiler

See the Espruino Compilation Page

This project does the following:

  • Turns JavaScript code into C++ (that calls into Espruino library functions for more complicated operations)
  • Compiles the code with GCC
  • Links and Extracts a relocatable blob of Thumb code
  • Formats it into JS that can be run in Espruino

Files

  • src/utils.js - general utilities
  • src/infer.js - Type inferral on parse tree
  • src/compile.js - Parse tree -> C++, and calling of GCC
  • server.js - server that performs compilation for the Web IDE
  • test.js - simple command-line test
  • test_espruino.js - test in such a way that the C code is compiled into Espruino - allowing nice easy GDB debug

Setup

You need:

Running

  • Run node server.js
  • Go into Web IDE settings and set Communications / JavaScript Compiler URL to http://localhost:32766

About

Node.js-based JavaScript->C++ compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published