aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2018-03-25 22:00:14 -0400
committerClyne Sullivan <tullivan99@gmail.com>2018-03-25 22:00:14 -0400
commit2f3ffd11097470095d8e5d7c989ce201d9d6d011 (patch)
tree2319d34f45205d888c15566f6e294687a58cee23 /README.md
parentee4cfcdd2fb55d3e270c8ff4b7d7f89861254f81 (diff)
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 26 insertions, 14 deletions
diff --git a/README.md b/README.md
index 6c90ba2..33e0368 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,36 @@
# interpreter
-This project aims to provide a very minimal scripting language for embedded systems. Many other languages already exist, such as Lua, Tcl, or BASIC; however, most implementations require certain system calls like read() and write(), as they expect a filesystem. This interpreter wants to be as system-independent and portable as possible: parsing script from strings one at a time, having minimal built-in functions (so the user can define their own IO calls and such), and only requiring a few standard library functions.
+
+*interpreter* is a minimal scripting language aimed at low-spec 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. 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 one at a time.
-To use this program with your own device, you'll need some malloc/free implementation, and a freestanding standard library. Newlib works well for this; however, functions like atoi() and snprintf() will probably need to be rewritten (if you don't have an \_sbrk defined).
+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:
+### interpreter features:
* Variable/function definition - in C and in script
-* if/else and while loops
-* a solve function to parse strings at runtime
+* if/else conditionals
+* while loops
+* a solve function to parse strings at script runtime
-Inconvenient features:
-* no local variables
-* whitespace sometimes ignored
-
-Some TODO items:
+### inconvenient features:
+* some code formatting is enforced due to parser limitation
+* all variables are global
+* whitespace is not always ignored
+
+### some TODO items:
* fix all memory leaks
* add better error messages
* arrays?
-* for loops
-
+* for loops
+* variable scopes
+
+## 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 no IO functions are 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 can be made for the host system (```make```) or an ARM system (```make arm```).
-This project is still in heavy development, so don't expect much. To include it in your own project, just link in libinterp.a (for ARM) and use the header files.
+&nbsp;
+This project is still in heavy development, so don't expect too much. See the wiki for a scripting guide.