JavaScript: Skeletons in the Closet Allen Wirfs-Brock @awbjs - - PowerPoint PPT Presentation

javascript skeletons in the closet
SMART_READER_LITE
LIVE PREVIEW

JavaScript: Skeletons in the Closet Allen Wirfs-Brock @awbjs - - PowerPoint PPT Presentation

JavaScript: Skeletons in the Closet Allen Wirfs-Brock @awbjs www.wirfs-brock.com/allen allen@wirfs-brock.com JavaScript: the worlds most widely used programming language Stack Overflow 2019 Developer Survey: 69.7% of professional


slide-1
SLIDE 1

JavaScript:
 Skeletons in the Closet

Allen Wirfs-Brock @awbjs www.wirfs-brock.com/allen allen@wirfs-brock.com

slide-2
SLIDE 2

JavaScript: the world’s most widely used programming language

Stack Overflow 2019 Developer Survey:
 69.7% of professional developers use JavaScript

slide-3
SLIDE 3
slide-4
SLIDE 4

How a sidekick scripting language for Java, created at Netscape in a ten- day hack, ships first as a de facto Web standard and eventually becomes the world's most widely used programming language.

slide-5
SLIDE 5

1995

1990 1991 1992 1993 1994

Tim Berners-Lee’s first Web browser is completed

25 December, 1990

Tim Berners-Lee public announcement of the “WorldWideWeb”

7 August, 1991

Alpha release of Mosaic (Unix)

June 1993

Mosaic released for Microsoft Windows

11 November, 1993

Marc Andreessen and Eric Bina start development of NCSA Mosaic browser

December 1992

Production release of Netscape’s browser (Navigator 1.0)

December 15 1994

Jim Clark and Marc Andreessen found
 Netscape Communications Corp.

April 1994

First public beta

  • f Netscape’s

browser

September 1994

JavaScript Prehistory

slide-6
SLIDE 6

01 02 03 04 05 06 07 08 09 10 11 12

Brendan Eich joins Netscape

April 1995

Java alpha release

April 1995

Netscape recruiting Brendan Eich to "Do Scheme in browser" Netscape strategizing about Scripting languages and Java Sun guerrilla marketing of Java

1995: JavaScript Year 0—Getting Started

Netscape announces licensing Java for browser

23 May

slide-7
SLIDE 7

“Come put Scheme into the browser”
 ... but, does Netscape need scripting?

Marc Andreessen Brendan Eich Bill Joy

  • Why was another language needed?
  • How to explain reason for two languages?
  • Did Netscape have the necessary skills?

April 1995 Planning for
 Netscape 2 beta in September 1995
 Assuming Netscape would license Java Microsoft is coming

slide-8
SLIDE 8

Mocha in 10 days


May 6-15(??), 1996

  • Brendan, go prove Netscape can do it!
  • What did Brendan actually build:

– Parser – Bytecode interpreter – Decompiler – Basic library – Browser-hosted REPL interface

slide-9
SLIDE 9
slide-10
SLIDE 10

01 02 03 04 05 06 07 08 09 10 11 12

Mocha demo

16? May

Netscape 2.0 beta 1 LiveScript & Java

18 Sep

Netscape/Sun JavaScript PR

4 Dec

Mocha prototype created in 10 days

6 May - 15 May

Eich refining Mocha and developing DOM0 Eich fixing beta Mocha/DOM bugs+Livewire integration

1995: JavaScript Year 0—Creating a Language

slide-11
SLIDE 11

01 02 03 04 05 06 07 08 09 10 11 12

Mocha demo

16? May

Netscape 2.0 beta 1 LiveScript & Java

18 Sep

Netscape/Sun JavaScript PR

4 Dec

Mocha prototype created in 10 days

6 May - 15 May

Eich refining Mocha and developing DOM0 Eich fixing beta Mocha/DOM bugs+Livewire integration

Bill Gates Internet Tidal Wave memo

May 1995

Internet Explorer 1.0 ships

16 Aug

IE 2.0 ships for Win95

22 Nov

Microsoft announces Visual Basic Scripting intent

5 Dec

Microsoft explores reverse engineering LiveScript

1995: JavaScript Year 0—Creating a Language

slide-12
SLIDE 12
  • A global binding for the identifier undefined
  • do-while statement
  • switch statement
  • try-catch-finally statement
  • labeled statements; break/continue to label
  • === operator
  • typeof , void, delete, in, and instanceof operators
  • Nested function declarations
  • Function expressions/anonymous functions

Features not in JavaScript 1.0

slide-13
SLIDE 13
  • Prototypal inheritance; no prototype property on

functions and built-in constructors

  • Function call and apply methods
  • A distinct Array object type
  • Array literals
  • Object literals
  • Regular expressions
  • Garbage collection

More Features not in JavaScript 1.0

slide-14
SLIDE 14

Features actually came from

  • C
  • AWK
  • (Scheme & Self)
  • Java Date
  • (Perl)
  • (Python)

“Make it look like Java”

slide-15
SLIDE 15

Brendan Eich 2016: “Sun (represented by Bill Joy) would not have accepted [in 1995] classes, as in Java’s nominal OO types, in JS. They wanted a sidekick language that did not include too much from Java itself.”

https://www.quora.com/Why-didnt-JavaScript-adopt-the-object-oriented-model-adopted-by-C++-Java-when-it-was-designed/answer/Richard-Eng-1/ comment/25744373#

