Outlet: new Lisp that compiles js/lua with eval and debugging
jlongster.com
jlongster.com
How predictable is the output JavaScript. This is important of optimization, if I find that something is transforming improperly, I need to be able to change that.
How is DOM and native JS Interop? I need to be able to trivially call WebGL and do DOM manipulations, and perhaps anything else that can come up.
Examples will be appreciated.
* The output is pretty robust. Everything compiles down to just a few basic forms: an atom, a function, lambda, and "if". I'm considering adding a form that lets you output raw JS if you need to optimize something, but I have yet to see the need for that.
* Outlet doesn't do anything crazy like CPS. When you call a function "foo" with "(foo 1 2 3)" it generators a simple function call "foo(1, 2, 3)". So you can call native javascript functions normally.
You can use arrays and objects inline, like so:
(define a [1 2 3 4])
(define b {:key "value" :another-key "value2"})
Those get generated to normal javascript arrays and objects, so you can pass them as parameters to a native js function if needed.
You can even reference objects with "." like:
(define foo {:one 1 :two 2})
(print foo.one)
That works as expected. The only difference is vector reference, instead of "foo[1]" you would do "(vector-ref foo 1)".
Of course, this is all subject to change, but the goal of Outlet is to not do something crazy and for things to work as expected.
I assume you're familiar with parenscript. What are your thoughts on that?
I additionally love the ability to generate lua, I could see that being very useful.
My main complaint about Parenscript is it's too Javascript inspired. I don't want the "return" statement. Parenscript also seems to have no interest in compiling out to other languages, like Lua.
The primary goal of Outlet is to develop games, so it will be fast and portable.
ClojureScript has different goals, and is primarily meant as an extension of Clojure.
* sophisticated debugging, introspection layer (in browser would be possible)
* fast, portable
You should be able to develop games as easily in ClojureScript as you would in Outlet.
That said, Outlet is very cool!
I'm really interested to watch ClojureScript develop, and it already has an amazing community (and surprising awareness among devs). I probably need to hack on the source before I make assumptions about it.
I'm enjoying the freedom of building a new language though, and things like compiling to Lua and debugging aren't as nearly overwhelming because I'm doing it from the ground up. Who knows though, if I get comfortable with ClojureScript I could eventually just contribute to that.