Settings

Theme

Clojurejs - A naive Clojure to javascript translator

github.com

23 points by funcall 15 years ago · 8 comments

Reader

clyfe 15 years ago

List of languages that compile to JS:

https://github.com/jashkenas/coffee-script/wiki/List-of-lang...

zephjc 15 years ago

Does this differ significantly from the clojurescript which is already on clojure-contrib? https://github.com/richhickey/clojure-contrib/tree/master/cl...

You can try it out at http://clojurescript.n01se.net/repl/ which evals your code via a Java applet.

On a side-note, I'm modifying an older Javascript-based Lisp interpreter to have a more Clojure-like feel, as well as adding in Macros, etc. and running it on the v8 debug shell "d8" (built with readline enabled). The goal is to be write something like Clojure in a way one would write Node.js apps. At some point I want to have it auto-compile the lisp modules to Javascript a la Python's .pyc files.

  • funcallOP 15 years ago

    I believe clojurescript requires a patched Clojure implementation, and a JVM to support the generated Javascript at runtime, although I'm not 100% certain that these constraints are still true. And, I'm not sure how actively it's being developed. However, clojurescript is probably a better approach to this, with an appropriate intermediate representation (a nice byproduct of using the built-in compiler) etc.

    clojurejs generates javascript which has no other dependencies (other than any in the source Clojure (subset) code itself) and should run on any reasonable browser.

    FWIW, clojurejs is a much less ambitious effort born out of the necessity of one developer (me). You can read more about the current limitations and some of the things I'd like to improve on the project's github issues page and the Google groups discussion referenced elsewhere in these comments.

budu 15 years ago

There's an small but interesting discussion about it in the Google group: http://groups.google.com/group/clojure/browse_thread/thread/...

geuis 15 years ago

Is the title supposed to be "naive" or "native"? The two words mean vastly different things.

  • budu 15 years ago

    It seems to really be "naive" (although native is also correct) as it's what the readme and Github description also says. Moreover it's a very simple compiler for now, translating only a small Clojure subset without any optimizations.

  • funcallOP 15 years ago

    It is naive ... exactly for the reason budu posted.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection