5 ms·
I know there are JS haters here on HN, but (as an old OS/compiler guy from the '70's and '80's), it's truly marvelous to see what you can do with dynamic langua
by cpr 9y ago
I know there are JS haters here on HN, but (as an old OS/compiler guy from the '70's and '80's), it's truly marvelous to see what you can do with dynamic languages by pouring hundreds man-years into optimized language implementations like V8.
- amelius 9y agoThe original V8, created by one man, was already pretty amazing.
- low_battery 9y agoNo it wasn't a one man job.
- low_battery 9y agoSo much energy is spent making a shitty language perform better. It is really sad.
- deleted 9y ago[deleted]
- wambotron 9y agoWe should only let people have one release of anything. That way there are no extra man hours spent on anything that some random guy on HN thinks is shitty.
- wruza 9y agoThe only way to prove something is not shitty is to release a monopoly and let other players show themselves in a fair competition. We'll wait for cross-platform assembler to be supported on every toster and see how long js can stand his 'beauty'.
- imtringued 9y agoWould you rather have that "shitty language" waste your time because it performs poorly?
- sqeaky 9y agoI think there are only historical reason to only having bad languages in browsers. Having good languages in WASM proves it. EDIT - Good from a performance perspective, things like static typing and symbolically executable and pre-compiled.
- hajile 9y agoWhat "good" languages does WASM enable? All those other dynamic scripting languages? They're DOA because nobody's going to download the entire VM every time. What about all those nice functional languages? Very problematic because the toolchain relies on LLVM-like semantics which don't like good garbage collectors or functional programming in general. We then get down to C-like languages, Rust, and more esoteric languages (and promptly discard the esoteric ones for lack of a decent ecosystem). Who in their right mind wants to write a front-end in C++ or Rust? By the time you get anything done, the web has changed and you're stuck with a pile of dated code that takes too much time and costs too much money to update. The web had a shot at a decent language with Dart (it was/is even an ECMA standard). It didn't die because of other browsers. It died because of poor web dev adoption rates. If only Eich had been allowed to implement scheme then none of this would have been an issue.
- pjmlp 9y agoThere are already ongoing efforts to port JVM and .NET environments into WASM, although currently it is more of a proof of concept. When WASM gets mature, expect the return of the plugins, maybe even a Flash to WASM compiler.
- hajile 9y agoI don't believe the answer to JS is downloading, and compiling the entire JVM.
- to3m 9y agoAnd just think how much easier it would be if it wasn't a dynamic language!
- Cthulhu_ 9y agoWhich is why the engineer behind the original V8 went on to create Dart, one of the reasons behind it being that it's much easier to optimize.
- saghm 9y agoI'm not sure it's completely fair to equate JavaScript hate with perceptions of dynamic languages in general, but there is a lot more work spent on optimizing JavaScript than pretty much any other dynamic language, so I'd agree that on a technical level the work done on JS engines is pretty impressive.
- abritinthebay 9y agoIt may not be completely fair but the critics do themselves no favors by using the same tired arguments from that camp over and over.
- saghm 9y agoI think there are a number things fairly unique to JavaScript (i.e. not present in other dynamic languages) that garner a certain amount of criticism even from fans of other dynamic languages. Type-independent equality (`==` rather then `===`), prototypical rather than class-based OO, and context-based meaning of `this`, among other things, get a decent amount of criticism, and you wouldn't run into the same issues in Python or Ruby, for instance. (Not trying a make a value judgment here about those aspects of JavaScript, just making a point that some of the criticism of JavaScript is specific to the language itself and not to dynamic languages in general).
- abritinthebay 9y agoIdentity vs Equality isn’t unique to JS. It’s particular syntax isn’t even unique either (though less common). Protypical inheritance goes back to the damn Actor pattern and modern versions (like JS) derive from Smalltalk. The particular implementation of this in JS is idiosyncratic to JS but not conceptually unique. They improved it a LOT with strict mode too. I swear, most JS criticism on HN seems to sound like developers who only know C++/Java/Ruby/Python critiquing stuff that comes from the Lisp/ALGOL/Smalltalk idioms and not understanding that the way they are used to isn’t the One True way.
- 9y ago
- vvanders 9y agoI'd be curious how LuaJIT stacks up today, last time I looked it was still a fair bit faster than V8. Of course it helps that Lua has much simpler semantics.
- wruza 9y agoMuch simpler semantics with much more powerful features, should we add. Because simpler here doesn't mean "dumber" in any way.
- pier25 9y agoI think the worst part about JS is not really performance but the language itself. I wish I could just write that I'm expecting to receive a User object in a function without having to resort to TypeScript. It would make code so much more readable.
- ridiculous_fish 9y agoJavaScript is fractally bad: you can find mistakes at every levels, as you zoom in or out. On the zoomed-in scale we see things like tricky semantics for regexp or Math.round(), which major implementations still get wrong. On the zoomed-out scale, we see things like property iteration order. This touches on array semantics and hidden classes. Why does v8 permit two objects to have the same properties but different hidden classes? Because JS requires that properties be enumerated in their definitional order - something no other language requires, and which puts serious constraints on implementations. TypeScript can layer types on top, but can't make arrays sane or fix the other deep language issues.
- pier25 9y ago> JavaScript is fractally bad This made my morning. :) I will quote you on this.
- pitaj 9y agoCan you expand on your hatred of JS arrays? I don't understand how iteration semantics really affect anything with them since the spec gaurantees that numerical properties come first, in order, regardless.
- ridiculous_fish 9y agoThe biggest issue is precisely concerning the definition of "numerical properties". Here are some "numerical properties:" 5 -0 "3" 3.0 4294967294 But these are not "numerical properties:" "-0" -1 "3.0" 4294967295 Which means that, when setting a property on an array, you must attempt to parse the object in a very peculiar way so that you can make a decision about iteration order, and whether to adjust the length property.
- tybit 9y agoAs a new school developer with an interest in languages, compilers and runtimes, I'm impressed as hell by what they've achieved with JavaScript performance. Doesn't make me dislike JavaScript any less though.