Live data from Hacker News

List of languages that compile to JS

github.com

31–40 of 57 posts

Re: List of languages that compile to JS

#31
post #28

Earlier quoted context omitted.

Wow, that's a blast from the past, from the Palm OS days. Interesting that they're still around.

NS Basic was actually around long before Palm OS, starting with the Newton. (!) We think /App Studio is our best yet.

Ah, nice! That's a long history - you've held out better than some of the other tools I remember using for Palm, like CASL, HB++ and AppForge. (Also amusing that Palm got their start on the Newton, with Graffiti.)

Re: List of languages that compile to JS

#32
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?

For the same reason people don't write everything in Javascript. It is not the global optimum language any more than any other language is, and there are tasks where it is easier in programmer terms to write in another language that can have stronger guarantees or a better DSL for some task or whatever than Javascript. As more and more stuff moves to the client an expanding range of client tasks falls under this category.

Re: List of languages that compile to JS

#33
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.

It doesn't break down entirely though. Imagine we were all restricted to C++ for writing desktop software (although that's nonsensical, it's the case with JS and the web) - wouldn't it be reasonable to start developing other languages that compile to C++?

If you can output JS that's fast enough, why not?

Re: List of languages that compile to JS

#34
post #23
post #18

Earlier quoted context omitted.

I'm not sure about all of them but CoffeeScript emits good, portable, fast JS.

Coffeescript I'm familiar with and yes, is very nice indeed. It's some of the others I'd be more concerned about.

If we can enable source pointers for debugging, then "good" matters less -- about as much as how "good" x86 ISA is.

Re: List of languages that compile to JS

#35
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?

One reason is to be able to consistently work with the same language both on the server and on the client. In this way one doesn't need to change gears all the time. I do like JS, but I'd rather use Ruby (or language of choice) most of the time.

Re: List of languages that compile to JS

#36
post #16
post #12

Earlier quoted context omitted.

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.

I'd define good as it takes full advantage of the javascript language and produces & can be used to create structures optimised for javascript, not the language it was written in.

This is why I think it's better to reduce the context-switch between server and browser and not eliminate it. There's going to be a context-switch there no matter what you do, so there's no sense in paying such high prices to try to eliminate it.

Re: List of languages that compile to JS

#37
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?

no one sets out to do a project of meaning or scale and chooses these tools, do they?

We certainly have (Parenscript) and it's vital for two reasons: (1) there are cases where we need to run the same code on either the server or the client; (2) we get the full power of Lisp macros. The latter means our source code is much smaller than JS we would have had to write by hand. Somewhat unexpectedly, there's a key efficiency issue here: making heavy use of abstractions in JS would make our code significantly slower. With Parenscript, we can write concise source code with nice abstractions that compiles to low-level, efficient (but still readable) JS. It's one of those rare times you get to have your cake and eat it too (an adage that really doesn't make sense, yet still always comes up #1 in the search results in my brain!)

Re: List of languages that compile to JS

#38
post #18
post #10

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

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.

Re: List of languages that compile to JS

#40
post #14

How 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 libraries in the name of turning it into a not crappy language.

https://github.com/tenderlove/phuby Phuby wraps PHP in a loving embrace. Exposes a PHP runtime in ruby

https://code.google.com/p/japha/ implementation of the Java 1.4.2 library in PHP

https://github.com/lunant/lisphp Lisphp is a Lisp dialect written in PHP

https://code.google.com/p/php-alternative-syntax/ Scala inspired syntax for PHP

https://code.google.com/p/java-php-toolkit/ a cross language compiler than transforms java code to php code deployable on any server supporting PHP >= 5.3

https://github.com/bendemott/pyhp Pyhp is a way to execute PHP Source Code directly within Python Scripts

https://github.com/ramen/phply PHP parser written in Python using PLY

https://github.com/skeltoac/php_app A PHP eval server for Erlang/OTP

Post reply on HN