Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed. Javascript is a horrible language compared to as3, and a disastrous platform compared to flash. I cringe everytime I have to write some javascript, even if I'm using jQuery and the only browser it will ever be run on is Chrome.

What would really be cool is if you could target VM's using whatever language you want (including statically typed languages like Java and AS3. The JVM and AVM did it, so I don't see why V8/etc can't). Javascript should not have a monopoly on the VM.



Have you seen haxe? (http://haxe.org/doc/intro) I don't have any experience with it, but it seems like you might like the idea. Statically typed language that can be exported into either JS or AS3.


Yeah, haXe is cool. It's a step in the right direction, but it's not first class native support.


[deleted]


[Context: the deleted comment suggested we don't know Javascript because we were "moaning about using it" and we should "learn Javascript before knocking it"]

I know Javascript, your comment suggests you don't know ActionScript's history: AS1 was an ECMASscript language just like JS, so to that end it was actually literally the same language as JS running in a different environment with a different API. The latest iteration of JS has hardly changed since then, whereas AS1 evolved into AS2 then AS3, which is now a much more advanced OOP language, and it's still evolving. Going from AS3 to JS is literally like going backwards in time.


If memory serves AS2 was supposed to be more or less the same as ecmascript 4. The problem is ecmascript 4 never made it out of committee. With the reboot in the ecmascript committee that produced the harmony release, we're now on the road to get optional strict typing. For me the typing is the only thing really missing from javascript.

You can get quite far on the way to strict typing with a good IDE like jetbrains. It has very thorough 'compile time' checks (while editing). I almost don't miss strict typing when writing large pieces of javascript in jetbrains.


I've never, not even once, missed static typing since accepting the move to JavaScript; you just get used to it. You shouldn't rely on the compiler to detect 'errors', rely on your test cases.


Did AS1 have closures? I was under the impression that it didn't, which makes it a very different language from JavaScript, even if the syntax looks similar.


Saying they are "very different" because of closures is hyperbolic, but at any rate, yes, AS1 had closures like JS.


Can you provide a syntax example? I couldn't find any documentation/sample code of AS1 closures.


And to be clear, I am moaning about the language AND the DOM, but I would likely moan less if not for the DOM and the multiple interpretations of the language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: