Live data from Hacker News

My gripes with JavaScript

ironjs.wordpress.com

11–20 of 48 posts

Re: My gripes with JavaScript

#11
post #10
post #6

Earlier quoted context omitted.

I'm well aware of js.next/harmony/whateveryouwannacallit. Come back to me in 10 years when it's implemented everywhere and everyone that was on an old version of browser X has upgraded to one with those features.

Or use a tool that compiles js.next to lowest-common-denominator-javascript.

Yay a dynamic language with a compiler step.

Re: My gripes with JavaScript

#12
post #8

Earlier quoted context omitted.

If we started over, we should pick a VM, not a language.

Some kind of flexible bytecode implemented across browsers would be fantastic, and you could always implement a fallback interpreter in javascript (or if feeling fancy, a decompiler).

Isn't Javascript a flexible bytecode?

Re: My gripes with JavaScript

#13
post #9

i never thought that one day i will be the quy who posts this: try coffeescript, it really really helps (i would not believe it at first, either)

I'm not a fan of CoffeScript, it fixes the wrong problems. It's not the syntax that's the REAL issue, it's the fragmentation, lack of module system, etc.

Re: My gripes with JavaScript

#14
post #8

Earlier quoted context omitted.

Some kind of flexible bytecode implemented across browsers would be fantastic, and you could always implement a fallback interpreter in javascript (or if feeling fancy, a decompiler).

Isn't Javascript a flexible bytecode?

Well, yes, but it comes with all the overhead of being a (partly) flawed language. Having a bytecode that allows, for instance, optional static and dynamic types would be much more direct than relying on type inference or separate native APIs (as are being introduced). Of course we have javascript now, so pragmatically languages should be compiled to it if we want them, but if there were to be an additional web bytecode, there would be many areas for improvement in terms of performance and safety.

Re: My gripes with JavaScript

#15
post #11
post #10

Earlier quoted context omitted.

Or use a tool that compiles js.next to lowest-common-denominator-javascript.

Yay a dynamic language with a compiler step.

Python has a compiler step - source files (.py) are compiled into bytecode (.pyc) files. It just happens transparently. Doesn't make the language less dynamic IMHO.

Re: My gripes with JavaScript

#16
post #4

There seems to be agreement that Javascript is a messy language which is popular by default: it was included in Netscape, then other browsers picked it up. Now we're stuck with it. I realize this would be very difficult and introduce horrible compatibility issues for a while, but sometimes I think, "what if we could start over?" What if Chrome and Firefox started supporting Python or Ruby or a custom, well-designed l…

Not crazy at all, especially if is a VM that can host multiple languages. Hm... What would be even more interesting is a VM that can be configured form the server.

1. User opens a page with scripts in LanguageX. The page links to some kind of VM configuration file. 2. Browser loads that file, which enables it to parse LanguageX. Browser caches that file. 3. From now on, the browser can execute scripts in LanguageX.

Although, this particular idea might be the case when too much flexibility would lead to issues in the long run.

Re: My gripes with JavaScript

#17
post #13
post #9

i never thought that one day i will be the quy who posts this: try coffeescript, it really really helps (i would not believe it at first, either)

I'm not a fan of CoffeScript, it fixes the wrong problems. It's not the syntax that's the REAL issue, it's the fragmentation, lack of module system, etc.

CoffeeScript doesn't do much to fix the bad bits -- it's still JavaScript, after all -- but it does make the good bits way more fun.

Re: My gripes with JavaScript

#18
post #13
post #9

i never thought that one day i will be the quy who posts this: try coffeescript, it really really helps (i would not believe it at first, either)

I'm not a fan of CoffeScript, it fixes the wrong problems. It's not the syntax that's the REAL issue, it's the fragmentation, lack of module system, etc.

i agree, the biggest fix of coffeescript is not the syntax ( i never saw the JS syntax as the issue), the biggest fix / benefit of CS is:

   Everything is an Expression (at least, as much as possible)
a lot of the hassles with JS just disappear with this "small" change (if applied extensivly)

Re: My gripes with JavaScript

#19
post #4

There seems to be agreement that Javascript is a messy language which is popular by default: it was included in Netscape, then other browsers picked it up. Now we're stuck with it. I realize this would be very difficult and introduce horrible compatibility issues for a while, but sometimes I think, "what if we could start over?" What if Chrome and Firefox started supporting Python or Ruby or a custom, well-designed l…

If we started over, we should pick a VM, not a language.

Yes a VM would be nice. Or LLVM + native client, "portable native client", Google is (was?) working on this in Chromium.

Re: My gripes with JavaScript

#20
post #4

There seems to be agreement that Javascript is a messy language which is popular by default: it was included in Netscape, then other browsers picked it up. Now we're stuck with it. I realize this would be very difficult and introduce horrible compatibility issues for a while, but sometimes I think, "what if we could start over?" What if Chrome and Firefox started supporting Python or Ruby or a custom, well-designed l…

Chrome's ative code plugin NaCl lets you do this - there is a Tcl implementation using it so far, but no reason why there should not be others.
Post reply on HN