darcs get http://www.bluishcoder.co.nz/repos/factor
The FFI is still a work in progress. As I write wrappers for DOM routines I expect it to change.
The parser now supports escaping words with '\ word', stack effects and comments:
1 2 \ + execute : square ( a -- b ) #! Square the argument dup * ;
Some improvements to parser combinators have been made to speed up the parser as well. The number of backtracking possibilities has been dramatically reduced.
Simple Ajax support has been added in the form of 'http-get' and 'run-file'. 'http-get' takes an URL on the stack and returns the data at that URL as a string. 'run-file' will compile and evaluate the Factor code at the given URL. Note that due to Ajax limitations these can only be URL's on the local server. I may add proxy capability to work around this in the future:
"/responder/fjsc-resources/bootstrap.factor" http-get "/responder/fjsc-resources/bootstrap.factor" run-file
The limitations with the Ajax support also include the fact that they are run asyncronously. So they aren't much good in running programs, more for interactive use at the REPL. I'll either make this synchronous in the future or add continuations to the compiler.
Bootstrap Factor file
A file located at /responder/fjsc-resources/bootstrap.factor can contain Factor code that is compiled and run when the 'bootstrap' word is run. From the reply run 'bootstrap' and it will execute the code.
I plan to add (in no particular order):
- Improve the code generation.
- Wrap various DOM routines, etc
- Write a better REPL in Factor itself