Live data from Hacker News

The Birth and Death of JavaScript [video]

destroyallsoftware.com

71–80 of 236 posts

Re: The Birth and Death of JavaScript [video]

#71
post #44

Earlier quoted context omitted.

The thing is, good language design means you don't have to read the docs. The number one thing taught at user interaction / usabillity courses is that users don't read the documentation. Or skim it and go directly to one or two parts they want to check (Sure, some bizarro outliers do read it all). Besides, a golden rule from the UNIX era is the "principle of least surprise". Don't define stupid behavior as default, a…

Both behaviors make sense in isolation. It's not always so easy.

Juggling these interactions is exactly what makes good language design so difficult and time consuming. In the talk, I mention JS' ten-day design time several times for exactly this reason. Language design is hard and ten days just isn't enough time to carefully consider how everything will fit together. Try to imagine a programmer, even a brilliant one, noticing the map/parseInt interaction ten days after starting to learn JS, especially in 1995 when these high level languages were far less common. Seems unlikely!

Re: The Birth and Death of JavaScript [video]

#72
post #56

He says several times that JavaScript succeeded in spite of being a bad language because it was the only choice. How come we're not all writing Java applets or Flash apps?

Because Java, Flash, etc. couldn't easily manipulate the DOM . Javascript won for this reason.

DOM in that time wasn't that fancy it is now. The real reason is security.

Re: The Birth and Death of JavaScript [video]

#73
post #60
post #9

nice nice,ultimatly languages dont die,unless they are closed source and used for a single purpose ( AS3 ). In 2035,people will still be writing Javascript. I wonder what the language will look like though. Will it get type hinting like PHP? or type coercion? will it enforce strict encapsulation and message passing like Ruby ? will I be able to create adhoc functions just by implementing call/apply on an object? or s…

AS3 is not dead, and it is now open source

Dead for all practical purposes.

Re: The Birth and Death of JavaScript [video]

#74

Earlier quoted context omitted.

It's due to parseInt having an optional second parameter, the radix, and map passing the index as the second paramater, hence: xs = [ parseInt('10', 0), parseInt('10', 1), parseInt('10', 2) ]

And since 0 is falsy we get 10 for base 0.

It's not exactly checking for falsy values. Although all falsy values will lead to a radix of 10 being applied.

parseInt internally uses the ToInt32 abstract operation on the radix parameter. Once it has that value, it explicitly looks to see if the value is 0. If it is, it uses a radix of 10.

https://people.mozilla.org/~jorendorff/es6-draft.html#sec-pa...

Edit: I hope that doesn't come off as pedantic. My point wasn't to disagree as much as it was to just add some further explanation.

Re: The Birth and Death of JavaScript [video]

#75
post #61

The reason why metal doesn't exist now is because you can't turn the memory protection stuff off in modern CPU's. For some weird reason (I'm not an OS/CPU developer) switching to long mode on an x86 cpu also turns on the mmu stuff. You just can't have one without the other. There's a whole bunch of research done on VM software managed operating systems, back when the VM's started becoming really good. Microsoft's Sin…

I didn't want to go into this level of detail in the talk, but... I think you still want the MMU enabled, just not used for process isolation. With virtual memory totally disabled, a 1 GB malloc takes 1 GB physical memory even if it's not touched, you can't have swap at all, memory fragmentation kills you dead, etc. It still has a lot of utility outside of isolation. I don't have a good sense of how the performance c…

On linux, system calls don't result in a TLB flush - kernel data structures and code are in a different portion of the virtual address space (starting from the top of VM memory, if I remember right) that is tagged as not being available from ring 3. So system calls are quite fast.

EDIT:

Kernel memory begins at PAGE_OFFSET, see here: https://www.kernel.org/doc/gorman/html/understand/understand...

Kernel memory lacks the flag _PAGE_USER so that it isn't accessible from userspace: https://www.kernel.org/doc/gorman/html/understand/understand...

Re: The Birth and Death of JavaScript [video]

#76
post #56

He says several times that JavaScript succeeded in spite of being a bad language because it was the only choice. How come we're not all writing Java applets or Flash apps?

Because Java, Flash, etc. couldn't easily manipulate the DOM . Javascript won for this reason.

There were other advantages. To write JS you just need a text editor, and it's easy to pick up. To write Flash requires spending several hundred dollars. To write Java requires the JDK and to learn Java.

Re: The Birth and Death of JavaScript [video]

#77
post #57

Earlier quoted context omitted.

I just wrote this line about two hours ago and my tests weren't thorough enough to catch the bug it introduced. Just when I thought I knew JavaScript. Thanks for saving me some time.

Always give the base to parseInt in Javascript. Always. The moment you don't, all kinds of bugs follow. I have to go cry now at the number of times this has bitten me.

Are there any other problems aside from octal?

Re: The Birth and Death of JavaScript [video]

#78
post #43

Earlier quoted context omitted.

Classic video, though it's wrong at times. For instance, the audience member who corrected him was right.

couldn't quite make it out, what did he correct?

The second JavaScript example, when he told someone in the audience, "No, that's just an object." It was a string.

Re: The Birth and Death of JavaScript [video]

#79
Looks like Erlang is already getting one step closer to the metal:

http://erlangonxen.org/ http://kerlnel.org/

Also there is another project that can be related to that goal:

"Our aim is to remove the bloated layer that sits between hardware and the running application, such as CouchDB or Node.js"

http://www.returninfinity.com/

Post reply on HN