By Daniel Ehrenberg.
Daniel presents the TC39, the committee working on evolving the JavaScript language standard. Because JavaScript is both programmed by a diverse set of people and deployed in diverse settings, it is essential that its development be governed in a way that is inclusive to these various requirements. We are not there yet, but the TC39 is working on it, and this can be seen in the development of various new language features that are coming to JavaScript. The TC39 needs your help in bringing JavaScript to the next level, and Daniel explains how you can get involved.
(c) dotJS 2019
December 5-6, 2019
Paris, France
https://www.dotjs.io/
4. TC39 stages
● Stage 1: An idea under discussion
● Stage 2: We're doing this and have a first draft
● Stage 3: Basically final draft; ready to go
● Stage 4: 2+ implementations, tests ⇒ standard
7. What is BigInt?
➔ New primitive numeric type to do arbitrary length computations.
◆ New literal: 9128192832918293812823821n
◆ Operator overloading:
● 9007199254740991n + 2n === 9007199254740993n
➔ 64-bits TypedArray (BigInt64Array and BigUInt64Array).
➔ Standard Library to support type casts:
◆ BigInt() and Number() Constructors
➔ No implicit conversion between numbers and BigInt.
8. const x = 2 ** 53;
⇒ x === 9007199254740992
const y = x + 1;
⇒ y === 9007199254740992
9. const x = 2n ** 53n;
⇒ x === 9007199254740992n
const y = x + 1n;
⇒ y === 9007199254740993n
10. const x = 2n ** 53n;
⇒ x === 9007199254740992n
const y = x + 1n;
⇒ y === 9007199254740993n
nstands for BigInt
25. class PrivateCounter {
#x = 0;
}
let p = new PrivateCounter();
console.log(p.#x); // SyntaxError
class PublicCounter {
_x = 0;
}
let c = new PublicCounter();
console.log(c._x); // 0
Stage 3
28. // Salesforce abstraction
import { api } from '@salesforce';
class InputAddress extends HTMLElement {
@api address = '';
}
Using decorators to track mutations and rehydrate
a web component when needed.
Syntax abstraction for attrs/props in Web Components
// Polymer abstraction
class XCustom extends PolymerElement {
@property({ type: String, reflect: true
})
address = '';
}
Example of using decorators to improve ergonomics.
42. We have not been great in the past
Old process:
● Specification: Big MS Word doc
● Communication: Meetings and es-discuss list
● Committee not nearly as diverse as JS programmers
● First-principles theorizing pushing out experience
53. @littledan
Cultural evolution: The hardest part
● Newer values:
○ Accessibility to newer programmers
○ Integration into the existing JavaScript ecosystem
○ Incremental prototyping and iteration
○ Practicality over perfection (?)
● How to make tradeoffs?
Integrate with other value systems?
○ To be continued...
65. @littledan
Conclusion
● Lots of things coming to JavaScript
● Stage process clarifies progress
● We could use your help!
● We are working on making a
friendly, open environment
● Daniel Ehrenberg
● @littledan
● https://tc39.es
66. @littledan
What really matters: Human and ecological needs
● The climate emergency:
Power structures are destroying the world
● Inclusive, collective action to save us!
67. @littledan
What really matters: Human and ecological needs
● The climate emergency:
Power structures are destroying the world
● Inclusive, collective action to save us!
like TC39 and free software are trying to build (???)