

List of Languages that Compile to JS - pooriaazimi
http://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

======
clyfe
Heh, 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

------
pooriaazimi
Previous submission & discussion is at
<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
Have 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>) that I'm working on which provides a
higher level abstraction: <https://gist.github.com/1447709>

~~~
pooriaazimi
Thanks. 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
As 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
It 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/t...](https://groups.google.com/group/coffeescript/browse_thread/thread/dd2071f3b0d73861?hl=en&noredirect=true&pli=1)
)

~~~
lucian1900
Looks fine to me, but I do agree Iced can look even better.

------
MBlume
More detail on the Haskell -> js options here:
<http://www.haskell.org/haskellwiki/The_JavaScript_Problem>

------
babarock
Why 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?

~~~
drostie
When Rich Hickey announced ClojureScript he said "Why are we doing this?
Because Clojure _rocks_ , and JavaScript _reaches_." The simplest reason is
because JS is the Language of the Web.

It's worth wondering why this is, and I don't really have an answer. In JS's
infancy, Java was meant to be the Language of the Web and JS was its asthmatic
younger brother. There are probably purely aesthetic problems which led to
Java being overtaken by Flash, but I don't know. I sometimes like to say that
Java looked consistent in every browser -- but consistently ugly. But Java is
not necessarily fun to develop in either, and getting people to install Java
always seemed like it was more pain than getting them to install the Flash
plugin.

You can treat it as a black box, of course: even to this day, for lots of
people, Java on the web just plain doesn't work. But I think you're asking
_why_ it doesn't work, and that's much more subtle. You know who would be an
interesting person to ask? An advertiser. You see flash ads, you see JS ads,
you see flat image ads -- but you never see Java ads.

In any case, I think JS won because it gave immediate gratification: you took
the image that you had already placed on the page and, onmouseover, you
replaced it with an animated GIF which you'd already loaded and cached. It was
event-driven design with a GUI language that you already needed to know when
you were making a web app in the first place -- you didn't have to learn AWT
and Swing and such before you could make and place a drop-down menu; you just
placed a SELECT with OPTIONs, the same as for a form.

When CSS replaced FONT tags and ECMA partly solved the problem of Microsoft
trying to kill Javascript in favor of JScript, it became clear to me that JS
was indeed the Language of the Web, and that HTML and CSS were just very smart
declarative domain-specific languages for its GUIs. If you want a single
lesson, there it is: make sure your language allows for declarative
programming, and make sure your GUI language is declarative and event-driven.

Its other strengths would not necessarily have been strengths elsewhere. It's
an asynchronous language with no race conditions. That's perfect for a
responsive GUI, but it's probably wrong for anything which needs lots of
processing power. It's got light objects and first-class functions, which is
beautiful when you want to package data and write jQuery, but the cool stuff
you can do with the Haskell type checker is pretty much not allowed by this
model.

But those are the reasons why you might _still_ prefer JS, even when other
middle languages exist.

~~~
TeMPOraL
> You can treat it as a black box, of course: even to this day, for lots of
> people, Java on the web just plain doesn't work. But I think you're asking
> why it doesn't work, and that's much more subtle. You know who would be an
> interesting person to ask? An advertiser. You see flash ads, you see JS ads,
> you see flat image ads -- but you never see Java ads.

Well, to begin with, a typical Java applet take around 30 seconds to one
minute just to load and start execution, usually suspending the whole page.
There's nothing more annoying on the Internet for me than encountering an
unexpected embedded Java applet. Hitting "back" and killing the Java process
is almost subconscious reaction to me now. Java Web Start was actually
something nice and I used it to launch programs and play games written in
Java. It at least asks before hunging your browser up.

And then again, Java applets are consistently ugly. Maybe it has something to
do with default GUI libraries, which look bad and break UI conventions. Only
today I had to deal with a Java program that reinvented tree view, so that you
couldn't rename elements without killing and reinserting them.

So yeah. Execution sucked then and still does now.

------
GeZe
I'm the creator of 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
Why 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
Most 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.

------
kombine
Funny 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)

------
stewbrew
IMHO 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
It'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.

------
tagawa
A 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
I 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.

------
wazoox
I 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 :)

------
forgotusername
See also: <http://altjs.org/>

