Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 4259 days ago | link | parent

When ClosureScript came out, it didn't support eval (and it still doesn't, I think!), so I was motivated to build an eval-capable version of Arc in the browser. Behold Rainbow.js:

https://github.com/arclanguage/rainbow-js (project page)

http://arclanguage.github.io/rainbow-js/test/ (interactive REPL)

It's a direct port of Rainbow (https://github.com/conanite/rainbow), but with a hand-rolled parser and a hand-rolled implementation of asynchronous stream I/O. Like Rainbow, it "compiles" Arc code to an intermediate representation and interprets that. Rainbow was already a fast Arc implementation (faster than official Arc!) so Rainbow.js is pretty speedy as well. I used to think it was even faster than Rainbow itself, but then I realized that was due to a bug. :-p

I haven't been motivated to use Rainbow.js myself, because it has many quirks: Some quirks of its own (e.g. no threads), some inherited from Rainbow (e.g. no bignums, and weird call/cc behavior during macroexpansion), and of course all the quirky features of Arc (e.g. ssyntax). It also has some quirks which are truly necessary to make it usable; for instance, its (load ...) implementation loads from the Web, because there is no filesystem. While this (load ...) fix makes some sense, it's not always clear to me what the best behavior would be. Instead of pondering these small design questions and imposing my own decisions on this project, I've been working on other language designs from the ground up instead.

By all means, see if you can get Rainbow.js to work. I don't have ideas to improve this project myself, but you're not the only one who's wanted to use something like this, so your ideas could could help those other people. :)