Arc Ported to JavaScript
halogen.note.amherst.edu
Arc Ported to JavaScript
1–10 of 25 posts
Re: Arc Ported to JavaScript
#2Re: Arc Ported to JavaScript
#3Re: Arc Ported to JavaScript
#4this seems to be the first implementation of Arc in a language other than Scheme. I'm curious if others will follow.
Re: Arc Ported to JavaScript
#5Continuations are not implemented. I had started on a CPS-based interpreter, but then realized that JavaScript lacks tail-call optimization and has a recursion limit of 1000 calls, which'll make any CPS-transformation blow the stack.
looks like a good piece of code otherwise, though.
Re: Arc Ported to JavaScript
#6Re: Arc Ported to JavaScript
#7an important limitation of javascript means this will never quite be a complete implementation: Continuations are not implemented. I had started on a CPS-based interpreter, but then realized that JavaScript lacks tail-call optimization and has a recursion limit of 1000 calls, which'll make any CPS-transformation blow the stack. looks like a good piece of code otherwise, though.
http://marijn.haverbeke.nl/codemirror/story.html
I'm not sure how relevant it is to implementing Arc, but never say never. JavaScript is Turing complete, after all...
Re: Arc Ported to JavaScript
#8Re: Arc Ported to JavaScript
#9I just played around with it quickly, pasted in the recursive definition of factorial:
(def fact (x) (if (It was fairly quick, but the results came back as floating point numbers. It broke on (fact 100).
Under arc-over-scheme it did better.
CLISP performed better than both, but the default limit in the call depth was easily exceeded (E.g. it busted on (fact 8000)). I don't recall exactly, but for around fact 5000 CLISP seemed about twice as fast as arc-over-scheme.
These are very rough estimates, but perhaps give people an intuition about performance.
Now what I am really waiting for is the arc-over-CLISP. I am too busy with other things to dare an attempt...