Live data from Hacker News

List of languages that compile to JS

github.com

51–57 of 57 posts

Re: List of languages that compile to JS

#51

Any tools that work in the opposite direction? ( e.g., JS -> C )

Red Daly has a JavaScript to Parenscript (Common Lisp) translator: https://github.com/gonzojive/js-to-parenscript

The generated code from that won't run without a JS runtime implementation in CL backing the JS-specific Parenscript forms, which currently doesn't exist to my knowledge (it's not hard to write, just not very useful). This is useful by itself for writing JS analysis and transformation tools and moving JS code to Lisp.

There's CL-JavaScript: http://marijnhaverbeke.nl/cl-javascript/

This is a translator/compiler/"simulator" (http://www.cs.aau.dk/~normark/oo-scheme.html) that provides good integration between the two languages.

Re: List of languages that compile to JS

#52
post #20

Am I the only one who just plain doesn't understand the value these tools provide? From my perspective, why not just _write_ javascript? Seems ridiculous. I mean, they're fun and all, but no one sets out to do a project of meaning or scale and chooses these tools, do they?

Google Wave and AdWords were built on GWT, which is Java->JS. So yes, they do.

AdWords UI didn't start out on top of GWT, I think they switched over sometime in 2009.

Re: List of languages that compile to JS

#53
post #30

Earlier quoted context omitted.

The same reason people don't just write in assembly (or more accuratley, C) to write a desktop application very often. Javascript is the assembly language of the web.

That analogy breaks down though. JavaScript is just as much of a high-level language as most of the things that are compiling to it. Most of the time the reason people don't just write in JavaScript is because they don't like it's _style_, rather then with C or assembly, where the goal is to work at a higher level to avoid writing boilerplate and managing things are are unnecessary.

I agree with you esp. when it comes to GWT - going from Java to JavaScript is going from a terrible language to an ok one. There are two reasons why it has become popular:

  Java programmers don't want to learn JavaScript
  It comes with good UI building tools
If GWT didn't have good UI building tools, Java programmers wouldn't have any excuse not to learn JS and program normal web applications. But here's a tool that lets them use their existing Java knowledge to build halfway decent web GUIs.

This is just another example of how technologies are chosen by considerations other than objective technical merits.

Re: List of languages that compile to JS

#54

For those that think JavaScript makes a good VM format for the web, I've written a couple blog posts recently on this topic: http://chadaustin.me/2011/01/native-client-is-widely-misunde... http://chadaustin.me/2011/01/digging-into-javascript-perform... Basically, we need another 10x to 30x in performance for JavaScript to match native code performance...

Your lines of code measurement would be more compelling if you used sloccount instead of wc -l. Also, are you counting the lines of code in directories with tests in the name for Mozilla? I don't grok that find(3) incantation fully.
Post reply on HN