5 ms·
Js-scheme - a Scheme interpreter written in JavaScript
- jacquesm 18y agoNow that is one impressive hack! The source to the scheme interpreter lives here: http://www.eriksilkensen.com/projects/js-scheme/js-scheme.js?r=50 http://www.eriksilkensen.com/projects/js-scheme/js-scheme.js... If there ever needed to be proof that JavaScript is a real language then I think that's taken care of now.
- wheels 18y agoReally? You mean after hundreds or thousands of non-trivial applications written in / using JS, a cutesy scheme interpreter was the tipping point?
- jacquesm 18y agoNo, I mean that a language implemented in JavaScript is sort of a milestone, once you can emulate language 'a' in language 'b' I think that counts for something. My JavaScript knowledge is somewhat dated and this opened my eyes as to how dated it really is. I was not aware that JavaScript was so versatile, even though I've used it plenty of times to achieve some functionality not present in html. In fact, that's probably the closest I can come to a one line description of the way I viewed JavaScript, an extension to html, obviously I was very wrong. The html in this case simply is a container for a completely self contained language implementation, so that goes well beyond 'extending the functionality of html'.
- wheels 18y agoI find Cappuccino (objective-c-like interpreter) and 280slides (corresponding demo) significantly more impressive, and they're from a YC startup to boot. http://cappuccino.org/ http://cappuccino.org/ | http://280slides.com/ http://280slides.com/ There have been major apps written in Javascript for at least 5 years. I mean, a huge slice of the whole "web 2.0" shebang is client side Javascript apps doing asynchronous communication with servers...
- jacquesm 18y ago> client side Javascript apps doing asynchronous communication with servers that much I'm aware of, but the fact that there is enough general functionality in there to be able to stick together a complete implementation of another language was definitely news to me. I've been using JavaScript since its introduction to deliver 'video' (as in one jpeg replacing another) for the longest time, and I found a way to do an underwater call to the server long before 'ajax' even had a name or microsoft introduced the corresponding http request call. I'll look at the examples you cited, it definitely sounds like cool stuff.
- jacquesm 18y agoThank you so much for that, most impressive.
- mariorz 18y ago"Starting in version 0.4 two extensions are packaged with the main download: a primitive API wrapper for Last.fm Web Services, and an interface to the flot JavaScript graphing library. " (load 'last.fm) (load 'flot) http://code.google.com/p/js-scheme/ http://code.google.com/p/js-scheme/
- bandris 18y agoHow is this any better than the existing n+1 scheme interpreters in javascript? Including Crockford's one: http://www.crockford.com/javascript/scheme.html http://www.crockford.com/javascript/scheme.html
- deleted 18y ago[deleted]
- speek 18y agoThis is absolutely kick-ass! No foldl or foldr though?
- GeoJawDguJin 18y agoAs if they're hard to write...? (define (foldr f end xs) (if (null? xs) end (f (car xs) (foldr f end (cdr xs))))) (define (foldl f start xs) (if (null? xs) start (foldl f (f start (car xs)) (cdr xs))))
- voodootikigod 18y agoAlso check out http://www.jsconf2009.com http://www.jsconf2009.com where JavaScript developers will be rallying to discuss how to use JavaScript to build cutting edge mobile, desktop, server, and web applications. If you have any interest in deep JS tech, you should be there.
- shaunxcode 18y ago"dude - wheres my macros?" I will qualify that with: the funnest part of writing "a scheme" is implementing the macro system! Especially as you can use that to implement a lot of the r5 spec itself.
- ganley 18y agoI did (almost) this same thing 12 years ago: http://joeganley.com/code/jslisp.html http://joeganley.com/code/jslisp.html ... though his is more complete and polished than mine, and the interface is nicer in ways that were basically impossible in 1997.
- shaunxcode 18y agoYour project was a huge inspiration for me when I first stumbled upon it! I am now using a totally different approach for my "scheme on php" project but your project gave me the notion that it was actually plausible. So thank you!
- vegashacker 18y ago> ((lambda (f) (f f)) (lambda (f) (f f))) ;InternalError: too much recursion