Live data from Hacker News

Arc Ported to JavaScript

halogen.note.amherst.edu

1–10 of 25 posts

Re: Arc Ported to JavaScript

#5
an 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.

Re: Arc Ported to JavaScript

#7

an 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.

This guy implemented a continuation-based syntax highlighter in JavaScript:

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

#9
Cool, you deserve many up votes for this!

I 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...

Post reply on HN