List of languages that compile to JS
41–50 of 57 posts
Re: List of languages that compile to JS
#42Am 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?
Iteration/comprehensions work like they should[1], destructuring simplifies extraction, there's a prototype binding construct in the language, less line noise, and everything is an expression. I also happen to like indent-significant languages and think it's a great DSL language.
I could certainly produce the same code writing in JS, but what would the advantage be? I'm already doing a build step for combo/minification and if not, a --watch compile gives roughly the same workflow as raw JS. I have to search for a snippet of text rather than going to a line number when I'm debugging, but I think the coding gains/cleanliness is worth the slightly increased debugging effort.
[1] With one gripe, `y = x + 1 for x in 0...10` got changed in August to match up with `z = x if x % 2` and friends (it was special cased) so y is now 10 instead of the array 1..10 and you have to wrap the comprehension in parens.
Re: List of languages that compile to JS
#43Earlier quoted context omitted.
I'm not sure about all of them but CoffeeScript emits good, portable, fast JS.
CoffeeScript is largely an alternate syntax to JS with a couple of macros added on. That's more like the prima ballerina changing from her pajamas into a tutu.
Of course any language that does a lot more than CS is going to be slower, e.g. Objective-J's object system providing method-missing functionality and a whack of other features not found natively in JS.
Re: List of languages that compile to JS
#44Am 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?
Re: List of languages that compile to JS
#45I note that doesn't read 'good JS' or 'fast JS'. You can put me in a tutu but I won't be a prima ballerina.
Define good in this context. I'm inclined to say that if it doesn't have cross-browser bugs and it's fast, then it's good. The output being readable to human programmers probably shouldn't be a goal when JS is being used as a compiler target.
Sometimes I think the holy grail for what we do would be a Slime-like REPL in the web browser that speaks Parenscript, maps to source code, and had full debugging support. In the meantime, though, things like Firebug are indispensable.
Re: List of languages that compile to JS
#46Am 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?
Re: List of languages that compile to JS
#47How about a list of languages that compile to PHP? haXe is the only mature one I know about.
I just so happen to have this list. http://haxe.org/doc http://github.com/scriptor/pharen http://www.mathgladiator.com/projects/kira/ http://www.scriptol.net/ http://sunra.nachtkabarett.com/ http://users.xelent.net/mlewis/tellpdf.php?seid=12457c30afd9... http://ialexi.com/portfolio/original-works/components/quirk/ And a somewhat related list: https://github.com/ryantenney/php7 Hacking the PHP compiler and standard li…
Re: List of languages that compile to JS
#48Any tools that work in the opposite direction? ( e.g., JS -> C )
A full compiler would of course always have the problem of dynamically generated JS, i.e eval().
Re: List of languages that compile to JS
#49I note that doesn't read 'good JS' or 'fast JS'. You can put me in a tutu but I won't be a prima ballerina.
Define good in this context. I'm inclined to say that if it doesn't have cross-browser bugs and it's fast, then it's good. The output being readable to human programmers probably shouldn't be a goal when JS is being used as a compiler target.
Everyone says that until they have to debug the generated JavaScript in IE.
Re: List of languages that compile to JS
#50http://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...