Js-scheme - a Scheme interpreter written in JavaScript
eriksilkensen.com
eriksilkensen.com
(load 'last.fm)
(load 'flot)
http://code.google.com/p/js-scheme/ > ((lambda (f) (f f)) (lambda (f) (f f)))
;InternalError: too much recursionI 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.
The source to the scheme interpreter lives here:
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.
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'.
http://cappuccino.org/ | 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...
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.
No foldl or foldr though?
(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))))