]> code.bitgloo.com Git - clyne/interpreter.git/summary
 
descriptionScripting language implementation for microcontrollers
ownerClyne Sullivan
last changeSun, 19 Apr 2020 12:51:47 +0000 (08:51 -0400)

interpreter

interpreter is a minimal scripting language aimed at low-memory embedded systems.

Many other scripting languages currently exist for embedded use, including Lua, Tcl, and BASIC; however, their implementations require certain system calls (e.g. read()/write()) that may not be available or used on an embedded device. Additionally, their memory and/or non-volatile memory requirements may be too large for the targeted device. As a result, interpreter was made with the goal to allow advanced scripts to be run in minimal conditions. This included things like having only a few built-in functions, and only loading script from C-strings.

To use interpreter with your own device, you will need some malloc/free implementation and a freestanding standard library. Newlib can work well for this, although functions like atoi() and snprintf() will probably need to be rewritten (if you don't have an _sbrk defined).

interpreter features:

inconvenient features:

some TODO items:

building and running

This project can be made for the host system (mv shell.c.bak shell.c; make) or an ARM system (mv shell.c shell.c.bak; make arm). Make's -j argument may be used to multithread compilation.

To run on the host system, run ./shell some_script_file. Note that IO functions are not built in, so you must define your own.
To use on an ARM device, simply link libinterp.a into your program and use the header files. See shell.c for an idea of how to the interpreter.

 

This project is still in heavy development, so don't expect too much. See the wiki for a scripting guide.

shortlog
2020-04-19 Clyne Sullivancan compile again master
2018-04-29 clyneUpdate README.md
2018-04-26 Clyne SullivanUpdate README.md
2018-04-24 Clyne Sullivantests to folder
2018-04-24 Clyne Sullivansingle-letter vars, size & append, string indexing
2018-04-13 Clyne Sullivanarrays, implicit multiply
2018-04-02 Clyne Sullivanmemory leak fix
2018-04-02 Clyne Sullivanfixed string memory leaks
2018-04-02 Clyne Sullivanchange load/run style, hunt for memory leaks
2018-03-30 Clyne Sullivanexpose inew_number
2018-03-29 Clyne Sullivandocumentation, error fixes, organization
2018-03-28 Clyne Sullivanallow solve to error safely
2018-03-26 Clyne SullivanUpdate README.md
2018-03-26 Clyne SullivanAdded shell and licensing
2018-03-23 Clyne Sullivanmore error detection
2018-03-23 Clyne Sullivantesting new features, imp. mult & negatives
...
heads
5 years ago master