00:07
<Justin Ridgewell>
How do you return a named fields in Foo({x, y})?
00:07
<snek>
return [{ x, y }]
00:07
<Justin Ridgewell>
Ok
00:08
<littledan>
was Mark asking, "is it important to have this capability outside of pattern matching"?
00:08
<Justin Ridgewell>
So it always returns an array, or false on no match?
00:08
<nicolo-ribaudo>
was Mark asking, "is it important to have this capability outside of pattern matching"?
No, he was asking "does pattern matching need anything else?"
00:08
<ljharb>
he was asking if pattern matching combined with extractors could be more minimal than it in fact can be (the answer is no, extractors do not allow much simplification of pattern matching at all, but it composes nicely)
00:08
<littledan>
oh, I see
00:08
<nicolo-ribaudo>
So it always returns an array, or false on no match?
Yes exactly
00:09
<snek>
i don't love the nesting but i'm more than willing to accept it in exchange for the insane usefulness of this proposal
00:10
<littledan>
what is it about the nesting that you don't like?
00:10
<Justin Ridgewell>
Is Pattern Matching doesn’t advance, can we get if (Foo(x) = y) support?
00:11
<snek>
no, that's already valid syntax
00:11
<Justin Ridgewell>
In loose mode only
00:11
<ljharb>
lol what is loose mode
00:11
<littledan>
the semantics would only be, in the case where it was going to throw, to take the else branch
00:12
<bakkot>
In loose mode only
we didn't actually spec that
00:12
<bakkot>
but yes
00:12
<bakkot>
https://github.com/tc39/ecma262/issues/257
00:12
<Justin Ridgewell>
lol what is loose mode
My Babel name for “not strict”
00:13
<ljharb>
loose mode is about the transpilation tho, not about what the surface syntax can be, right?
00:13
<ljharb>
strict/sloppy would be the runtime pair
00:13
<Justin Ridgewell>
Oh, we call it sloppy
00:13
<Justin Ridgewell>
Same thing. 😛
00:13
<Duncan MacGregor>
Could implementation avoid most of the megamorphic cases by doing an instanceof test first?
00:13
<snek>
if we're ok with reusing syntax in strict mode then sure we can add it
00:14
<littledan>
anyway we're hoping, for this proposal, that even in sloppy mode, we can replace the exception with helpful behavior
00:14
<snek>
i thought we weren't though
00:14
<snek>
i don't personally care to preserve it
00:14
<bakkot>
the syntax is always a runtime error (in web reality) so we could probably get away with changing its semantics
00:14
<snek>
yea that would be nice
00:15
<littledan>
yes, the requirement for web reality was more about, it doesn't make a syntax error
00:15
<snek>
although it would break my future dream proposal where functions can return references
00:15
<snek>
array.at(-1) = 5
00:15
<nicolo-ribaudo>
Ron has a refs proposal
00:16
<snek>
i implemented return& in engine262 once. there's probably a branch somewhere
00:16
<bakkot>
although it would break my future dream proposal where functions can return references
good.jpg
00:17
<snek>
Ron has a refs proposal
lgtm ship it
00:18
<shu>
i love pointers
00:19
<bakkot>
I like hints
00:19
<bakkot>
just do them as a bitfield instead of having to allocate
00:19
<bakkot>
works nicely with void bindings too
00:26
<shu>
i have a sidebar question about the general topic of "TC39 watching" for after this actual topic
00:26
<rbuckton>
Is Pattern Matching doesn’t advance, can we get if (Foo(x) = y) support?
Since it's an expression, and an expression could be nested anywhere for any purpose, I'm not sure how likely that is. I certainly hope pattern matching advances because it has a solution for this.
00:27
<shu>
who is doing TC39 watching and interpreting what we do and speculating conclusions from them? is it a few thinkfluencers?
00:27
<shu>
littledan: ^
00:28
<Justin Ridgewell>
I’ve definitely seen hot takes on twitter about advancements/rejections
00:28
<shu>
tbc i believe in the importance of sending signals, but i've only been thinking about that in context of more direct stakeholders
00:28
<jschoi>
My impression is that lot of webdevs pay attention to TC39, but relatively few read the meeting notes.
00:28
<Justin Ridgewell>
But I don’t think MessageFormat has a rabid following
00:28
<ljharb>
(there are 94 stage 1 proposals)
00:29
<Justin Ridgewell>
Since it's an expression, and an expression could be nested anywhere for any purpose, I'm not sure how likely that is. I certainly hope pattern matching advances because it has a solution for this.
I should revise this to if (const Foo(x) = y
00:30
<Michael Ficarra>
I'm pretty sure I hated the export v from "mod" proposal but I can't remember ljharb
00:30
<Justin Ridgewell>
I think that’d only be valid at top level, but still has the sloppy nonsense.
00:30
<jschoi>
ljharb: Is it worth distinguishing between “withdrawn” (actively withdrawn by the champions) proposals and “inactive” or “stale” (removed because champions are inactive) proposals?
00:30
<ljharb>
I'm pretty sure I hated the export v from "mod" proposal but I can't remember ljharb
hated with a technical justification? or just a "i will grumble about it"
00:31
<ljharb>
ljharb: Is it worth distinguishing between “withdrawn” (actively withdrawn by the champions) proposals and “inactive” or “stale” (removed because champions are inactive) proposals?
we distinguish that in the "reason" column of the "inactive proposals" table
00:31
<Michael Ficarra>
there was a technical problem with it, but I need to look at it again to remember
00:31
<Michael Ficarra>
as in it should not exist
00:31
<nicolo-ribaudo>
It was that it looks like you are getting v from mod?
00:31
<snek>
also that people hate barrel modules
00:32
<nicolo-ribaudo>
I have a proposal for that, I presented it one or two meetings ago
00:32
<snek>
actually i guess thats * as x from
00:32
<snek>
this is {default as x} from
00:32
<nicolo-ribaudo>
actually i guess thats * as x from
This is supported now
00:32
<Michael Ficarra>
oh yeah it's just short for export { default as v } from "mod" which we already have, right?
00:32
<snek>
This is supported now
yea
00:32
<nicolo-ribaudo>
oh yeah it's just short for export { default as v } from "mod" which we already have, right?
Yes
00:32
<Michael Ficarra>
yes then what point is there?
00:33
<snek>
it fills in an empty spot in a markdown table someone made
00:33
<Michael Ficarra>
yeah that's baaaad
00:33
<nicolo-ribaudo>
One recent point was that import source would only support that new form, and some delegates would thus also like to see it for normal exports
00:33
<ljharb>
the point is to have nicer syntax, and to provide for the conceptual mental model that defaults is not just another named export.
00:33
<Michael Ficarra>
also it looks at first glance like export { v as v } from "mod"
00:34
<Michael Ficarra>
why? I don't see how that follows
00:37
<snek>
do we have a formal process of cleaning up proposals that someone was championing when they are offboarded
00:38
<Chris de Almeida>
no
00:38
<bakkot>
() =*> (yield 0) is incredible actually
00:38
<bakkot>
we should just do that
00:39
<ljharb>
the formal process is, someone brings it up in plenary, and we agree
00:39
<snek>
() =*> (yield 0) is incredible actually
this exact sequence of tokens
00:39
<snek>
nothing else
00:40
<Richard Gibson>
() =*> (yield 0) is incredible actually
RSI hazard
00:40
<rbuckton>
=*> is such a strange looking sigil
00:40
<snek>
=*> is such a strange looking sigil
clown operator
00:43
<Michael Ficarra>
() <=> ...
00:43
<shu>
i can only describe the vibe of =*> as sparkle
00:46
<Kris Kowal>
() => () function
() =*> () generator function
() =~> () async function
() =~*> () async generator function
00:47
<jschoi>
Proposals that were withdrawn due to inactivity can always be revived later, right?
00:47
<snek>
yeah
00:47
<littledan>
Proposals that were withdrawn due to inactivity can always be revived later, right?
yes definitely
00:51
<Rob Palmer>
From Myles: https://x.com/MylesBorins/status/1754925725436567721
00:51
<Luca Casonato>
Myles says thanks: https://twitter.com/MylesBorins/status/1754925725436567721
00:52
<littledan>
the formal process is, someone brings it up in plenary, and we agree
the principle here was, today we're just reviewing things and later we can take things up
00:54
<littledan>
who is doing TC39 watching and interpreting what we do and speculating conclusions from them? is it a few thinkfluencers?
In the case of MessageFormat: maybe the biggest audience is the organizations working together on this, and the Unicode Consortium. We want to communicate to them clearly that we're not rejecting their work. I hope that this will help people convince their employers to let them keep working on this and proceed with deployments, where they might have been waiting for our stage advancements first.
00:55
<shu>
ok, thanks
01:00
<littledan>
(there are 94 stage 1 proposals)
Yeah this is potentially a pretty long exercise, which we could spread over multiple meetings. I'd be interested in everyone's feedback on whether it's worth it to continue.
01:02
<bakkot>
is the list of attendees for historical meetings available somewhere?
01:03
<littledan>
Ecma's filer has minutes going all the way back
01:04
<Michael Ficarra>
https://ecma-international.org/ecmascript-development-archive/
01:04
<jschoi>
I think it’s worth it. The list of Stage-1 proposals is communication to the developer community about potential features that are getting activity. Preventing it from getting excessively long helps with that community communication.
But I think that there maybe should be async outreach, before each meeting, to champions whose Stage-1 proposals are going to get evaluated for withdrawal.
17:56
<Chris de Almeida>
please add your name to the attendees list at the top of the day 3 meeting notes
18:02
<snek>
where is the template for the notes doc
18:02
<snek>
i want to fix the tree alignment once and for all
18:02
<Chris de Almeida>
the template are the docs themselves...
18:03
<Chris de Almeida>
we just clear them out each time
18:24
<Rob Palmer>
Gus, be the change you want to see! Create a template doc and align those trees. We'll use it in future.
18:55
<Kris Kowal>
Good luck aligning the trees portably. Gonna need to bring ye some tab stops or a beefy table.
19:01
<Kris Kowal>
I’m late to realize that this could be spelled Error.throw(message) and be inherited down the constructor prototype chain. I had assumed Error.throw or Error.raise implied code like Error.throw(new SpecificError(message))
19:01
<Richard Gibson>
I don't think that observation is too late
19:02
<Michael Ficarra>
I’m late to realize that this could be spelled Error.throw(message) and be inherited down the constructor prototype chain. I had assumed Error.throw or Error.raise implied code like Error.throw(new SpecificError(message))
https://github.com/tc39/proposal-throw-expressions/issues/24
19:04
<ljharb>
I’m late to realize that this could be spelled Error.throw(message) and be inherited down the constructor prototype chain. I had assumed Error.throw or Error.raise implied code like Error.throw(new SpecificError(message))
it has to be syntax or else it impacts the stack
19:04
<snek>

This [special logic to discard the topmost frame] is not an option, both because stacks aren't in the spec and because making a specific function magic in this regard would be profoundly problematic.

ljharb this is exactly how Reflect.apply works???

19:04
<ljharb>
O.o
19:05
<Kris Kowal>
This does not seem like a big downside.
19:05
<ljharb>
if Reflect.apply is omitted from stack traces that'd be surprising to me, but either way "ES6 has X kind of magic" is not a justification for adding magic in the future
19:05
<snek>
its not magic, its a tail call
19:06
<snek>
its also specified with spec steps, not prose
19:06
<Kris Kowal>
Given that syntax is the deepest magic, I think I’d favor the lesser magic of either tolerating a useless frame or magically omitting the frame.
19:06
<ljharb>
since stacks aren't in the spec, there's no way we can mandate the latter afaik. even with tail calls i'm not sure how we mandate that?
19:07
<ljharb>
but tail calls don't exist in terms of broad web reality.
19:07
<snek>
the stack is in the spec... we just don't ever say anywhere that it relates to the stack property because that doesn't exist
19:07
<shu>
bakkot: how complex is the lookahead restriction to implement?
19:07
<snek>
Reflect.apply is also implemented as a tail call even outside safari
19:07
<Richard Gibson>
since stacks aren't in the spec, there's no way we can mandate the latter afaik. even with tail calls i'm not sure how we mandate that?
nor can we prevent any implementation from omitting them as an obvious ergonomic decision
19:08
<ljharb>
either way if a helper function works than (() => { throw x })() isn't that much worse than Error.throw(x) so i'm not sure why we'd add anything in that case
19:09
<bakkot>
bakkot: how complex is the lookahead restriction to implement?
in the spec? trivial. in a parser? uhhh pretty easy I expect
19:10
<shu>
in the parser i meant
19:11
<nicolo-ribaudo>
In the parser it would be "if the next token is in this list, throw an error and abort parsing"
19:11
<nicolo-ribaudo>
At the end of the function that parses throw expressions
19:11
<bakkot>

yeah, in the parseThrowExpression branch in your recursive descent parser you just do

eat('throw');
let rhs = parseUnaryExpression();
if (noLineTerminatorBeforeLookahead() && ['+', '?', /*etc*/].includes(lookahead()) {
throw new SyntaxError
}
19:11
<shu>
but when parsing which productions
19:11
<nicolo-ribaudo>
only ThrowExpression
19:11
<bakkot>
in non-recursive-descent parsers it might be harder but those don't exist
19:11
<shu>
ThrowExpression is inside Expression in option 3?
19:12
<bakkot>
it's inside UnaryExpression I think? or around there anyway
19:12
<nicolo-ribaudo>
Yeah in UnaryExpression
19:12
<shu>
ok thanks
19:14
<snek>
it should be trivial in v8
19:14
<nicolo-ribaudo>
I need to go check the notes on why Waldemar would be against option 1/2 but with only UnaryExpression, I only remember his concerns about lookahead
19:14
<shu>
it is an extra keyword check where there isn't
19:15
<shu>
if that check is very localized, probably not costly in runtime or maintenance burden
19:15
<shu>
but not clear to me yet which option is the cheapest
19:15
<nicolo-ribaudo>
1 is probably the cheapest because the check is only in one more place
19:16
<nicolo-ribaudo>
2 would make you check for the kw in like 3-4 places
19:17
<nicolo-ribaudo>
Is Mark in this room? (I would like to write him that I believe all of those problems will be caught as soon as we implement them in a tool's parser, but that he can propose to invite him)
19:18
<ljharb>
erights is here yes
19:18
<Kris Kowal>
Mark’s not monitoring this room, I’m sure.
19:27
<shu>

i heard a lot of discomfort around syntax for this, and the main counterarguments for syntax i heard were:

  • extra stack frame
  • throwing non-errors (which doesn't seem to be a counterargument? surely a helper method can take arbitrary values)
19:27
<shu>
can someone say more why the extra stack frame is a problem?
19:28
<Justin Ridgewell>
It's only an extra stack frame in the debugger, right?
19:28
<Duncan MacGregor>
I've not kept up with the history of X expressions for various X. They are all being pursued because they have some use, but would it be better to investigate some form of expression blocks as Java is doing in various contexts?
19:28
<bakkot>
I wish we could resolve issues without stage advancement
19:28
<snek>
there is concern about how to specify that engines shouldn't show the extra stack frame in strings/debugging
19:28
<Justin Ridgewell>
thrower(new Error('foo')) has the correct err.stack trace
19:28
<bakkot>
the helper function thing is prior to the question of precise syntax, and we have had that discussion
19:29
<littledan>
can someone say more why the extra stack frame is a problem?
performance? also making it apparent that the code below it is unreachable?
19:29
<ptomato>
I've not kept up with the history of X expressions for various X. They are all being pursued because they have some use, but would it be better to investigate some form of expression blocks as Java is doing in various contexts?
yes some of us would like that very much 😄 https://github.com/tc39/proposal-do-expressions
19:29
<littledan>
the helper function thing is prior to the question of precise syntax, and we have had that discussion
Can someone refer to the prior notes where we reached that conclusion?
19:29
<Richard Gibson>

extra stack frame seems like a total non-issue, cf. Reflect.apply:

$ eshost -se '(function main(){ return Reflect.apply(function inner(){ return new Error("message").stack.replace(/ *[(].*|/gm, "").replace(/\/tmp\/.*/g, "$file"); }, undefined, []); })()'
#### engine262
Error: message
    at inner
    at main
    at <anonymous>:1:1022

#### JavaScriptCore
inner@$file
main@$file
global code@$file

#### Moddable XS
Error: message
 at inner
 at apply
 at main
 at

#### QuickJS
at inner
    at apply
    at main
    at <eval>

#### SpiderMonkey
inner@$file
main@$file
@$file

#### V8
Error: message
    at inner
    at main
    at $file
19:29
<ljharb>
indeed a function that's just x => { throw x; } will have the right stack trace iff x is an error object. if it's not one, it won't have a trace, but engines may still report the helper function as the throw site and not the helper function's call site as the throw site.
19:30
<snek>
its not a problem in real engines to ignore the frame when preparing presentation of the stack for strings/debug interfaces. they already do this a lot for their own internal stuff.
19:30
<shu>
performance? also making it apparent that the code below it is unreachable?
how is it a performance problem?
19:30
<ljharb>
node, in particular, has magic "show the throw site" behavior
19:30
<Duncan MacGregor>
yes some of us would like that very much 😄 https://github.com/tc39/proposal-do-expressions
Ah right, that how JS spells it.
19:31
<littledan>
how is it a performance problem?
a very small one? I'm not convinced this is a significant issue but it seemed that people were claiming that.
19:31
<bakkot>
indeed a function that's just x => { throw x; } will have the right stack trace iff x is an error object. if it's not one, it won't have a trace, but engines may still report the helper function as the throw site and not the helper function's call site as the throw site.
strongly agree with richard that we should not be designing this feature based on things that happen when throwing non-error objects
19:31
<snek>
node, in particular, has magic "show the throw site" behavior
btw this only works if the error is terminal
19:31
<shu>
a very small one? I'm not convinced this is a significant issue but it seemed that people were claiming that.
i wasn't being flippant. what is "that"? i don't actually know
19:31
<ljharb>
sure i'm fine with that (as long as it allows throwing anything) but i'm talking about the throw site behavior conflicting with the stack
19:32
<littledan>
i wasn't being flippant. what is "that"? i don't actually know
(I was probably misunderstanding; don't worry)
19:33
<Richard Gibson>
heck, even meta-function throw.new(…) would have better grammar characteristics
19:33
<ljharb>
at any rate i don't think a helper function that does nothing but throws its argument holds its weight to add to the language - syntax for this would (whether the benefits justify syntax is a separate topic) (a metafunction would be syntax)
19:33
<bakkot>
at any rate i don't think a helper function that does nothing but throws its argument holds its weight to add to the language - syntax for this would (whether the benefits justify syntax is a separate topic)
what about an Error.prototype.throw?
19:33
<nicolo-ribaudo>
what about an Error.prototype.throw?
"but I want to be able to throw a number!!!"
19:34
<bakkot>
what about an Error.prototype.throw?
not that I am advocating this, just want to know what your position is
19:34
<ljharb>
that's certainly somewhat cleaner than a static helper function, but doesn't change my position
19:34
<ljharb>
in all srsness i throw strings in CLI programs constantly, the terminal output is way cleaner than throwing an error
19:35
<bakkot>
console.error('msg'); process.exit(1)
19:36
<ljharb>
that "works" but relies on two different mutable globals, and is two statements instead of one
19:40
<snek>
you should never throw things that aren't errors
19:40
<ljharb>
that is certainly an opinion many hold
19:40
<snek>
the only reason nodejs has support for a backtrace in this case is so you can find the broken code thats doing it and fix it
19:41
<ljharb>
since nobody throws non-errors, and i don't throw fully dynamic things, turns out it's really really easy to grep for places that statically throw primitives :-p
19:42
<jschoi>
throw.something() or keyword.throw() should strongly be considered as one of the possible designs.
19:51
<nicolo-ribaudo>
I would want us to still investigate whether this can be written without lookahead, and then once we know that it can indeed be expressed with "normal" grammar write the spec in the way that is editorially preferred
19:52
<nicolo-ribaudo>
We cannot just completely ignore what was discussed last time the restriction was presented
19:52
<nicolo-ribaudo>
Even though Option 3 would indeed be my preferred
19:55
<snek>
can we fit tail calls into 8 minutes
19:55
<rbuckton>
I would want us to still investigate whether this can be written without lookahead, and then once we know that it can indeed be expressed with "normal" grammar write the spec in the way that is editorially preferred
I think it can, though I need feedback from the editors on a few points. The grammar is far more complex than the lookahead, however: https://gist.github.com/rbuckton/d26f0e04bd693324a87c3da3835d87f2
19:55
<ljharb>
can we fit tail calls into 8 minutes
pls no
19:55
<nicolo-ribaudo>
Thanks, I'll take a look at it
19:57
<rbuckton>
throw.something() or keyword.throw() should strongly be considered as one of the possible designs.
So long as do expressions is still active, I do not think throw.something() or keyword.throw() is an improvement over do { throw ex }. throw expressions have the upshot of being far simpler to specify and more tightly focused than do.
19:59
<rbuckton>
i.e., if we already had do {}, there would be no benefit for throw.somthing(). In fact, if we had throw.something(), its likely it would be abandoned if do {} reached stage 4, which would be a waste. throw expressions, on the other hand, are unlikely to be abandoned due to the fewer characters and lower cognitive burden that do {} requires.
20:02
<rbuckton>
The biggest benefit of throw is the improved developer experience. (throw ex) reduces that benefit, do { throw ex } even more so, and throw.something(ex) is considerably worse.
20:03
<rbuckton>
Error.throw has a similar reduced DX, and the only user benefit I see is you could pass it as a callback, which I do not consider to be a valuable benefit.
20:04
<jschoi>
I think this is reasonable, but, as long as we’re imagining a future in which do expressions finally get added to the language, do expressions would weaken the case for throw expressions as much as they would weaken the case for a throw pseudo-function.
20:05
<rbuckton>
We had that discussion in both the July and September 2023 plenaries, and the sentiment I heard was that throw would be valuable even in the presence of do {}.
20:10
<jschoi>
Sorry that we’re relitigating already-covered ground.
Though I don’t recall a throw pseudo-function (what do we call import(), again?) being considered back in those plenaries as one of the options. I do still wonder how much less value it would give than throw expressions, in the presence of do expressions.
20:10
<rbuckton>
I am not confident that do {} will advance, and I don't think a throw.something() meta-property would align with Kris Kowal 's suggestion, nor do I think it would be an improvement to the syntactic budget that throw already consumes.
20:12
<rbuckton>

IIRC, we did discuss throw() in plenary in September, though it may have only been in matrix. throw(ex) does not work as a call-like syntax as it still suffers from precedence issues, i.e.

throw (a) + b; // throws `a + b`
(throw(a) + b); // throws `a`
20:15
<jschoi>
Yeah, it would be a throw pseudo-method, I guess. throw.something() or keyword.throw(). I don’t feel strongly about these pseudo-method solutions, except that they should be thoroughly considered if it hasn’t yet been. It’s syntactically lightweight and lets developers throw errors within expressions.
If do expressions never end up advancing, then that makes the case for both throw expressions and a throw pseudo-method that much stronger.
20:27
<rbuckton>
IMO, if we going to have syntax, I would rather have (throw ex) than throw.something(ex). There is no benefit to a meta-method here, and if we were going to use meta-properties related to exceptions I'd strongly prefer catch.foo over throw.foo.
20:28
<snek>
does anyone actually have major problems with (non-async) do expressions at this point
20:28
<snek>
it just need some spec formalization and validation right
20:30
<Bradford Smith>
IMO, if we going to have syntax, I would rather have (throw ex) than throw.something(ex). There is no benefit to a meta-method here, and if we were going to use meta-properties related to exceptions I'd strongly prefer catch.foo over throw.foo.
Why not throw (ex) (parentheses around the value required)? I think that is a possibility, right?
20:31
<rbuckton>
No, see my comment just above this. It has the same precedence issue that bakkot objected to
20:32
<Bradford Smith>
rbuckton: Is the desire to have TS recognize throws within expressions during static analysis a primary reason for wanting throw expressions in the first place?
20:33
<rbuckton>
rbuckton: Is the desire to have TS recognize throws within expressions during static analysis a primary reason for wanting throw expressions in the first place?
No, that is a side benefit but was never a major motivation.
20:35
<Bradford Smith>
I don't particularly care whether throw expressions become a thing or not, but I don't understand how they could bring enough benefit to be worth even the amount of effort we've spent discussing them so far. I just checked the explainer, and I don't see any explanation of motivation.
20:40
<Richard Gibson>
We had that discussion in both the July and September 2023 plenaries, and the sentiment I heard was that throw would be valuable even in the presence of do {}.
yes, but only subject to lack of grammar issues (which we clearly do have)
20:40
<rbuckton>
It is a bit disheartening to have reached stage 2 with consensus in 2017, and reached near-unanimous agreement to advance to stage 3 in 2018 barring a lone objector whose two objections were do and the precedence issue we're discussing today. The do objection was finally retracted in July 2023, so my impression was that we'd already reached consensus on all of the other points of the proposal and the precedence concern was the only remaining obstacle. I hate to check a box on TC39 bingo, but it does feel like I'm relitigating points that had already had broad agreement.
20:42
<rbuckton>
bakkot's only remaining concern was avoiding a footgun of accidental use of tokens like + or , following the unary expression. IMO, that's something a linter could warn you about, but bakkot preferred baking that restriction into the language, much like we did for the precedence concern around || and ??.
20:48
<rbuckton>
There is a definite benefit to users to be able to throw exceptions in-situ in an expression. Existing mechanisms like const __throw = ex => { throw ex; } suffer drawbacks around the debugging experience. Error.throw is a possibility, but we don't generally bake distinctions around stack frames and debugging into the specification, and it's also far less ergonomic than throw. throw expressions also have prior art in multiple other languages, so it is not a net-new concept.
21:13
<bakkot>
this slide would be a lot more convincing if there were examples of the alternative and the alternative syntax were bad, but none of them seem to be?
21:14
<bakkot>
like instead of @app.route('/') function index(){} it would be const index = app.route('/', function (){})
21:14
<bakkot>
those are... almost identical
21:14
<bakkot>
I do not understand what the point of syntax is here
21:14
<bakkot>
can someone who wants decorators explain if I am missing something? littledan ?
21:15
<bakkot>
"decorator decorators" is just... function composition?
21:15
<littledan>
yes... what's wrong with that? it's a simple feature
21:15
<ljharb>
to be fair we don't have pipeline yet to make function composition more ergonomic
21:16
<bakkot>
I just don't see why we need another, specialized kind of function invocation, I guess?
21:16
<bakkot>
there should be a pretty high bar for adding a new syntax way of doing an existing thing
21:16
<ljharb>
in general, because a(b(c(d))) sucks and is backwards (not trying to say that that supports any specific proposal, including this one)
21:16
<littledan>
I think it is a bit different in terms of mental model
21:16
<bakkot>
all syntax needs to be learned by all learners of the language, so that's a high cost
21:17
<littledan>
this is a really natural extension of class decorators
21:17
<Michael Ficarra>
it's not backwards if you read right-to-left
21:17
<Justin Ridgewell>
yes... what's wrong with that? it's a simple feature
It's a new syntax, that looks declarative (but it's really runtime magic), and breaks hoisting
21:17
<ljharb>
ok but in that case everything else is backwards
21:17
<snek>
like instead of @app.route('/') function index(){} it would be const index = app.route('/', function (){})
you can add more decorators. @app.route('/') @authorized @originCheck @rateLimit(...) function index() {}
21:18
<Michael Ficarra>
not really, you already need to read inside-out which is usually right-to-left
21:18
<littledan>
I have to admit: although I really like the no-hoisting semantics, when we reviewed this proposal internally, there was a significant contingent of "this is bad" [and IMO not being OK with no-hoisting puts this in a very difficult space]
21:18
<ljharb>
a().b().c().d?
21:18
<Justin Ridgewell>
I think this proposal is a "make it pretty" without adding real new functionality
21:19
<bakkot>
you can add more decorators. @app.route('/') @authorized @originCheck @rateLimit(...) function index() {}
you can call multiple functions too
21:19
<snek>
yes its not making it possible to add authorization your routes
21:19
<Justin Ridgewell>
And it makes me think of Java's BS, I hate the annotations on annotations on annotations that I have to do get pass Google's corp style
21:19
<littledan>
my feedback to parameter decorators previously was "we should maybe do function decorators first". If we reject this, we should go back and consider parameter decorators IMO.
21:19
<snek>
its just taking a very popular pattern from other languages
21:19
<bakkot>
my feedback to parameter decorators previously was "we should maybe do function decorators first". If we reject this, we should go back and consider parameter decorators IMO.
I feel very strongly that we should not do parameter decorators regardless of the outcome of this discussion
21:19
<littledan>
well, OK
21:20
<littledan>
I have trouble understanding this negativity
21:20
<snek>
i would really like to have function decorators. i don't care about any other decorators
21:20
<bakkot>
its just taking a very popular pattern from other languages
"common" I will grant. "popular" I will not grant.
21:20
<littledan>
i would really like to have function decorators. i don't care about any other decorators
this is commonly held among JS programmers
21:21
<littledan>
the difference between decorators and metadata-only annotations is whether you want it to rely on some outside "runner" to read the metadata and take the appropriate actions. IMO supporting self-starting behavior is more JavaScripty.
21:21
<Michael Ficarra>
have JS programmers never seen HoFs?
21:21
<bakkot>
I have trouble understanding this negativity
the default is not adding new syntax, there needs to be a good, strong reason to add new syntax. and... there does not appear to be any such reason, here
21:21
<ljharb>
with either function or param decorators it'd make it much easier for me to have proper runtime argument validation that's palatable to lots of JS devs
21:21
<bakkot>
it's just a slightly different kind of function application with weird interaction with hoisting
21:21
<ljharb>
have JS programmers never seen HoFs?
lol i've been rejected from an interview in the past because i "used too many HoFs"
21:21
<littledan>
with either function or param decorators it'd make it much easier for me to have proper runtime argument validation that's palatable to lots of JS devs
Extractors are also a possibility here, but yes I agree.
21:21
<snek>
have JS programmers never seen HoFs?
i don't understand why you would want to write route(authorized(originCheck(rateLimited(5, 1, function index() {}))))
21:21
<Michael Ficarra>
well best to find out early that it's not a good place to work
21:22
<snek>
or combine(authorized, originCheck, rateLimited(5, 1), function index() {})
21:22
<shu>
why is that meaningfully worse than the @ version?
21:22
<Richard Gibson>
maybe you overran their stack
21:22
<ljharb>
lol fair, but also, i think that's an almost universal attitude among JS devs
21:22
<bakkot>
how is that... any different from the @ version
21:22
<ljharb>
functional programming is loved, Functional Programming is reviled
21:22
<rkirsling>
weird
21:22
<ljharb>
the left-to-right order and the lack of needing nesting parens (which other proposals can also solve)
21:23
<littledan>
decorators don't change the order vs function applications, but the nesting part is important
21:23
<bakkot>
ok so that is also the exact stated motivation for pipeline
21:23
<littledan>
pipeline is the wrong order for this kind of thing IMO
21:23
<nicolo-ribaudo>
const index =
(route
(authorized
(originCheck
(rateLimited(5, 1)
(function (...) {
  / body
})))))

just use ( for decorators instead of @ :)

21:23
<bakkot>
we can't have more than one new way of function calls to avoid nesting
21:23
<snek>
i think this is a common enough pattern that we shouldn't make people use weird ugly nesting/helpers/etc
21:23
<bakkot>
I don't think we even need one, but we definitely can't have more than one
21:23
<Michael Ficarra>
functional programming in the large, imperative programming in the small
21:23
<danielrosenwasser>
Call functions, not too many, mostly lower-order
21:23
<Michael Ficarra>
this is the only way
21:24
<littledan>
but, these are for very different-feeling things
21:24
<littledan>
you decorate declarations, and you put data through a pipeline
21:24
<danielrosenwasser>
Introducing the (a) operator
21:25
<bakkot>
you decorate declarations, and you put data through a pipeline
how are those... different things
21:25
<ljharb>
functions aren't thought of as data
21:25
<Michael Ficarra>
bakkot: I remind you that we have both yield and await for no good reason
21:25
<bakkot>
but... decorators are... transformations of functions...
21:25
<littledan>
how are those... different things
yeah, I dunno how to put it... maybe stop thinking so much?
21:26
<snek>
i do actually think of functions as data. BUT i do think its not productive to have a conversation where the premise "everyone must think in pure fp"
21:26
<bakkot>
I am not particularly a FP person
21:26
<shu>
pure fp is not my reading of bakkot's position
21:26
<littledan>
JavaScript is an FP language because functions are first-class data </sarcasm>
21:27
<ljharb>
non-sarcastically, i often say JS is functional programming, not Functional Programming
21:27
<shu>
these are literally function transformations, that's a fact of the proposal. ron admits that this is not new expressivity.
21:27
<shu>
the disagreement i see is the motivation is thus ergonomics, which comes down to feelings, which we disagree on
21:29
<snek>
the most realistic non-decorator usage i can imagine in the real world is something like app.route('/', {extensions: [rateLimit()]}, function index() {})
21:29
<snek>
but that requires your http framework to support it
21:29
<snek>
which is silly
21:30
<littledan>
this is why postfix languages are better
21:30
<nicolo-ribaudo>
Well your HTTP frameworks would need to support decorators
21:30
<snek>
why
21:30
<littledan>
it generalizes pipelining to multiple parameters!
21:30
<nicolo-ribaudo>
To know what @app.route("/") means
21:30
<snek>
app.route just calls f with (req, res)
21:30
<nicolo-ribaudo>
Oh I see
21:30
<ljharb>
certainly such a decorator would need to support the framework
21:31
<ethanarrowood>
There is an example of this "in the wild" : https://www.npmjs.com/package/fastify-decorators
21:31
<littledan>
well, this is part of the beauty of decorators work, where they have a "main thing" which is the first argument to the decorator
21:32
<littledan>
and the return value is interpreted as, what the main thing is replaced with
21:32
<littledan>
so a lot of things "just work"
21:36
<jschoi>
Can someone let me back in the Zoom meeting?
21:36
<ryzokuken>
done
21:36
<jschoi>
Thank you!
21:37
<ryzokuken>
Thank you!
of course, apologies for not keeping an eye, the pop up on zoom is tiny
21:37
<littledan>
It's hard for me to understand the strength of this opposition. Shouldn't we have skipped class decorators with these arguments? this is really the same thing as those.
21:38
<bakkot>
we should probably have not included class decorators, yes; at one point they had additional expressivity and so I was ok with that on those grounds
21:38
<bakkot>
we ought to have revisted them when that stopped being true
21:39
<littledan>
yeah, they have been not more expressive for the whole time we were reviewing the current version of the proposal, which was more than a year IIRC before Stage 3.
21:40
<jschoi>
i don't understand why you would want to write route(authorized(originCheck(rateLimited(5, 1, function index() {}))))
function index() {} |> rateLimited(5, 1, ^^) |> originCheck(^^) |> authorized(^^) |> route(^^) 🥹
21:40
<bakkot>
the discussion of decorators was much longer than a year
21:41
<snek>
function index() {} |> rateLimited(5, 1, ^^) |> originCheck(^^) |> authorized(^^) |> route(^^) 🥹
yikes
21:41
<jschoi>
It looks better on multiple lines, I swear.
21:43
<nicolo-ribaudo>

Reverse pipes:

const index = route(^^) <| authorized(^^) <| originCheck(^^) <| rateLimited(5, 1, ^^) <| function() {}
21:43
<shu>
It's hard for me to understand the strength of this opposition. Shouldn't we have skipped class decorators with these arguments? this is really the same thing as those.
actually yes
21:44
<littledan>
pipelining is backwards for this use case; you want the decorator at the beginning
21:47
<snek>
i don't know how to argue against the idea that new behavior should be rejected based on how mechanically similar it is to other things. that just leave you with lisp
21:47
<shu>
i don't think that's the argument
21:47
<nicolo-ribaudo>
I actually like this seriously
21:47
<shu>
the argument is, absent new expressivity, the remaining argument here is whether you think this is good for ergonomics
21:48
<shu>
and if there is disagreement, how do you resolve that if it's a disagreement in taste?
21:48
<hax (HE Shi-Jun)>
If there is no function decorator, people will just use decorator on static method to workaround 🙄
21:48
<shu>
is that something you're seeing in practice? could i see an example
21:48
<Michael Ficarra>
by "that leaves you with lisp" I think you mean that leaves you with a small number of language features that are incredibly generically applicable instead of tons of special-purpose stuff, which seems like a good design direction
21:48
<ljharb>
i suppose something like @a @b @c @extract class { [extract]() {…} } would work
21:49
<Michael Ficarra>
then let them
21:49
<Michael Ficarra>
that doesn't bother me
21:49
<shu>
and people would do that because they don't want to type c(b(a(() => {}))) ?
21:49
<Michael Ficarra>
this is entirely about ergonomics, and if they think that's ergonomic, good for them
21:50
<ljharb>
i mean i don't think i'd do that. but the readability benefit to me is indeed abc vs cba (the parens too but that's trivial)
21:50
<hax (HE Shi-Jun)>
and people would do that because they don't want to type c(b(a(() => {}))) ?
It's very different. syntax matters.
21:51
<shu>
i've heard this assertion a few times, both here and in other arguments. how do i actually get a better handle on the size of the dev population that feels this way?
21:51
<littledan>
and people would do that because they don't want to type c(b(a(() => {}))) ?
Yes. [nit: we're talking about a(b(c(...)))]
21:51
<snek>
here's some code of mystery origin, i'm really curious how people would recommend writing this in javascript today. https://gist.github.com/devsnek/8785765310d10f1d36d380e8f3e55a50
21:51
<shu>
oh the application order ist he same?
21:51
<littledan>
i've heard this assertion a few times, both here and in other arguments. how do i actually get a better handle on the size of the dev population that feels this way?
yes this is the kind of thing we should be working on
21:51
<Anthony Bullard>
I feel the exact opposite here, for what it’s worth
21:51
<ljharb>
that's my understanding at least. decorators run inner-to-outer
21:52
<Anthony Bullard>
Annotations feel like magic, and obfuscating. But I realize others don’t feel that way
21:52
<shu>
if the order is the same then what's the understandability issue with a(b(c(...))) ?
21:52
<ljharb>
if the order is the same then what's the understandability issue with a(b(c(...))) ?
i would expect to get that order with @c @b @a …
21:52
<jschoi>

what's the understandability issue with a(b(c(...)))

The indentation pyramid of doom, probably.

21:52
<ljharb>
decorators aren't only annotations tho. i don't personally find annotations valuable or helpful
21:53
<littledan>
Can class element decorators affect placement? I thought they couldn't.
21:53
<littledan>
that was the whole "static shape" thing
21:53
<nicolo-ribaudo>
No they cannot
21:53
<shu>
there's just accessor
21:53
<Michael Ficarra>
I actually like https://matrix.to/#/!WgJwmjBNZEXhJnXHXw:matrix.org/$L6qy_Funltwcu-I87xDP2Ptgqx7t-XHFrlBUDyGve_M?via=matrix.org&via=mozilla.org&via=igalia.com
21:53
<Anthony Bullard>
Sorry, I use those terms interchangeably, which is not helpful
21:53
<nicolo-ribaudo>
bakkot: class method decorators are exactly as much powerful as function decorators would be
21:53
<nicolo-ribaudo>
Everything else has been removed
21:53
<danielrosenwasser>
there's addInitializer though
21:54
<Anthony Bullard>
I’ve just never felt excited about any use of decorators
21:54
<bakkot>
sorry, not "affect", but "be given information about"
21:54
<Anthony Bullard>
I’ve developed in many languages, and have suffered more where they are common (Java, Scala)
21:54
<shu>
good point, initializers seems bad to me for function declarations
21:55
<ljharb>
certainly i'm not a fan of the idioms in java :-)
21:55
<littledan>
initializers for methods/functions just run once; it ends up being a pretty common need when writing decorators (we used to call them "finishers" in the original decorators proposal)
21:55
<Anthony Bullard>
And I guess I’m worried that at some point, we’ll have so much syntax in the language such that a snippet may be confused with any c-derived language
21:56
<ljharb>
tbf that's already the case for lots of snippets
21:56
<snek>
how would you write this code in javascript? https://gist.github.com/devsnek/8785765310d10f1d36d380e8f3e55a50
21:56
<Anthony Bullard>
And so much cognitive overhead for new developers
21:56
<Ashley Claymore>
Java decorators are more magic because they only attach metadata that another system then searches the class loader for. So more spooky action at a distance. Can't step through with a debugger 
21:56
<Ashley Claymore>
I like that JS decorators are programmatic, can step through what they are doing 
21:56
<Anthony Bullard>
Maybe I’ve been red pilled by writing a lot of Go, but sometimes you should NOT pave EVERY cow path
21:57
<Anthony Bullard>
I like that JS decorators are programmatic, can step through what they are doing 
That is an improvement
21:57
<Michael Ficarra>
exactly how you think I would
21:57
<littledan>
Maybe I’ve been red pilled by writing a lot of Go, but sometimes you should pave EVERY cow path
Do you mean to say shouldn't?
21:57
<shu>

in case we don't get to the Angular queue item, here's what i've been told in discussing with angular people internally

  • some folks in angular at least consider the current state with its parameter decorator use to be rife with footguns (e.g., param decorators would cause parameter names to be retained at runtime)
  • @inject decorators actively on way out
  • angular has no plans AFAIK to ever move to standard decorators
21:57
<Anthony Bullard>
Do you mean to say shouldn't?
Edited 😉
21:58
<nicolo-ribaudo>

(e.g., param decorators would cause parameter names to be retained at runtime)

21:58
<ljharb>
parameter names should be retained at runtime anyways for debugging, minifiers that remove them are annoying
21:58
<nicolo-ribaudo>
I would hope we would use indexes instead of names if we do param decorators
21:58
<shu>
so angular shouldn't be cited as a customer for this work, it won't be. not saying there aren't others, but angular isn't one
21:59
<snek>

like this?

pipeline(
    blueprint.routes(
        'POST',
        '/interactions/<interaction_id>/<interaction_token>/callback', {
            auth: AuthOptions(required = False),
            visibility: ApiVisibility.PUBLIC,
            name: 'create_interaction_response',
        }
    ),
    blueprint.rate_unlimited(),
    logout_required(),
    validate_body(INTERACTION_CALLBACK_REQUEST_TYPE, {
        defer_validation: True
    }),
    validate_kwargs({
        'interaction_id': skema.SnowflakeType(),
        'interaction_token': skema.StringType({
            max_length: skema.UNSPECIFIED_MAX_LENGTH_PLEASE_FIX
        }),
    }),
    non_discord_origin_check,
    validate_response({
        NO_CONTENT: skema.response.EmptyResponse
    }),
    function interaction_callback(interaction_id, interaction_token, validator) {})
21:59
<Michael Ficarra>
use a source map my dude
21:59
<ljharb>
true, that helps :-)
22:00
<Michael Ficarra>
yes, or with just function application using 😱 parentheses
22:00
<snek>
like if you were laying out an application
22:00
<snek>
and you wanted to combine these functionalities
22:00
<snek>
you would choose function application
22:01
<Anthony Bullard>
What other JS library makes use of decorators? Stencil is the only one I can think of
22:01
<Michael Ficarra>
yes, I think code that uses functions is readable
22:01
<bakkot>
I am confused by the notion of function application being this weird thing
22:01
<bakkot>
function application is like... most code
22:01
<bakkot>
it is a very normal thing to do
22:01
<snek>
i feel like we have very different definitions of "most code"
22:02
<Anthony Bullard>
I don’t think even a company like Google , who are fans of decorators, have a JS library that uses them
22:02
<Anthony Bullard>
At least I don’t remember them in Whiz
22:02
<Chris de Almeida>
ember
22:02
<littledan>
What other JS library makes use of decorators? Stencil is the only one I can think of
Decorators were developed by a bunch of frameworks working together, with Angular mostly not participating in that group
22:02
<bakkot>
the code you linked has an average of almost one function application per line, in addition to the decorator application
22:02
<littledan>
lit-element, MobX, Aurelia, ....
22:03
<Anthony Bullard>
I forgot about Lit
22:03
<snek>
sorry i meant, nested
22:03
<jschoi>
lit-element, MobX, Aurelia, ....
(I actually do use Lit and look forward to using decorators to register my custom elements.)
22:03
<hax (HE Shi-Jun)>
i've heard this assertion a few times, both here and in other arguments. how do i actually get a better handle on the size of the dev population that feels this way?
Are you asking if "syntax matters" or whether "function decorators" are needed? Regarding the latter, I have encountered some inquiries from colleagues and other developers as to why there are class decorators but no function decorators.
22:04
<Anthony Bullard>
We have a web component framework, and have never had isssues with people calling the register function…
22:04
<shu>
Anthony Bullard: sorry who's "we"?
22:04
<littledan>
+1 to Luca's and Ron's consistency argument
22:04
<nicolo-ribaudo>
The current trascriptioner injects newlines everywhere and worse, they capitalize every word at the beginning of the line
22:04
<snek>

like this is not readable code

blueprint.routes(
'POST',
'/interactions/<interaction_id>/<interaction_token>/callback', {
    auth: AuthOptions(required = False),
    visibility: ApiVisibility.PUBLIC,
    name: 'create_interaction_response',
}
blueprint.rate_unlimited(logout_required(), validate_body(INTERACTION_CALLBACK_REQUEST_TYPE, {
    defer_validation: True
}) validate_kwargs({
    'interaction_id': skema.SnowflakeType(),
    'interaction_token': skema.StringType({
        max_length: skema.UNSPECIFIED_MAX_LENGTH_PLEASE_FIX
    }),
}, non_discord_origin_check(validate_response({
    NO_CONTENT: skema.response.EmptyResponse
}, function interaction_callback(interaction_id, interaction_token, validator) {})), ))), )
22:04
<snek>
i'm actually not sure i even nested that correctly
22:04
<Anthony Bullard>
shu: ServiceNow
22:04
<ljharb>
decorating object literals is particularly nice because you can define enumerability/writability/configurability inline in a way you can't rn
22:04
<snek>
cuz how do you even read it
22:05
<shu>
Are you asking if "syntax matters" or whether "function decorators" are needed? Regarding the latter, I have encountered some inquiries from colleagues and other developers as to why there are class decorators but no function decorators.
the latter
22:05
<Anthony Bullard>
decorating object literals is particularly nice because you can define enumerability/writability/configurability inline in a way you can't rn
That sounds like a different problem that we could solve with no net new concepts or syntax
22:05
<littledan>
decorating object literals is particularly nice because you can define enumerability/writability/configurability inline in a way you can't rn
the obvious way to define these would unfortunately not expose that capability, which would presumably violate the "static shape" goal. We removed this capability from class decorators, didn't we?
22:05
<Michael Ficarra>
would you be happy to use pipeline to linearise it?
22:05
<ljharb>
i mean tbf i don't find the original code you posted readable either
22:05
<shu>
all i've heard are anecdotes like yours ("i know some people who want it") or assertions ("developers want this"). i'm saying that is not enough signal for me to make a judgment
22:06
<rkirsling>
right, it's [citation needed] content
22:06
<snek>
i would not write this code in js today
22:06
<ljharb>
That sounds like a different problem that we could solve with no net new concepts or syntax
i'm not sure how; engines would insist on syntax so they could statically know the shape of the object
22:06
<snek>
that's why its in python
22:06
<jschoi>
Stage-1 exploration can and should solicit better usage/demand data than anecdotes.
22:06
<snek>
like i think you simply cannot structure large applications
22:07
<Anthony Bullard>
@ljharb I’d be interested in seeing a minimal example of this to understand the problem
22:08
<littledan>
i'm not sure how; engines would insist on syntax so they could statically know the shape of the object
I don't see how decorators would provide a solution to this either
22:08
<bakkot>
empirically you can structure large applications in javascript
22:08
<ljharb>
I don't see how decorators would provide a solution to this either
yeah they may not, i hadn't throught that through
22:09
<Rob Palmer>
The current trascriptioner injects newlines everywhere and worse, they capitalize every word at the beginning of the line
We passed this feedback to the transcription service yesterday. I will relay it again. Can you say which time period it applies to? (They swap people around)
22:09
<nicolo-ribaudo>
We passed this feedback to the transcription service yesterday. I will relay it again. Can you say which time period it applies to? (They swap people around)
Since 15 minutes ago
22:09
<Rob Palmer>
From 13:55
22:09
<ljharb>
also, double spacing after periods :-( (as long as you're giving feedback)
22:10
<nicolo-ribaudo>
I think the autocapitalization is done by google docs though, so the only problem is the newlines
22:10
<snek>
well for some definition of structure. my meaning is that they are all enormous messes or they rely on typescript decorators
22:10
<Anthony Bullard>
ljharb: that was correct when I was in High Scool
22:10
<Rob Palmer>
I mean that's just good manners ;-)
22:10
<Rob Palmer>
(but yes, in our patterns single space is consistent)
22:10
<ljharb>
it's correct for typewriters or non-proportional-width fonts. since the invention of the computer, it's no longer correct, but teacher dogma makes it persist.
22:11
<ljharb>
it also makes readability worse, based on a few studies
22:11
<Anthony Bullard>
I think the autocapitalization is done by google docs though, so the only problem is the newlines
I’m probably alone in this, but do we really need Google Docs, wouldn’t a plain text format be more accessible and machine process able?
22:11
<ljharb>
we need the realtime collaboration google docs provides, and hackmd can't handle that many people at once iirc
22:11
<Anthony Bullard>
Yeah it took me 10-15 years to stop
22:12
<jschoi>
I’m probably alone in this, but do we really need Google Docs, wouldn’t a plain text format be more accessible and machine process able?
Don't the Google Docs use Markdown anyway? The rich formatting seems to be for convenience.
22:12
<ljharb>
when using a typewriter, certainly :-p
22:12
<bakkot>
also really want headings
22:12
<ljharb>
if we can configure gdocs to be in markdown instead, like hackmd, that'd be amazing (or find an alternative that scales as well)
22:13
<Anthony Bullard>
bakkot: # There you go
22:13
<Anthony Bullard>
I can research
22:13
<nicolo-ribaudo>
Time to build our own
22:13
<nicolo-ribaudo>
TCNotes
22:13
<Anthony Bullard>
Or maybe even build something
22:13
<rkirsling>
I think it's hilarious that Discord added markdown headings; basically just allows you to shout stuff
22:13
<ljharb>
(fwiw the "decorators before export" decision explicitly acknowledged that export decorators could never happen, is what i recall - and import decorators imo don't make sense because of eval order)
22:14
<nicolo-ribaudo>
(fwiw the "decorators before export" decision explicitly acknowledged that export decorators could never happen, is what i recall)
I thought decorators are after export now
22:14
<Anthony Bullard>
nicolo-ribaudo: I’m on it
22:14
<snek>
I think it's hilarious that Discord added markdown headings; basically just allows you to shout stuff
we were ordered to by the CTO
22:14
<ljharb>
I thought decorators are after export now
they were gonna be, but then TS pushed and now both forms are allowed
22:14
<bakkot>
(but not on the same class)
22:14
<nicolo-ribaudo>
Oh right
22:14
<nicolo-ribaudo>
It feels like that was years ago
22:14
<Anthony Bullard>
we were ordered to by the CTO
It seems every chat client does that now, just support inline markdown and tables!
22:14
<ljharb>
also i think it omits them from toString if they're before the export?
22:15
<snek>
It seems every chat client does that now, just support inline markdown and tables!
tables don't work well on mobile
22:15
<snek>
sorry this is offtopic a bit heh
22:15
<Anthony Bullard>
tables don't work well on mobile
Mattermost does it pretty well, wraps it in a scroll container
22:16
<Anthony Bullard>
Anyway, I can research a better transcription solution for minutes
22:16
<Anthony Bullard>
And present my findings
22:16
<shu>
but why
22:16
<shu>
what is the problem with docs?
22:16
<jschoi>
Whoa, do/did you work at Discord?
22:17
<snek>
ye
22:17
<Anthony Bullard>
Its opinionated on style in unhelpful ways for quickly entered text
22:17
<snek>
current employer
22:17
<jschoi>
Nice.
22:17
<Anthony Bullard>
I have transcribed a lot and it’s very frustrating
22:18
<nicolo-ribaudo>
At this point I've given out on formatting and I'm just fixing typos
22:18
<shu>
part of it was the transcriptionists' software and part of it was docs, i had thought the capitalization was fixed
22:18
<nicolo-ribaudo>
part of it was the transcriptionists' software and part of it was docs, i had thought the capitalization was fixed
It seems like they do newline, word, space, and it gets capitalized
22:18
<Anthony Bullard>
If minutes were done solely by a third party, I’d say let them figure it out
22:19
<nicolo-ribaudo>
And it seems to be google docs (it also happens if I try doing it), not their software
22:19
<Anthony Bullard>
But delegates are, and it’s painful and prevents them from even absorbing the conversation
22:19
<Anthony Bullard>
Maybe shu can put in a CL to fix it 😂
22:20
<shu>
heh i do not work in that part of google
22:20
<nicolo-ribaudo>
heh i do not work in that part of google
Can you add if url === google.docs { do something } in V8 directly
22:20
<shu>
i believe i will be fired
22:21
<snek>
better to die a hero
22:21
<shu>
haha no
22:21
<shu>
that's a stupid thing to say
22:21
<Anthony Bullard>
No one wants that. If another open source option exists and works, I think evaluating it makes sense
22:21
<shu>
it's better to not die
22:21
<ljharb>
indeed, it's nicer to live on that hill
22:21
<Anthony Bullard>
But I’m new around here, so I won’t die on that hill
22:21
<snek>
on the bones of those who died on the hill
22:22
<Michael Ficarra>
we used to use etherpad
22:22
<ljharb>
RIP
22:23
<nicolo-ribaudo>
I'm very struggling to focus and my notes-fixing quality is getting close to zero btw
22:23
<nicolo-ribaudo>
Help appreciated
22:23
<nicolo-ribaudo>
At least for the interactive discussion
22:24
<nicolo-ribaudo>
(there is already a second person working on it, but I'm doing very little)
22:25
<bakkot>
the newlines from the current transcriptionist are really going to be annoying to fix in post
22:25
<hax (HE Shi-Jun)>
all i've heard are anecdotes like yours ("i know some people who want it") or assertions ("developers want this"). i'm saying that is not enough signal for me to make a judgment
I understand that it should be approached with caution. However, given the size and diversity of the community, in reality, no one can assert how many of the 20 million JS developers worldwide want a specific feature. Even if there are some surveys, we can't even be sure if what developers understand aligns with what the committee might actually do. This is indeed a difficult problem, and I don't know how to solve it; I hope someone on the committee does.
22:25
<nicolo-ribaudo>
the newlines from the current transcriptionist are really going to be annoying to fix in post
I can make sure to ad double newlines when we would want one
22:25
<nicolo-ribaudo>
So than we can try regexping it away
22:26
<bakkot>
it's mostly the capitalization I'm worried about
22:26
<bakkot>
I guess if they consistently add end-of-sentence punctuation we can regexp that away too
22:26
<shu>
I understand that it should be approached with caution. However, given the size and diversity of the community, in reality, no one can assert how many of the 20 million JS developers worldwide want a specific feature. Even if there are some surveys, we can't even be sure if what developers understand aligns with what the committee might actually do. This is indeed a difficult problem, and I don't know how to solve it; I hope someone on the committee does.
right, no one can assert. surveys is maybe the best we have
22:27
<jschoi>
Case studies from real codebases are useful too.
22:27
jschoi
glances at gzemnid
22:27
<nicolo-ribaudo>
Also Anonymous Cheetah, can you move your cursor to not overlap with the transcriptionist otherwise I cannot read the previous line
22:27
<Richard Gibson>
we should charter a TG to explore this
22:28
<Anthony Bullard>
hax (HE Shi-Jun): being new , I’ve always wondered what our principle is in adding a feature or syntax. Is it just corpus analysis/paving the most heavily trafficked cow paths? Or is there another set of principles that guides the language design. If there is, I’ve never seen it.
22:29
<ljharb>
there isn't really one, everybody brings their own
22:30
<shu>
there is no agreed-upon set of principles, that's why things get heated
22:30
<Anthony Bullard>
ljharb: interesting. I think that could be good, but also very bad. It’s good context to hear from you vets
22:31
<ljharb>
indeed it's both at the same time, which is probably why we haven't been able to come up with a better system :-)
22:31
<bakkot>
it's just taste, in every language
22:31
<shu>
yeah pretty much
22:31
<shu>
that said there are some north star principles that often trump others
22:31
<snek>
lately i've been trying to approach this in a "don't yuck someone's yum" sort of way
22:31
<bakkot>
oh boy
22:32
<bakkot>
I do not think that is a good path to a good language
22:32
<snek>
the language is already not good
22:32
<Anthony Bullard>
bakkot: I think languages where the creator is involved in the language design process have at least some principle
22:32
<bakkot>
the language is already not good
ok but like... we could avoid making it worse.
22:32
<bakkot>
everyone has to read other people's code
22:32
<ljharb>
yucking someone's yum is a big part of the primary job of any software or standard maintainer imo - in the "no is temporary, yes is permanent" mindset
22:32
<nicolo-ribaudo>
It's worse
22:32
<nicolo-ribaudo>
Now newlines are every 40 chars or so
22:32
<nicolo-ribaudo>
But at least there is no auto capitaliztion
22:33
<nicolo-ribaudo>
Let's keep it like this actually
22:33
<hax (HE Shi-Jun)>
right, no one can assert. surveys is maybe the best we have
As I mentioned, surveys can't ensure a consistent understanding either. My personal approach is to understand why people need it. In the case of function decorators, my impression is that as soon as developers have used class/method decorators, they almost inevitably end up asking why there aren't function decorators (currently, I tell them it's because hoisting is an unresolved issue).
22:33
<Anthony Bullard>
bakkot: this. I’m really worried about where we could go. ES today is basically the Raku to the JS of 9 years ago’s Perl 4
22:33
<jschoi>
Oh man, a Perl 6 reference.
22:34
<shu>
As I mentioned, surveys can't ensure a consistent understanding either. My personal approach is to understand why people need it. In the case of function decorators, my impression is that as soon as developers have used class/method decorators, they almost inevitably end up asking why there aren't function decorators (currently, I tell them it's because hoisting is an unresolved issue).
"best-attempt solutions are imperfect" is not an argument for "anecdotes and assertions are sufficient"
22:34
<jschoi>
I’m being transported back to childhood.
22:34
<jschoi>
Synopses, Apocalypses, Exegeses. Parrot.
22:34
<snek>
javascript is so tiny right now, i just cannot bring myself to worry about it having too much stuff
22:34
<shu>
bakkot: this. I’m really worried about where we could go. ES today is basically the Raku to the JS of 9 years ago’s Perl 4
say more?
22:35
<bakkot>
javascript is so tiny right now, i just cannot bring myself to worry about it having too much stuff
javascript has quite a lot of syntax
22:35
<bakkot>
tiny stdlib
22:35
<bakkot>
lot of syntax
22:35
<rkirsling>
yeah, I'm not sure in what world JS is syntactically tiny
22:35
<bakkot>
and more all the time
22:35
<Anthony Bullard>
We live in a world where 70% of active websites are written in IE6 compliant JQuery or similar, but where most modern software is written in a wildly different ESNext
22:35
<hax (HE Shi-Jun)>
hax (HE Shi-Jun): being new , I’ve always wondered what our principle is in adding a feature or syntax. Is it just corpus analysis/paving the most heavily trafficked cow paths? Or is there another set of principles that guides the language design. If there is, I’ve never seen it.
I also have same feeling from beginning. I have to say, it's very shocked that Dan said TC39 do not have roadmap in one meeting I attended.
22:36
<Anthony Bullard>
It’s tough, but I can definitely understand a Go program written 2009, and might write that same code today
22:36
<Chris de Almeida>
We live in a world where 70% of active websites are written in IE6 compliant JQuery or similar, but where most modern software is written in a wildly different ESNext
sir, please. this is my emotional support jQuery
22:36
<Chris de Almeida>
whoops, this isn't tdz
22:37
<Anthony Bullard>
And I’m one who wishes selfishly for records, tuples , and pattern matching
22:37
<Jan Olaf Martin>
OT: How do I get into TDZ?
22:37
<Chris de Almeida>
#temporaldeadzone:matrix.org
22:37
<snek>
i think the current language has an average amount of syntax
22:37
<snek>
there's definitely a lot of syntax proposals rn
22:37
<ryzokuken>
I find it useful to think about JS as an accidentally general purpose programming language designed to be the primary scripting language for the web; as the web platform evolves, so should we.
22:38
<Anthony Bullard>
I wish we could spend more time on stdlib stuff than syntax is what I’m trying to say 😂
22:38
<ljharb>
+1 for 3, hoisting is bad anyways and it conceptually can't work for decorators ¯\_(ツ)_/¯
22:38
<shu>
It’s tough, but I can definitely understand a Go program written 2009, and might write that same code today
ah so the worry is "it's changing too fast"?
22:39
<Anthony Bullard>
shu: that a developer in his career is likely to encounter both, in their job and in their learning
22:39
<Chris de Almeida>
yet they have not joined Ecma. curious. /s
22:39
<shu>
"both" meaning modern JS and pre-modern JS?
22:39
<Anthony Bullard>
And much of the ecosystem has the same problem
22:40
<jschoi>
I also have same feeling from beginning. I have to say, it's very shocked that Dan said TC39 do not have roadmap in one meeting I attended.
TC39 is a politico-technical miracle, the miracle being cooperation between a bunch of mutually competing organizations and stakeholders, each with their own vision, without a strong center of power like a BDFL. The one roadmap, as far as I know, is to Not Break the Web and to improve interoperability between existing implementations.
I wonder if we could come to a consensus on overall vision for future language features. I suspect that it’s not possible.
22:40
<Anthony Bullard>
shu: yes
22:40
<Anthony Bullard>
jschoi: it’s be exciting to try
22:40
<ryzokuken>
TC39 is a politico-technical miracle, the miracle being cooperation between a bunch of mutually competing organizations and stakeholders, each with their own vision, without a strong center of power like a BDFL. The one roadmap, as far as I know, is to Not Break the Web and to improve interoperability between existing implementations.
I wonder if we could come to a consensus on overall vision for future language features. I suspect that it’s not possible.
not only that, I don't believe it's necessary! development via game theory 🔥
22:41
<Anthony Bullard>
I think if we had a stronger stdlib that helped solve web scripting problems, we’d have a different ecosystem
22:41
<rkirsling>
something something prisoner's dilemma
22:41
<shu>
Anthony Bullard: does the 100% back compat not help understanding in practice?
22:41
<Michael Ficarra>
we've presented vision talks in the past, and Mark was suggesting yesterday that we start that process again
22:41
<shu>
like, are the feature sets that are used disjoint?
22:41
<ryzokuken>
something something prisoner's dilemma
perhaps, or perhaps the lack of authority and a singular vision allows us to be more dynamic and adaptable than most others
22:42
<snek>
lets just take a small gamble. give me six months of total control over ecmascript, we'll see how it goes. if its bad, we can just revert it :^)
22:42
<Anthony Bullard>
shu: no because the patterns change. I have coworkers who don’t recognize var, or using the function keyword
22:42
<ljharb>
i mean on some level that's an education problem
22:42
<shu>
shu: no because the patterns change. I have coworkers who don’t recognize var, or using the function keyword
where do you think the division of responsibilities ought to be between education (in the broad sense) and the language?
22:43
<ljharb>
otherwise that logic would mean we can never provide a replacement/improved pattern for anything
22:43
<shu>
ah jordan asked my question
22:43
<Anthony Bullard>
Or understand prototypal inheritance, because we hid it behind classes which don’t really exist
22:43
<ljharb>
you did it more eloquently :-)
22:43
<snek>
i think the language is 100% responsible for education and javascript is super hard failing
22:43
<ljharb>
Or understand prototypal inheritance, because we hid it behind classes which don’t really exist
i mean part of that is resolved by much of the ecosystem preferring to avoid inheritance entirely.
22:43
<snek>
but i also recognize why this is the case
22:43
<shu>
what does it mean for a language to be responsible for education?
22:44
<shu>
like, this committee?
22:44
<snek>
look at rust
22:44
<shu>
rust is a singular software project
22:44
<shu>
we are disparate software projects that come together for interop
22:44
<snek>
yeah, i realize its hard to translate to this.
22:44
<Anthony Bullard>
shu: I think education has definitely failed here. No doubt.
22:44
<snek>
but that doesn't change the final outcome, which is that learning js kinda sucks
22:44
<ryzokuken>
actually in TG2 we have MDN docs as a hard Stage 3 requirement, that's pretty easy to implement across committee IMO
22:44
<Michael Ficarra>
snek: you mean because they have a book? we have books
22:44
<ryzokuken>
it's not much but it's a start
22:44
<Rob Palmer>
I am preparing a guide for our transcriptionist. Please edit this doc as you see fit so we can convey our desired standards. Then we will send it to the transcription service.
22:45
<snek>
snek: you mean because they have a book? we have books
some of them probably don't mention var
22:45
<Michael Ficarra>
some of them definitely do though
22:45
<Michael Ficarra>
so read 2 books?
22:46
<snek>
🤷
22:46
<snek>
its impossible to say
22:46
<littledan>
Excellent summary/conclusion
22:46
<Anthony Bullard>
Sorry everyone, I didn’t mean to start an existential discussion. Just trying to kind of understand our mandate and our process
22:46
<hax (HE Shi-Jun)>
"best-attempt solutions are imperfect" is not an argument for "anecdotes and assertions are sufficient"
It's certainly good to have a survey. For me, communicating with others is like conducting a survey, albeit with a limited sample size. If possible, I try to understand the sources of their thoughts. At least to me, they are not merely "anecdotes."
22:47
<snek>
asking questions is good!
22:48
<jschoi>
look at rust
I’m imagining a world with:
• The JavaScript Programming Language, a book by TC39
• The JavaScriptonomicon: The Dark Arts of Unsafe JavaScript, a book by TC39
• JavaScript by Example, a book by TC39
• JavaScriptlings, a course for beginners by TC39
22:48
<Anthony Bullard>
snek: too bad I couldn’t be in SD to have this convo in person
22:48
<shu>
Sorry everyone, I didn’t mean to start an existential discussion. Just trying to kind of understand our mandate and our process
i interpret the mandate to bottom out at "ensuring interop across JS platforms, mostly web browsers"
22:48
<nicolo-ribaudo>
I’m imagining a world with:
• The JavaScript Programming Language, a book by TC39
• The JavaScriptonomicon: The Dark Arts of Unsafe JavaScript, a book by TC39
• JavaScript by Example, a book by TC39
• JavaScriptlings, a course for beginners by TC39
Well "JavaScript the good parts" is a terrible book but it was written by a delegate
22:48
<Anthony Bullard>
jschoi: I see what you did there
22:48
<shu>
over the years it has evolved to "stewardship of JS", but i don't think that's actually the core mandate
22:49
<Anthony Bullard>
nicolo-ribaudo: that was my favorite JS book for at least 5 years. And how I learned JS to do actual programming
22:50
<jschoi>
Continued and stronger collaboration between TC39 and MDN is indeed high-impact and low-hanging fruit. Probably the biggest method of general community documentation and outreach.
22:50
<ryzokuken>
a rather controversial figure in committee actually wrote a whole set of books that went quite deep into the language and released them on the internet
22:50
<ryzokuken>
they were quite helpful when I first started learning JS
22:50
<littledan>
over the years it has evolved to "stewardship of JS", but i don't think that's actually the core mandate
Who decides what the core mandate actually is?
22:51
<Anthony Bullard>
Link?
22:51
<ryzokuken>
it helped that I didn't actually know JS
22:51
<nicolo-ribaudo>
a rather controversial figure in committee actually wrote a whole set of books that went quite deep into the language and released them on the internet
You don't know js?
22:51
<ryzokuken>
You don't know js?
I probably don't, still, yeah 😛
22:51
<Anthony Bullard>
littledan: I thought you did 😉
22:51
<littledan>

our official scope says,

Standardization of the general purpose, cross platform, vendor-neutral programming language ECMAScript® (JavaScriptTM). This includes the language syntax, semantics, and libraries and complementary technologies that support the language.

22:51
<shu>
Who decides what the core mandate actually is?
the equilibrium of participants' reasons i guess?
22:51
<Michael Ficarra>
surely we have a nominal mandate in the TC charter
22:52
<ryzokuken>
Continued and stronger collaboration between TC39 and MDN is indeed high-impact and low-hanging fruit. Probably the biggest method of general community documentation and outreach.
100%. We already have systems in place and people who are motivated towards this on both sides.
22:52
<ryzokuken>
I wonder what it'll take for the committee to make an official effort in this direction
22:52
<ryzokuken>
lol @ ljharb
22:52
<shu>
yeah i'm pretty sure what it'll take is always money
22:52
<Michael Ficarra>
🙅
22:52
<nicolo-ribaudo>
I wonder what it'll take for the committee to make an official effort in this direction
It starts with somebody putting it on the agenda
22:53
<ljharb>
lol @ ljharb
100% serious
22:53
<ryzokuken>
dunno, maybe if we all collectively decided to make it part of the staging process it could just change the dynamic
22:53
<nicolo-ribaudo>
Let MF be your hero and be the process change you want to be
22:53
<Michael Ficarra>
please, read Dave Herman's book instead
22:53
<ljharb>
if the staging process can make payments, then sure, that'd work
22:53
<ryzokuken>
Let MF be your hero and be the process change you want to be
why are you singling out Michael Ficarra /s
22:53
<Anthony Bullard>
ljharb: so now we require payment to advance stages?
22:53
<ljharb>
the staging process requires tests to be written first and almost the only people who write or review tests are the ones paid to do so
22:54
<nicolo-ribaudo>
why are you singling out Michael Ficarra /s
Well he just put a lot of effort in a process change! :)
22:54
<ryzokuken>
but jokes apart, yes, I guess I could make a quick short spiel at the Helsinki meeting about it
22:54
<ljharb>
ljharb: so now we require payment to advance stages?
lol we would be doing precisely that, if we added a bunch of otherwise unpaid work as a requirement.
22:55
<Anthony Bullard>
Okay. Gotta finish this Go book and I will
22:56
<rbuckton>
I feel very strongly that we should not do parameter decorators regardless of the outcome of this discussion

I need to set aside some time to discuss this with you further. How they are implemented in TS today for legacy decorators is as a far more convenient way to write:

class C {
  @C
  @__param(0, A)
  @__param(1, B)
  method(a, b) {}
}

as

class C {
  @C
  method(@A a, @B b) {}
}

TypeScript parameter decorators only give you ordinal position, but actual native parameter decorators could be far more useful. Parameter decorators aren't actually net new capabilities, but are far more convenient than having to manually maintain order in the context of refactors (i.e., adding new parameters, reordering parameters, etc.). They reduce repetition and boilerplate to potentially provide better reflective capabilities, such as parameter names, whether the parameter is a rest parameter, etc.

22:58
<Anthony Bullard>
What are @A and @B doing here? Not to mention @C? It’s hard to evaluate this without context on the problem we are solving
22:58
<rbuckton>
all syntax needs to be learned by all learners of the language, so that's a high cost
As stated elsewhere, that cost is already paid with decorators in general. IMO, its a higher cost to only be able to apply decorators inconsistently.
22:59
<Anthony Bullard>
As stated elsewhere, that cost is already paid with decorators in general. IMO, its a higher cost to only be able to apply decorators inconsistently.
Knowing the syntax exists is one thing. It’s another to understand what it’s doing and when to use it and how
23:00
<rbuckton>
Yes, which is why I've argued for maintaining consistency in all aspects and guides my preference related to hoisting.
23:00
<Anthony Bullard>
How do I find the definition of a decorator? Might not be obvious (though better in JS than Java)
23:00
<Anthony Bullard>
rbuckton:
23:01
<rbuckton>
Can you clarify what you mean by "definition of a decorator"?
23:01
<Anthony Bullard>
The implementation. Im speaking as a learner of JS or novice
23:01
<rbuckton>
As in, for a given decorator, where is is it declared?
23:02
<Anthony Bullard>
Yes. I know the answer knowadays is cmd +click/gd
23:03
<Anthony Bullard>
But a decorator is a new concept, whereas a function is a part of every programming language of the past 50 years
23:04
<rbuckton>
That is essentially the answer. A decorator is just a regular function, its just that the runtime will invoke it on your behalf with contextual information about the decorated declaration.
23:05
<Anthony Bullard>
And how simple will it be to understand what a decorator does in its implementation to that declaration?
23:05
<rbuckton>
From a logical point of view, there are many languages with similar capabilities. C# has attributes, Java has annotations, Python has decorators, C++ has templates
23:05
<Anthony Bullard>
Is it more complicated or simpler to understand than how you would accomplish the same task with existing concepts?
23:06
<Anthony Bullard>
rbuckton: and those are either highly misunderstood or despised (templates) features of the language
23:06
<rbuckton>
I'll need to come back to this, sorry
23:06
<Anthony Bullard>
rbuckton: no worries
23:07
<Anthony Bullard>
Probably should be in a thread anyway
23:07
<Anthony Bullard>
Sorry for the spam
23:07
<ljharb>
a newcomer will just command-click anything they don't understand, no?
23:08
<Anthony Bullard>
https://matrix.to/#/!WgJwmjBNZEXhJnXHXw%3Amatrix.org/%24-6WE2sDlOYmSmPR_QB6JOp6rGroz3yUP3ZMeCwnmyYs
23:09
<ljharb>
right but i mean, even for any new concept
23:09
<ljharb>
that solution is now a universal answer to literally anything that looks like an identifier/property name
23:09
<littledan>
From a logical point of view, there are many languages with similar capabilities. C# has attributes, Java has annotations, Python has decorators, C++ has templates
C++ Templates aren't quite analogous to decorators, but my coworker Dan Katz is proposing that "custom attributes" be introspectable via C++ Reflection.
23:10
<bakkot>
Probably should be in a thread anyway
nothing should be in a thread, threads in matrix are awful
23:10
<shu>
death to threads!!
23:11
<snek>
death to matrix
23:11
<Anthony Bullard>
bakkot: oh, element handles them fine (I think 😬)
23:11
<ljharb>
oh i thought you meant in programming
23:12
<bakkot>
As stated elsewhere, that cost is already paid with decorators in general. IMO, its a higher cost to only be able to apply decorators inconsistently.
I agree when it comes to adding decorators to object fields. I don't agree when it comes to adding decorators to functions.
23:12
<jschoi>
https://www.sqlite.org/faq.html#q6
23:12
<bakkot>
bakkot: oh, element handles them fine (I think 😬)
it does not
23:14
<littledan>
With respect to TC39 and MDN: The Open Web Docs project exists to pay people to fill gaps in MDN, and if there are TC39-related gaps, I bet they would like to hear from us. https://github.com/mdn/content/issues https://github.com/openwebdocs/project/issues . We could also have Ecma sponsor Open Web Docs to ensure there is good coverage of TC39 work (something which has been discussed previously, endorsed by this committee, but somehow didn't make it into a past Ecma budget)
23:17
<littledan>
Yes https://ecma-international.org/technical-committees/tc39/
23:18
<littledan>
Probably the first step would be for people to articulate more clearly what's missing in MDN, so we can ask OWD if they're going to do it, and if they're not going to, then figure out how else to solve the problem.
23:21
<hax (HE Shi-Jun)>
I recall that this topic has been proposed before and can't reach stage 1, but I forgot why.
23:21
<ljharb>
what was proposed before was elision in function argument lists, iirc
23:22
<ljharb>
like function (a, , c) {
23:23
<hax (HE Shi-Jun)>
I remember there were other options, void was also listed.
23:25
<hax (HE Shi-Jun)>
https://github.com/devsnek/proposal-unused-function-parameters
23:26
<snek>
man i can't believe i wrote that
23:26
<Ashley Claymore>
Could we just use hackmd?
23:26
<snek>
weird how we change over time
23:26
<snek>
like i'm not against it i just can't believe i cared about it so much to write up a proposal
23:26
<ljharb>
p sure no, hackmd can't handle our scale
23:27
<nicolo-ribaudo>
When you were young and had energy for life
23:28
<jschoi>
FYI, Zoom is acting up for me and I am disconnected. I have no need to speak in my queue item.
23:29
<littledan>
I found the array ellision discussion confusing. Is anyone actually proposing that we enable [1, void, 2] in expression position?
23:30
<snek>
is that not proposed
23:30
<snek>
i thought it was but i am not a fan
23:30
<shu>
i thought that was a motivating example actually
23:30
<ljharb>
I found the array ellision discussion confusing. Is anyone actually proposing that we enable [1, void, 2] in expression position?
ron's slide says he's weakly recommending supporting that, for consistency
23:30
<shu>
as contrasted against [1, , ] which iterates twice not thrice
23:30
<ljharb>
but it doesn't have to be included if the room doesn't like it (in array literals)
23:30
<littledan>
in the RHS?
23:30
<shu>
oh in the RHS
23:31
<shu>
what does that mean in the RHS
23:31
<ljharb>
but for array destructuring yes
23:31
<snek>
what does that mean in the RHS
elision
23:31
<ljharb>
(not just LHS because you can destructure in function arg lists)
23:31
<littledan>
in the RHS = as an expression, rather than a destructuring pattern
23:31
<ljharb>
in the RHS of an array literal it would mean elision, yes
23:31
<littledan>
in the RHS of an array literal it would mean elision, yes
right so is that proposed for inclusion here?
23:32
<ljharb>
weakly, yes (per the slide) but could be excluded
23:32
<littledan>
or was it just, "if we were to support it, it should mean array hole"?
23:32
<ljharb>
it was both i think?
23:32
<ljharb>
"we can support it or not, i weakly suggest we do for consistency, and if we do, it must mean a hole" was my reading of the slide
23:32
<jschoi>
I am against void in array expressions and interested in void only being in Arguments/LHS.
23:32
<littledan>
"we can support it or not, i weakly suggest we do for consistency, and if we do, it must mean a hole"
right, this discussion was confusing since I don't see any demand for this feature
23:33
<ljharb>
i think perhaps the slides went more in depth than necessary with exploring potential consistency applications of where to support it.
23:35
<ljharb>
nicolo-ribaudo: i've stated many times that repurposing a valid identifier should always be a nonstarter, fwiw (re _)
23:35
<bakkot>
ljharb: say more about why?
23:36
<jschoi>
nicolo-ribaudo: i've stated many times that repurposing a valid identifier should always be a nonstarter, fwiw (re _)
x |> f(it)
23:36
<ljharb>
because it would be confusing, and _ is used as a normal identifier in many codebases (lodash/underscore alone, let alone other code)
23:36
<ljharb>
x |> f(it)
yes, i've rejected/blocked that too for the same reason
23:36
<Justin Ridgewell>
void is the same weight/color as a identifier in my editor
23:37
<Justin Ridgewell>
It cannot be void
23:37
<littledan>
What does it mean to say that something is a non-starter? Is this implying something about consensus/blocking?
23:37
<ljharb>
yes
23:37
<Chris de Almeida>
we've discussed the possibility of hackmd. and I have been told it can handle our scale, with it having been stated that others have used it with more concurrent users than we have
23:37
<hax (HE Shi-Jun)>
I support this proposal. But I don't know why in that time, it was rejected (As the notes, unused param proposal was rejected by MM and YSV.), if today it is accepted, I am happy. But also it shows some randomness.
23:38
<Chris de Almeida>
we ended up with: maybe we can try it for a single topic some time
23:38
<ljharb>
making a previously valid identifier magic at this point is far more harm than any benefit any proposal could provide, and i'm aware of await.
23:38
<bakkot>
what about like ..
23:38
<danielrosenwasser>
void is the same weight as a identifier in my editor
what editor is that?
23:38
<danielrosenwasser>
why does it not colorize keywords differently?
23:38
<bakkot>
array.map((.., i) => i)
23:38
<shu>
void is the same weight as a identifier in my editor
having trouble understanding this. all keywords look like idents but behave very differently? is the argument you eyeball them both the same and that's okay?
23:38
<bakkot>
probably too confusing with ...
23:38
<jschoi>
Indeed regarding the pipe topic, I am still in agreement about this principle. Makes moving code less contextually fragile.
23:39
<Justin Ridgewell>
Vim with Solarized theme and vim-polyglot syntax highlighting
23:39
<jschoi>
sent an image.
Is this the same color for yield and await?
23:40
<jschoi>
If not, seems like a bug with the theme.
23:40
<Justin Ridgewell>
having trouble understanding this. all keywords look like idents but behave very differently? is the argument you eyeball them both the same and that's okay?
void isn't a common keyword, so it hasn't mattered that it's exactly the same as an identifier.
23:40
<shu>
but like, now it will be?
23:41
<shu>
i agree that it seems like an editor/theme issue
23:41
<ljharb>
the very very commonly used TS no-floating-promises rule uses void as a way to mark a promise as not-needing-to-be-awaited, so it's not super rare
23:41
<Justin Ridgewell>
Normal keywords are styled
23:41
<Richard Gibson>
also, why make some keywords second-class? Seems like a bug in the syntax highlighting
23:41
<shu>
theme issue
23:41
<Justin Ridgewell>
But even if it were styled differently, it would still standout when the whole point is for it to disappear
23:41
<snek>
justin i'm not sure what you're saying here. your editor colors void the same as other identifiers?
23:42
<ljharb>
it should stand out
23:42
<ljharb>
it's discarding something
23:42
<shu>
my claim is, whatever we choose here, unless egregiously bad, people will get used to it
23:43
<snek>
i think void is the least bad option i've seen so far
23:43
<Michael Ficarra>
duplicate bindings is an error in strict mode
23:43
<Michael Ficarra>
ljharb: ^
23:43
<ljharb>
ah thanks
23:44
<Justin Ridgewell>
it's discarding something
Completely disagree. The reason function foo(_) {} is so nice is because it disappears.
23:44
<bakkot>
is it actually true that people use _ that often? it's been a long time since I saw that; even with lodash people just pull in the specific named helpers or pull it in as lodash, most of the time
23:44
<shu>
i gotta say i'm not excited to find out if _ is compatible
23:44
<bakkot>
like it certainly used to be a thing
23:44
<shu>
i have nothing against it
23:44
<danielrosenwasser>
Does your editor theme make _ more muted?
23:44
<Justin Ridgewell>
It's been years since I've seen _ be the underscore library.
23:44
<Anthony Bullard>
I think _ is the most acceptable valid identifier to become a new piece of syntax
23:45
<Anthony Bullard>
If not for underscore
23:45
<bakkot>
i gotta say i'm not excited to find out if _ is compatible
I think it can be done without changing semantics of any currently legal program
23:45
<nicolo-ribaudo>
i gotta say i'm not excited to find out if _ is compatible
What I propose is only to relax some errors. Declaring to _ twice would become always valid, but in case where it currently throws than you still wouldn't be able to read it
23:45
<bakkot>
it just lets you redeclare it, and if redeclared then you can't refer to it
23:45
<shu>
I think it can be done without changing semantics of any currently legal program
then sgtm
23:45
<snek>
do minifiers not emit _ as an identifier
23:45
<Anthony Bullard>
nicolo-ribaudo: snek they do
23:45
<nicolo-ribaudo>
do minifiers not emit _ as an identifier
Not Babel, but again we wouldn't be changing existing code
23:46
<shu>
What I propose is only to relax some errors. Declaring to _ twice would become always valid, but in case where it currently throws than you still wouldn't be able to read it
then no longer sgtm! sounds like special case proliferation in many parts of the frontend
23:46
<bakkot>
do minifiers not emit _ as an identifier
not usually; you start with like e s t f etc, for better compressibility
23:46
<ljharb>
Completely disagree. The reason function foo(_) {} is so nice is because it disappears.
i don't know what you mean by that. the function syntax is something that always pops out to me, and my syntax highlighting reenforces that (but it pops out to me even without highlights)
23:46
<ljharb>
clearly it's something subjective tho
23:47
<nicolo-ribaudo>
then no longer sgtm! sounds like special case proliferation in many parts of the frontend
It would be in the parser only, but also we could instead go with "last declaration wins" semantics that sloppy var ahs
23:47
<shu>
sent an image.
your identifiers are red, the highest contrasting thing in that screenshot
23:47
<shu>
It would be in the parser only, but also we could instead go with "last declaration wins" semantics that sloppy var ahs
eh, not convinced
23:48
<ljharb>
msaboff bindings are basically the only place where this proposal applies, and undefined can become one already
23:48
<Justin Ridgewell>
But I'm not confused whether _ is something I care about, vs void looking exactly like a binding name.
23:48
<jschoi>
Trying to rejoin Zoom on my phone, need to be let in again, sorry.
23:48
<ryzokuken>
jschoi it doesn't show you in the lobby
23:49
<ljharb>
But I'm not confused whether _ is something I care about, vs void looking exactly like a binding name.
you had to learn the convention of _ being something to ignore tho
23:49
<jschoi>
jschoi it doesn't show you in the lobby
Sorry, try again now?
23:50
<ryzokuken>
jschoi nothing ☹️
23:50
<ryzokuken>
maybe I lost host status when I reconnected?
23:50
<ryzokuken>
sec
23:50
<ryzokuken>
I'll ask the other chairs
23:50
<Justin Ridgewell>
you had to learn the convention of _ being something to ignore tho
It is visibly small, making it very easy
23:51
<jschoi>
Thanks!
23:51
<ljharb>
right. but what i'm suggesting is that "easy to disappear" is strongly undesirable, because discarding something should be highly visible and jarring
23:52
<Justin Ridgewell>
We have very different goals, then.
23:53
<Justin Ridgewell>
I want it to be clear to the reader that I've intentionally ignored this binding, but not confuse them whether this is a real biding.
23:53
<bakkot>
yeah no it definitely should not be
23:53
<jschoi>
I think it’s not a big ask to ask JavaScript developers to be aware of the permanent set of permanent keywords in the language. It’s not like void was ever a binding name, and I was always aware of it from when I first learned the language and the set of legal identifiers.
Is the concern with its appearance to developers during rapid visual scanning?
23:53
<bakkot>
languages with _ are widespread and the feature is widely loved
23:53
<Justin Ridgewell>
function foo(void, foo, bar) {} vs function foo(_, bar baz {}
23:56
<bakkot>

while everyone's here, if you would like to think about async iterators, I have written up the two major open questions in my mind, namely:

  • do you enforce promises settle in order? if so, you can't do rust-style bufferUnordered, but if not, you can observe otherwise-impossible sequences.
  • how do you get concurrency for helpers like .find?

https://gist.github.com/bakkot/ad58565b203cd845524ac702c3f289f0

23:56
<rbuckton>
and now I need to catch up on matrix conversations...
23:59
<rbuckton>
const index =
(route
(authorized
(originCheck
(rateLimited(5, 1)
(function (...) {
  / body
})))))

just use ( for decorators instead of @ :)

This is certainly not more readable, and breaks assigned names (i.e., the function won't have the name "index"). Decorators would be able to preserve the assigned name on the innermost function as well as pass that to decorators via context in the event one decorator in the chain wraps a function and does not copy over the name.