Live data from Hacker News

JavaScript at 20

brendaneich.github.io

291–300 of 327 posts

Re: JavaScript at 20

#291

"Date hand-ported (h/t ksmith@netscape.com) from java.util.Date" I knew it!! The Date class is/was the worst thing about the Java library. It has confused a generation of programmers about dates and time zones. The main problem is that it's not a date, it's a time stamp.

For examples how a neat DateTime API can look like you might want to check out Dart's DateTime from the standard library:

https://api.dartlang.org/apidocs/channels/stable/dartdoc-vie...

or

how Java 8 finally fixed DateTime inspired by Joda Time (http://www.joda.org/joda-time/): http://www.oracle.com/technetwork/articles/java/jf14-date-ti...

Re: JavaScript at 20

#292
Overall, JavaScript is a great language. I don't find the prototype-based approach to OOP any less intuitive than the class-based approach. I much prefer it in fact.

It just so happens that the prototype approach didn't catch on early enough. Developers are now just really set in their ways and are rather pretend that JavaScript is not a true OO language.

I feel that the addition of a 'class' concept to ES6 adds no value to the language itself, but I think it was probably a good decision anyway - Because JavaScript is more flexible and adaptable than the minds of most people - It might as well use that to its advantage.

Unlike the stubborn developers who refuse to learn about prototype inheritance, JavaScript is capable of change.

Re: JavaScript at 20

#293
post #145

Earlier quoted context omitted.

I think you're right that they weren't trying to do this with NaCl. They really were trying to do this with Dart, though.

Well, Dart would've been one other language in the browser, sure. But it's a language not that different from JavaScript in actuality. The benefits seem few for the work needed to support two different languages. Compiling to JS, which fits Dart quite well (probably because it was designed to compile to JS well), seems more productive to me. Some were excited Dart might lead to some sort of bytecode VM being added, b…

As more and more people write software in languages that compile to JavaScript instead of directly hand-writing JavaScript the demand for JavaScript becoming a better compile target grows.

In that sense adoption of Dart, ClojureScript, TypeScript, Elm et all will continue to accelerate JavaScript (language and runtime) improvements.

Re: JavaScript at 20

#294
post #288

Earlier quoted context omitted.

I use Django a lot too, but JavaScript (ES6 specifically) just isn't a big mental shift anymore. I prefer Python syntax, but Python, Ruby, and JavaScript are pretty comparable at this point. Also JavaScript has a pretty good variety of languages that compile to it. If you like C#/Scala/Swift use TypeScript. If you like Java use Dart. If you like Lisp ClojureScript.

If you come from Python or Ruby you'll probably have an easier time with Dart than with JavaScript. Dart comes with a batteries included standard library inspired by Smalltalk ( https://www.dartlang.org/docs/dart-up-and-running/ch03.html ). Dart should also feel familiar to people coming from C#. async/await support in Dart was designed by Erik Meijer (who worked on the feature for C#) and iirc he believes it is the…

I've done many many years Java, then hit Dart and was very impressed.

Since that I have had to do a fair bit of python, php and JavaScript at work. I think if I hadn't seen Dart first I would have quite liked python.

The problem with Dart is that once you've been developing in it for a while it spoils you from liking anything else. I really cringe with python, JS etc autocompleting to a million irrelevant things.

And going back to Java you have the slow dev loop that comes with a compiled language.

At the end of the day I've simply never had a development experience anywhere near as productive and enjoyable as Dart.

Re: JavaScript at 20

#295
post #283

Earlier quoted context omitted.

You didn't link to any of my comments, so let me help your reading comprehension. My point then was that if Google had had MS's IE4-6-era market share and lack of scruples, they could have pushed Dart into Chrome and started using it in their web properties, and the lack of equivalent performance between DartVM and dart2js -- especially due to lack of bignums and other affordances in JS, which lack Google materially…

> My point was not that JS must be the only way to run Dart simply because I or anyone at Mozilla (or anywhere else, MS and Apple included) prefers JS. That would be dumb, and it's clearly not what I wrote. I've never suggested that this is what you were saying there. Here I pointed to it as evidence that I was right that "one of Mozilla's reasons for decrying Google's intended browser support for Dart was that Dart…

The "and" and "the" line was from Mary McCarthy in reply to Lillian Hellman. You're Hellman :-|.

You wrote:

"As to support for other languages, I only have to point out that one of Mozilla's reasons for decrying Google's intended browser support for Dart was that Dart compiled to JS would not be competitive with the native Dart implementation."

The empty rhetorical flourish ("I only have to point out...") aside, this is rank question-begging. You assume that JS as Dart target being too slow must mean DartVM should win because of "competitive" force. Wrong on at least two counts (I'll ignore market power abuse):

First, DartVM may be faster at semantics JS supports due to optimization problems on the JS engine side. V8 in particular lost its founding team to DartVM, except for some moonlighting. Therefore "competitive" does not mean that JS cannot improve to be as fast when compiled from Dart as when the Dart source runs in DartVM.

Second, DartVM may have types and optimizations that JS lacks, bignums for example. Again "competitive" does not mean JS cannot change, and in fact bignums have been on the ECMAScript Harmony agenda since 2010, before "Dash" leaked.

In any competitive market with deep tech, there are lots of ways to meet a set of developer-facing language support/performance requirements. Even with all Google's billions, Dart and Chrome decision-makers couldn't ignore the compile-to-JS alternative and continue to justify developing and shipping DartVM + OilPan + all else not fully in hand to support JS and Dart with no performance regressions. Compiling to JS is the sole path forward for Dart on the Web precisely due to competition.

Citing my argument about bignums is perversely wrong, unless you assume DartVM is the only solution to any DartVM vs. dart2js performance disparity.

Such an assumption, like the one you seem to have made about NaCl, is anti-competitive, uneconomic, magical thinking. It requires indefinite amounts of time and money to fund all the work to have two VMs, a super-GC to collect cycles, write barriers as part of that super-GC, and more optimization to overcome the performance regressions imposed by those barriers (if possible). It assumes JS can't more cheaply be extended to be a fast-enough target language. You offer no proof.

BTW, you started out with NaCl and I still think you're mistaken about something pretty fundamental. NaCl was never proposed as a Web standard. Ok, suppose you mean PNaCl. The problem remains that PNaCl required a big API, Pepper, to reach the guts of chromium/Blink (originally WebKit) and the underlying OS. The problem with PNaCl was always Pepper, and again: competition killed Pepper as a cross-browser API.

It takes longer (it would have happened sooner with more cooperation from Google earlier, instead of the malinvestment on these two big follies), but JS is getting SIMD and shared memory threads, which are among the last few bricks still standing in the Pepper wall.

So PNaCl is evolving with Emscripten/asm.js now -- precisely due to competition -- and I would not hold my breath for PNaCl to remain based only on LLVM bitcode (with fixes requiring years and millions, to remove unspecified behavior). But feel free to hold your breath and then blame the "vendor cartel" if you like.

On that "vendor cartel" point, there are more web engines coming along, Servo (an open source project with multiple paying companies involved) among them. There's no cartel, just a big compatibility hill for any new engine to climb.

Adding gewgaws like NaCl and Dash slows down that climb. It's uncompetitive for the would-be market entrant. Why you think this requires collusion ("cartel") or Satanic pride ("reign in Hell") is unclear. Do you get many billion-dollar free lunches where you live?

Re: JavaScript at 20

#296

JavaScript at 20... apparently doesn't work. I load the page and get a big rectangle that says "JavaScript at 20" and "Brendan Eich" with a link to his Twitter, and nothing I do on the page takes me to the rest of the presentation.

Its insane but press the right arrow button.

Came here looking for this. Insane.

Re: JavaScript at 20

#297
post #167

Every single presentation of Brendan has this "I made this in 10 days" thing, super annoying. JavaScript is a great example how your career can go pretty well if you're good at selling what you're building, even if it's not very good. This isn't meant as a "JavaScript sucks" type of comment, but as a "being good at presenting your work is really important" type of comment. Too many really strong engineers aren't good…

I think he includes it as a joke .. clearly the first few slide states started "in 1993" and done "in 1995". The 10 days seems to be a self-deprecating joke on the popular (incorrect) meme.

No, I did original JS ("Mocha") in ten days.

The joke in those slides was how I went from my before-Netscape health (the picture of me doing a back handspring was from 1993; I joined Netscape in April 1995) to the after-those-ten-days-in-May-1995 state (looking like Ash from Evil Dead 3, with chainsaw for hand).

From 1992 to 1995 I worked for MicroUnity. No JavaScript there! It was not even a gleam in my eye, although I did write a language processor for editing MPEG-2 streams.

So I indeed created JS in a mad rush to get it into Netscape 2, along with other things Netscape tried as part of a platform play against Microsoft.

If I had not rushed, I would have missed not only Netscape 2, but also Netscape 3. Netscape 3 was supposed to be version 2.1, a minor release, until a company Netscape had acquired was given the browser and screwed up their release schedule so badly that it slipped into 1997 and became Netscape 4.

In 1998 or even 1997 it would have been too late to ship JS and have it make a de-facto standard. MS had already shipped VBScript as a me-too, and if they did not have JS to imitate, it would have been even more Microsoftian.

VBScript was the alternative to the JS rush job, in my settled view. I don't write this out of pride, joy, or defensiveness. I simply think it's the likeliest alternative outcome.

(Updated to correct Netscape 4 date per http://en.wikipedia.org/wiki/Netscape_Communicator to June 1997. It was so buggy that a series of firedrill releases were required to get it into barely usable shape by '98, which is what burned that year into my memory.)

Re: JavaScript at 20

#298

Earlier quoted context omitted.

I think he includes it as a joke .. clearly the first few slide states started "in 1993" and done "in 1995". The 10 days seems to be a self-deprecating joke on the popular (incorrect) meme.

No, I did original JS ("Mocha") in ten days. The joke in those slides was how I went from my before-Netscape health (the picture of me doing a back handspring was from 1993; I joined Netscape in April 1995) to the after-those-ten-days-in-May-1995 state (looking like Ash from Evil Dead 3, with chainsaw for hand). From 1992 to 1995 I worked for MicroUnity. No JavaScript there! It was not even a gleam in my eye, althoug…

Wanted - Fullstack VBScript developers You have: Delivered a fully functioning single page application Using Vanilla VBS. Delivered high performance backends with ASP(using VBScript) Advantage - you've used Angular.vbs and Backbone.vbs, and are familiar with react.vbs

Talk about dystopian alternative universes.

Re: JavaScript at 20

#299
post #293

Earlier quoted context omitted.

Well, Dart would've been one other language in the browser, sure. But it's a language not that different from JavaScript in actuality. The benefits seem few for the work needed to support two different languages. Compiling to JS, which fits Dart quite well (probably because it was designed to compile to JS well), seems more productive to me. Some were excited Dart might lead to some sort of bytecode VM being added, b…

As more and more people write software in languages that compile to JavaScript instead of directly hand-writing JavaScript the demand for JavaScript becoming a better compile target grows. In that sense adoption of Dart, ClojureScript, TypeScript, Elm et all will continue to accelerate JavaScript (language and runtime) improvements.

All part of the plan. I've been saying this since 2012, Dave Herman and Alon Zakai of Mozilla Research (asm.js creators along with Luke Wagner) said it before me:

http://brendaneich.github.io/Strange-Loop-2012/#/21

Love it when a plan comes together!

Post reply on HN