7 ms·
List of Languages that Compile to JS
- pooriaazimi 14y agoPrevious submission & discussion is at http://news.ycombinator.com/item?id=2075111 http://news.ycombinator.com/item?id=2075111 , but as it was about 500 days ago and many, many things have changes since then, I thought re-submitting this wiki (by changing 'https' to 'http') would be OK and hopefully illuminating to some. I'm particularly eager to learn how IcedCoffeeScript has changes since then. I'm starting a rather big CoffeeScript/Node.js project and I can't decide whether to go with IcedCoffeeScript (I love its simplicity), or go the 'async.js' way... If anyone has used both Iced and async, I'd be more than thankful if they could share their experience (I Would've asked this question on StackOverflow, but I'm sure it'll be closed within 5 minutes as not a real question or something like that).
- olegp 14y agoHave you considered using plain coffee-script with node-fibers instead? It might also be worth looking into Common Node (https://github.com/olegp/common-node https://github.com/olegp/common-node) that I'm working on which provides a higher level abstraction: https://gist.github.com/1447709 https://gist.github.com/1447709
- pooriaazimi 14y agoThanks. I'll look into it. One thing I forgot to mention about async.js: It's downright disgusting when you try to use it with CoffeeScript, so even though it's a mature, well-architectured piece of framework, I don't like to use it with CoffeeScript...
- dagw 14y agoAs someone who was just about to add some async.js to a CoffeeScript/Node project, I'd be very interested to hear about what problems you've had before I go and potentially do something stupid.
- pooriaazimi 14y agoIt might be just me, but async.waterfall [ (callback) -> callback null, "one", "two" (arg1, arg2, callback) -> callback null, "three" (arg1, callback) -> callback null, "done" ] just doesn't make much sense to me. I just don't like the way it looks. (code snippet from https://groups.google.com/group/coffeescript/browse_thread/thread/dd2071f3b0d73861?hl=en&noredirect=true&pli=1 https://groups.google.com/group/coffeescript/browse_thread/t... )
- lucian1900 14y agoLooks fine to me, but I do agree Iced can look even better.
- Kjeldahl 14y agoI've used CoffeeScript both for front-end projects and node.js backends, and node.js based command line scripts (similar to what is often done in perl). It works great, but for things like command line stuff which typically runs synchronously, the CPS/callback style of programming gets really messy really fast. Using await/defer (as supported by IcedCoffeeScript) synchronous programming can be done cleanly, if you make sure you write all your own functions in a callback style, and then consistently use await/defer when you want to call them synchronously. Trying to mix the metaphors creates a huge mess; your own functions may be synchronous, but every lib you will be using will be async. Better to keep all functions - including your own - async, and then consistently call them using await/defer when you want sync behaviour.
- statictype 14y agoI've been using iced for a small project I'm doing in node. It works remarkably well for me. However, I've come to realize that it's biggest win is in forcing a simple convention on you for async code that makes it easy and clear to write even when you don't use iced.
- tagawa 14y agoA bit off-topic and I might have missed something, but why is this on GitHub? I would have thought Wikipedia is best for reference lists like this. Still an eye-opening read, though.
- pooriaazimi 14y agoI don't think so: [..] Family (share genes with CoffeeScript)[citation required] And now you have to find a tertiary source (not even a secondary, or god forbid first-hand, like for example coffeescript.com) that proves that they share genes. I'm not trying to be funny or sarcastic, so don't downvote me! That's what Wikipedia is, for better or for worse.
- obtu 14y agoThis might work if you create a category and add these languages to it. Ontology-wise you would need one category for the compilers that target javascript (subcat of compilers), and another for languages (primarily?) designed to be compiled as JS (subcat of programming languages). And maybe one more for languages+environments that compile as JS, primarily run in browsers, and wrap some browser APIs in their standard library.
- kombine 14y agoFunny to see this post together with LLVM 3.1 announcement on the same page as both are used as backends for programming languages these days. Now question, is this world gone mad? While I can justify existence of CoffeScript(it is only a nicer Javascript, with similar or improved semantics), the whole hype about the "assembly of the web" is ridiculous. Shame that with all the advances of the technologies today we have to compile to Javascript. Update. Nice picture to illustrate what compiling to JS feels like http://im4-tub-ua.yandex.net/i?id=140745948-54-72&n=17 http://im4-tub-ua.yandex.net/i?id=140745948-54-72&n=17
- clyfe 14y agoHeh, I started this :) strange thing how the interwebs works. I was searching like mad for a coffeescript + operator overloading and classes with private/protected methods. In my desperate search I started to make a list with languages that compile to JS. Then - an idea came to me. How about I put this in the coffeescript wiki, post it on Hacker News then people will crowdsource it. It worked like mad, in an instant people were adding projects and I was organizing it. Now I see people making sites/communities out of it. Small world. I guess it's a topic of interest. PS Crowd-sourcing is an amazing experience. 1. commit 8a0bae391e5711bce233ccac756d2b80070868da in CS wiki 2. Previous discussion in my original thread http://news.ycombinator.com/item?id=2075111
- deleted 14y ago[deleted]
- wazoox 14y agoI just discovered Perlito thanks to this list, and it's awesome (compiles perl5/perl6 to Javascript/Python/CLISP/Go/Ruby). I don't know what it can be used for but I like it :)
- babarock 14y agoWhy do so many languages choose JS as a 'middle' language? Is it something inherent to the language itself that makes it particularly easy/attractive? Or is it simply because of the availability of the interpreter in the browser?
- quarterto 14y agoAlmost certainly the latter. And it's not so much "I want to design a language. Ooh, I'll make it compile to JavaScript!" as "Dammit, why is X so hard in JavaScript X but trivial in language Y? Hmm, I know...". To me, it's testament to just how dynamic JavaScript and prototypal inheritance are.
- TazeTSchnitzel 14y agoIt's pretty much the web's bytecode. When minified and gzipped, it's pretty small, too.
- ghenne 14y agoIn our case (NS Basic/App Studio) we wrote a translator for VB style BASIC to JavaScript. We wanted to create a cross platform development that could target iOS, Android and other mobile platforms. We started the project about 2 years ago, and saw a few key developments in the JavaScript space. 1. HTML5: the extensions did a lot to move it from a web scripting language to something that could be used for real applications. The Cache Manifest allowed the developer to specify a list of files to be stored on the device, so the app could run offline, with no access to a server. 2. Home Screen: The mobile platforms added the ability to pin web apps to the Home screen with their own icon, making it possible to start them much like native apps. 3. Performance: Work by the browser folks on the internals of the JavaScript engine resulted in huge boosts in performance. The results are in this table: http://www.nsbasic.com/speedtest.htm http://www.nsbasic.com/speedtest.htm. You can see the transition from early BlackBerrys being able to run a few hundred JS loops per second to the Motorola Xoom at 718,000. The benchmark is simplistic, but the message is clear: JavaScript on mobile device is 1000 times faster than a few years ago. It turned out that it was fairly straight forward to write the Translator. Yes, there were enough weird edge cases to question anyone's sanity to do this again, but the result works well. All the control structures translated one to one, so there was little or no drop in performance. We then built a Visual Studio style IDE around it, with support for frameworks like jQuery Mobile, jqWidgets and Sencha to build a complete dev environment. It's been a lot of fun. (and yes, you can use JavaScript instead of BASIC if you want!)
- GeZe 14y agoI'm the creator of LiveScript (http://gkz.github.com/LiveScript/ http://gkz.github.com/LiveScript/) which is on that list. Feel free to ask any questions! LiveScript has unnested callbacks, paren free chaining, function composition and piping operators, proper list comprehensions, and a lot of other improvements over CoffeeScript.
- quarterto 14y agoWhy fork (and reverse half of Coco's semantics), instead of contributing to Coco? Do you expect that any of your additions will get merged into mainline Coco/CoffeeScript?
- GeZe 14y agoMost of my changes would be unacceptable to Satyr, the maintainer of Coco. For instance, I posted an issue about creating proper list comprehensions in both CoffeeScript and Coco, and both times was shut down. That's why I decided to create my own project, and make the changes I want without being shut down all the time. I don't expect any of my changes to be merged into Coco or CoffeeScript, but if they want to then I would encourage them to do so.
- stewbrew 14y agoIMHO such lists are rather useless without information about the state of the compiler, indicators for active development, financial situation (who pays the bills?), community size etc.
- obtu 14y agoIt's just an index so you can see if your favourite language is supported. Follow the links for the rest. You couldn't trust extra information in the wiki itself because most of the details you need would get outdated pretty fast.
- MBlume 14y agoMore detail on the Haskell -> js options here: http://www.haskell.org/haskellwiki/The_JavaScript_Problem http://www.haskell.org/haskellwiki/The_JavaScript_Problem
- forgotusername 14y agoSee also: http://altjs.org/ http://altjs.org/