Skip to content

Commit 481ea26

Browse files
committed
Add TC39 January meeting blog post
1 parent 9a07a50 commit 481ea26

File tree

2 files changed

+132
-1
lines changed

2 files changed

+132
-1
lines changed

_pages/blog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
title: Blog
33
---
44

5-
## Coming Soon
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: TC39 Meeeting January 2017
3+
author: Maggie Pint
4+
ahandle: maggiepint
5+
categories: [standards,javascript]
6+
date: February 6, 2017
7+
excerpt_separator: <!--more-->
8+
---
9+
10+
Hello from your temporary JS Foundation Rep to TC39 - Maggie Pint!
11+
12+
This month, we met at the PayPal campus in San Jose California. It was my first TC39 meeting, and the experience was extremely enlightening.
13+
<!--more-->
14+
15+
I am happy to report that I got a friendly and positive reception from everyone there. The group as a whole was excited to have not one, but in fact
16+
three women attending a meeting. I was joined by Franziska Hinkelmann from the Node.js and V8 teams, and Anna,
17+
a student from the queer community who works with the Node.js team. This is the first meeting that had any women in it,
18+
so it was great that there could in fact be three of us.
19+
20+
## On the Subject of Diversity
21+
22+
The adoption of the new Code of Conduct for TC39 proceeds forward. This code of conduct is based off of the JS Foundation Code of Conduct
23+
and has been proven to work before. It is being put in place in hopes of making TC39 a more welcoming community for all.
24+
Of major concern was how code of conduct violations would be enforced. There was general consensus that any body investigating a code of conduct violation
25+
would need to be made up of a fairly diverse set of persons, some who were present when the violation occurred and some who were not. It was also decided that
26+
given the rarity of code of conduct violations, investigation bodies could be formed at the time of complaint, and there would not have to be one on call at all times.
27+
28+
TC39 members are positive about moving forward with the code of conduct, and are encouraged to review and make comments before the March meeting.
29+
[Community feedback on the new code of conduct is welcome](https://github.com/tc39/code-of-conduct-proposal).
30+
31+
## Getting Back to The Code
32+
33+
[You can find a full agenda of what was discussed at this meeting here.](https://github.com/tc39/agendas/blob/master/2017/01.md) I won't discuss every single line item
34+
but I want to highlight a few proposals that are potentially of great benefit. In particular, I want to touch upon:
35+
+ Null Propagation Operator
36+
+ RegExp Lookbehind
37+
+ 64 Bit Integers
38+
+ IEEE 754 Sign Bit
39+
40+
41+
### Null Propagation Operator
42+
43+
For the average developer, the `?.` operator - called here null propagation, but in other languages called null conditional, safe navigation, or elvis,
44+
is probably the most exciting proposal that moved forward at this meeting.
45+
It's use can be expressed easily by this code from [the proposal](https://docs.google.com/presentation/d/11O_wIBBbZgE1bMVRJI8kGnmC6dWCBOwutbN9SWOK0fU/view#slide=id.g1c161255c9_0_55);
46+
47+
Without the null propagation operator:
48+
49+
```js
50+
const firstName = (message
51+
&& message.body
52+
&& message.body.user
53+
&& message.body.user.firstName) || 'default';
54+
```
55+
56+
With the null propagation operator:
57+
```js
58+
const firstName = message.body?.user?.firstName || 'default';
59+
```
60+
61+
As you can see, the null propagation operator avoids constant checks for falsiness before navigating down an object graph, saving the developer substantial effort.
62+
As of right now, expect the null propagation operator to return `null` if it reaches a `null` property, and `undefined` if it reaches an `undefined` property.
63+
64+
This proposal advanced to stage 1 with overwhelming support from the committee given it's usefulness. That said, there is substantial concern about the behavior of this
65+
operator in several edge cases. This is a common complexity when adding syntax to a language.
66+
67+
### RegExp Lookbehind
68+
69+
Regular expression lookbehinds are a common feature in the regex implementations of several programming languages including .NET, Python, PHP, Go, and Ruby.
70+
[This proposal](https://github.com/tc39/proposal-regexp-lookbehind) creates a regular expression syntax that allows developers to ensure that a specific pattern either
71+
precedes or DOES NOT precede a capture group, without actually capturing that pattern.
72+
73+
One example scenario where this is useful is when capturing amounts of money. One can use a positive lookbehind to make sure that a dollar sign precedes an amount, by
74+
using the `(?<=...)` assertion. Completing the regular expression to look for digits, followed by a decimal, and then more digits we arrive at `/(?<=\$)\d+(\.\d*)?/`.
75+
This expression will match `$12.25` and return `12.15`.
76+
77+
If one wanted to ensure that `$` did not precede the number, one could use a negative lookbehind. This syntax is denoted as `(?<!...)`. Assuming that one wanted to find
78+
all decimal values that were not US dollars, one could change the previous regular expression to `/(?<!\$)\d+(\.\d*)?/`. This would match `10.53` but not `$10.53`.
79+
80+
This proposal was discussed at this meeting, but remained in stage 2. I just thought it was sweet, so I included it here.
81+
82+
### 64 Bit Integers / BigInts
83+
84+
I will not go deeply into [this proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703), but I want to note that for OS interoperability purposes,
85+
the Node.js team has a strong need for 64 bit integers. In addition to these use cases, there are significant usages for 64 bit integers in cryptography and gaming.
86+
87+
There is a feeling on the committee that it may be better to implement a bigint type - that is to say a type that is not limited to 64 bits, and can be optimized
88+
to the appropriate size based on the code, variables, and underlying system as appropriate. However, there is question as to whether this presents more work.
89+
Brendan Eich is investigating the implications of BigInt over Int64. If anybody has specific arguments about why a bigint type would be strongly preferable to an int64 type, we would be interested to hear your argument.
90+
91+
This proposal did not advance, due to need for feedback.
92+
93+
### IEEE 754 Sign Bit
94+
95+
If you have ever dealt with ECMAScripts famous `-0` then you are familiar with the inconvenience not having a way to explicitly ask for the sign of an IEEE 754
96+
floating point number is. For those who aren't familiar with this issue, observe the following:
97+
98+
```js
99+
Math.sign(2) // 1
100+
Math.sign(-2) // -1
101+
Math.sign(0) // 0
102+
Math.sign(-0) // -0
103+
```
104+
105+
This is not terribly helpful when one wants to determine the actual sign of a number while handling all edge cases. [This proposal](http://jfbastien.github.io/papers/Math.signbit.html) introduces a new
106+
api, `Math.signbit()` that resolves this issue. Observe:
107+
108+
```js
109+
Math.signbit(2) //false
110+
Math.signbit(-2) //true
111+
Math.signbit(0) //false
112+
Math.signbit(-0) //true
113+
```
114+
115+
As you can see, asking if -0 is negative will in fact result in -0 being negative. WIN!
116+
117+
This proposal advanced to stage 1 at this meeting.
118+
119+
### Summary
120+
121+
There were many other proposals discussed at the meeting, and I encourage you to look at everything that is in process on the [TC39 GitHub repository](https://github.com/tc39/proposals).
122+
123+
## Community!
124+
125+
Right now, TC39 is in the process of regrouping on the ECMAScript vision for the future. As part of this, several committee members will be reaching out to local
126+
user groups to hold discussions with users about what they want from the future of their programming language. I would love to hear more from any interested parties
127+
about things you hope to see. Feel free to reach out to me on twitter (@maggiepint) with any questions, or to [raise an issue on the JS Foundation standards repository](https://github.com/JSFoundation/standards).
128+
129+
In addition, if you want to contribute your opinions, remember that TC39 discusses proposals on [GitHub](https://github.com/tc39) where you are welcome to have a voice.
130+
131+
Finally, you can contribute code! TC39 maintains a test suite called [test262](https://github.com/tc39/test262) that provides feature acceptance testing to implementations of the spec. They would love more help to get further test
132+
coverage. Many of the implementors of ECMAScript use this test suite regularly, so contributions ensure better experiences for millions.

0 commit comments

Comments
 (0)