Classes??

slide-16
SLIDE 16

Define objecting in JS 1. 0

slide-17
SLIDE 17

Coercion and ==

Also coercion of empty string to 0 provided a default numeric value for empty fields of HTML forms.

slide-18
SLIDE 18

JS 1.0 Properties Access Oddity

slide-19
SLIDE 19

JavaScript 1.1/Netscape 3


(Shipped August 1996)

  • Added prototype inheritance including constructor

prototype properties.

  • Fixed built-in constructors
  • Array class with special length property and join,

reverse, sort methods

  • Object coercion protocol: toString and valueOf

methods

  • Number constant methods: MIN_VALUE,

MAX_VALUE, etc.

slide-20
SLIDE 20

1995 1997

01 02 03 04 05 06 07 08 09 10 11 12

Netscape 2.0 and Livewire Server ship with JavaScript 1.0

18 Mar

Java JDK 1.0 release

January 1996

Internet Explorer 3.0 beta1 with JScript and VBScript

29 May

IE 3.0 ships with JScript 1.0

13 Aug

Brendan Eich works completing Mocha as JavaScript 1.1 Netscape 3.0 ships with JavaScript 1.1

19 Aug December 1996

Netscape 4 beta 1 with SpiderMonkey Ecma TC39
 JavaScript standardization
 startup meeting

21 Nov

Brendan Eich disappears for 2 weeks and creates SpiderMonkey/JavaScript 1.2

JavaScript 1996

JScript
 2.0

Jan 97

slide-21
SLIDE 21

SpiderMonkey/JS1.2 — Brendan’s 2nd Sprint


Beta Dec 1996, Netscape 4 June 1997

slide-22
SLIDE 22

How to do a standard?

Netscape/Sun December 1996 press release1:
 “Netscape and Sun plan to propose JavaScript to the W3 Consortium (W3C) and the Internet Engineering Task Force (IETF) as an open Internet scripting language standard.” Robert Cailliau2: “I was convinced that we needed to build-in a programming language, but the developers, Tim [Berners- Lee] first, were very much opposed. It had to remain completely declarative.”

1: https://web.archive.org/web/19970614002809/http://home.netscape.com:80/newsref/pr/

newsrelease67.html

2: http://en.wikinews.org/wiki/Wikinews_interviews_World_Wide_Web_co-inventor_Robert_Cailliau 


slide-23
SLIDE 23
slide-24
SLIDE 24

Attendees Ecma International
 TC39 organizing meeting
 November 21-22, 1996

slide-25
SLIDE 25

Base document contributions

slide-26
SLIDE 26

Key decisions at 1

st TC39 meeting


  • Limit initial standard to JS 1.1

functionality

  • Focus on the language – no web feature
  • Use Microsoft specification as base

document

  • Finish within 6 months
slide-27
SLIDE 27

ES1 Core Technical Working Group

Shon Katzenberger Guy Steele Brendan Eich

slide-28
SLIDE 28

What shall we call this langauge we are trying to standardize?


  • Jan. 14-15, 1997 meeting

– CoolScript, CoScript, Descartes,DeScript, DynaScript, Escript, EZScript, InfoScript, JScript JustScript, JSL, LiveScript, RadScript, ScriptJ, TranScript, W3Script, Wscript,wwwscript, Xpresso/Expresso/ Espresso – TC39: Sun/Netscape please let us use Java/LiveScript

  • Feb 19, 1997 meeting

– Sun: nope. Netscape: maybe...nope (May)

  • June 1997 ECMA GA, what’s the name?!!
  • July 1997 —RDScript or ECMAScript??
  • September 1997 — It’s ECMAScript

JavaScript

slide-29
SLIDE 29

ECMAScript 1–3 Timeline

slide-30
SLIDE 30
slide-31
SLIDE 31

Exception Handling Alternatives

slide-32
SLIDE 32

Waldemar Horwat , March 1998: “At a bare minimum you should be able to write code that works in ECMAScript 1.0 and 2.0 [ES4]. Full backwards compatibility would be rather painful.”

slide-33
SLIDE 33

ECMAScript Phase 2
 The Reformers Wander in the Desert

Sep 2005–Jul 2008 Jun 2002–Dec 2005 Sep 1998–Jul 2003

slide-34
SLIDE 34

ECMAScript 4 (take one)

Microsoft Netscape/AOL

JScript.NET JavaScript 2.0

  • Class-based nominal types
  • Static type checking
  • Lots of other stuff
  • Class-based nominal types
  • Dynamic type checking
  • Lots of other stuff

Macromedia Flash

ActionScript 2&3

  • Really wanted Java
  • Class-based nominal types
  • Static type checking
  • Not Web compatible

1909–2003

slide-35
SLIDE 35

ECMAScript 4 (take two)

λ

Macromedia/Adobe Academic CS Researchers Brendan Eich

ECMAScript 4
 (take 2)

2005–2008

slide-36
SLIDE 36

Browser Game Theory

  • Breaking-changes (even bug fixes) drive away users
  • New browsers must conform to what is already there
  • Innovation is wasteful if only present in one browser
  • First browser to try something new may actually

lose
 market share

Don’t break the Web!

slide-37
SLIDE 37

ECMAScript Development Timeline

slide-38
SLIDE 38
slide-39
SLIDE 39