
ClojureScript Lua backend  - swannodette
http://raphamiard.posterous.com/gsoc-2012-pluggable-backend-infrastructure-an
======
dinedal
This is very cool!

I am excited that ClojureScript could be used to target multiple backends,
allowing one to leverage the platform's benefit's as needed.

------
dhconnelly
I'm going out on a limb and assume someone has already considered a
ClojureScript JVM backend? Or is there some other strategy for moving towards
self-hosting?

~~~
darklajid
I read this comment, waited for 10 minutes for smarter people than me to
comment. Now I'll bite.

What? Why? Clojure is a JVM language. The ClojureScript compiler _is_ running
on the JVM (in Clojure). Why would you want to create a backend for the JVM
for a language that tries to match a JVM language as closely as possible - and
relies on the JVM for tooling?

I rocked back and forth for minutes. Please explain why you assume that
someone considered this and why it wouldn't be nonsense?

~~~
rads
Bootstrapping and consistency across platforms. The goal of Clojure-in-Clojure
is to write the Clojure compiler in as much of Clojure itself as possible.
Right now the ClojureScript compiler is actually closer to this goal than the
Clojure compiler.

If ClojureScript were ported to the JVM, maybe it would replace the current
Clojure compiler as the official implementation. Clojure-in-Clojure would be
further along, and implementations across host platforms would share a larger
portion of code.

------
it
Given the long start times in Clojure due to the JVM, it's nice to see it
being ported to other back-ends that start quickly.

------
platform
My view on clojurescript to javascript that implementation has significant
benefits mostly if targetting mature javascript library (such as dojo toolkit
or others)

I do not think it is support right now but would be nice to be able to do
things like

(use '[clojurescript-contrib.dojo_wrap :only (dojox.grid dojox.coolwidget)])

and the same for future Lua or other backends, however, I am not sure how the
proposed modularisation will make this work.

------
moomin
This is hugely exciting, but I'm really hoping that someone comes up with a
satisfying solution to the conditional compilation problem soon. It'd be
pretty depressing if the only things that were portable between
implementations were algorithms.

~~~
programnature
I also hope for a good solution. I disagree about portability though.

It is awesome to have different dialects of clojure, which are the same
wherever possible, and vary only where they have to.

The purpose of a different dialect is to take advantage of a different host
vm/language. Enforcing uniformity across all dialects would preclude this.

But my point is, even accounting for variations, having a uniform
representation for programming primitives across all these hosts is a huge
win.

Its great that I'll be able to play with, take advantage of Lua without
learning the details of its language. Instead of learning new syntax and
semantics, all I need to know is the precise details of how this clojure
dialect is different. This is much easier and more accessible than starting
from scratch. I don't want to have to learn these languages in order to use
them.

Finally, given the trend towards declarative representation, I expect a lot
more than algorithms to be portable. I expect all the clojure dialects will be
pretty interoperable from a SOA perspective.

~~~
moomin
I think we do actually agree. I just want it to be possible to have cross-
platform libraries, not it to be mandatory. But it would be nice if, for
instance, sql libraries were portable as long as you weren't doing anything
unusual.

------
aiscott
So what is it like trying to debug something you've written in clojurescript?
Regardless of the backend target language, it seems so disconnected. Is there
a REPL for clojurescript?

EDIT: answered my own question about the repl:
[https://github.com/clojure/clojurescript/wiki/The-REPL-
and-E...](https://github.com/clojure/clojurescript/wiki/The-REPL-and-
Evaluation-Environments)

~~~
swannodette
If you know JavaScript and Clojure debugging ClojureScript is not terrible.
That of course is still far too high a bar for most people.

In the case of JavaScript there's a rich set of existing debugging
infrastructure tools that we can build upon. Also source mapping support is
just around the corner for WebKit based browsers. That will improve the
debugging story quite a bit.

~~~
moomin
Does the google closure compiler respect source maps, though?

