00:15
<bakkot>
bakkot: looks like we're missing the logs for today? https://matrixlogs.bakkot.com/TC39_Delegates/2023-07-11
fixed. I suspect my boot disk is failing; will have it replaced tomorrow.
02:17
<Jack Works>
the end goal for me is users, not developers, and good defaults for me should be chosen to nudge developers to the result (responsiveness, correctness, fast loading, whatever) we want on products they build for the user. if all developers ignore a default constantly, then we obviously failed and nobody benefits. Google-internally, i did not get this sense when talking with practitioners about a lack of a defer-like thing
the problem is we cannot everything by default because it's a breaking change
03:03
<shu>
not sure i follow
03:03
<shu>
the context of my previous comment was about the Promise constructor vs withResolvers
03:04
<Jack Works>
oh
03:04
<shu>
the "good default" was referring to the hope that the Promise constructor would, even though it's more inconvenient to use, would bring about better correctness results wrt uncaught exceptions -> rejections
03:04
<shu>
but since then we've learned that maybe that doesn't have quite the effect we hoped because people ignore it
03:05
<shu>
or because there are legitimate use cases
03:05
<shu>
and so, it's fine to add withResolvers, even though it's explicitly against what we thought was the good default
03:05
<shu>
but the broader point is that that's the kind of argument i'm looking to hear, not simply "developers use pattern X"
08:02
<bakkot>
g'morning all
08:10
<jkup>
I have a question about calendars. The source map monthly call was on the TC39 calendar but I don't see it on there anymore. How can I go about adding it back? Do I make a personal event and then invite the calendar? Or do I need a special permission to do this?
08:18
<Michael Ficarra>
my understanding was that an event needs to be added to the private calendar first, and the public calendar is invited as an attendee of that event
08:18
<Michael Ficarra>
the public calendar has an email address to invite
08:19
<Michael Ficarra>
most of us regular-folk don't have permission to create such an event on the private calendar, though, so you should contact a chair or ljharb
08:19
<jkup>
Thank you!
08:24
<littledan>
but since then we've learned that maybe that doesn't have quite the effect we hoped because people ignore it
I think this is the key point--despite many years passing, people are generally unaware both of the implied best practice and the fact that the promise constructor helps lead you to it, and on the other hand, the best practice is enforced by async/await. An illustration of the widespread lack of awareness is that no one even raised this concern in committee until you did, and without this awareness, people can't even really be expected to use the promise constructor in the way where it's helpful.
08:33
<rbuckton>
If dayOfWeek returns 2, indicating this is the 2nd day of the week relative to the firstDayOfWeek, it could be confusing that both are numbers 1-7 but don't represent the same value.
08:33
<ryzokuken πŸ‡³πŸ‡΄>
https://unicode.org/reports/tr35/#UnicodeFirstDayIdentifier
08:33
<ryzokuken πŸ‡³πŸ‡΄>
(this is what Shane is talking about)
08:34
<rbuckton>
If dayOfWeek returns 2, indicating this is the 2nd day of the week relative to the firstDayOfWeek, it could be confusing that both are numbers 1-7 but don't represent the same value.
Assuming my interpretation is correct.
08:38
<Bradford Smith>
This Unicode extension for locale identifiers seems nuts to me. You have to use the first part of the identifier "en" to know how to interpret the identification of the day of the week "tue".
08:42
<littledan>
It also maintains a list of all of the delegates to TC39; this is listed in the Ecma memento. When organizations add or remove delegates, someone is supposed to inform Ecma of this so they can update their lists (I think the chairs do this?). But anyway things have gone out of sync.
08:50
<littledan>
I think the summary can omit the back-and-forth that Frank and I had, and instead be in paragraph form. Will Frank be doing this rephrasing, or should I do so? (I don't see Frank here, maybe another Googler could ask him?)
08:51
<littledan>
(or bullet form)
08:53
<Rob Palmer>
Unless the presenter explicitly delegates, they remain responsible for the summary. The secretary will chase presenters where summaries appear insufficient. I'll make sure we say this on the Reflector.
09:07
<ryzokuken πŸ‡³πŸ‡΄>
Ashley Claymore: should I put the link in the notes?
09:08
<Michael Ficarra>
ryzokuken πŸ‡³πŸ‡΄: yes, there is a spot for you to do so already
09:09
<Michael Ficarra>
search for "slides presented but no link in agenda"
09:14
<HE Shi-Jun>
I slightly prefer offset solution because I guess developers use BYOB for perf, and would like to use offset to get perf benefit (even a little), and even without offset, it already complicated πŸ˜‰
09:16
<Michael Ficarra>
HE Shi-Jun: I wouldn't want to do that without compelling evidence that the perf is significantly better
09:17
<Michael Ficarra>
also, it would be safe to add later, right?
09:21
<ryzokuken πŸ‡³πŸ‡΄>
ryzokuken πŸ‡³πŸ‡΄: yes, there is a spot for you to do so already
done, thanks again for the reminder
09:22
<HE Shi-Jun>
also, it would be safe to add later, right?
agree it could be add later. I just think it very likely will have some perf benefit, especially on embed engines.
09:27
<Bradford Smith>
So, the alternative to having these "inputOffset" and "outputOffset" parameters is to have to create a separate view into the input & output base arrays on each iteration of the loop?
09:29
<Michael Ficarra>
Bradford Smith: yes, and views should be very lightweight
09:46
<HE Shi-Jun>
After listening all queue discussion, I feel maybe we'd better leave the streaming api to future follow-on proposal ...
09:48
<Christian Ulbrich>
I think we want the full cake, we want the un-disputed oneshot methods to fast-track, and have the streaming API versions that share consistency with them added later. Looks like a good challenge...
09:48
<Michael Ficarra>
I think the streaming design is as fleshed out as it's going to be, we just need to decide whether it's justified for inclusion or not
09:49
<Michael Ficarra>
I don't think splitting helps with that
09:50
<bakkot>
Bradford Smith: yes, and views should be very lightweight
views are apparently not that lightweight in JSC per https://github.com/tc39/proposal-arraybuffer-base64/pull/26#issuecomment-1617312928
09:51
<bakkot>
or at least not the first view
09:51
<Michael Ficarra>
should
09:51
<tkopp>
I dont think views are in general "lightweight" in comparison to actually know the place where you want to put yyour data
09:52
<tkopp>
I think the streaming design is as fleshed out as it's going to be, we just need to decide whether it's justified for inclusion or not
But, yes this might be true
09:52
<bakkot>
should
I think there's always going to tradeoffs in any representation, and a representation in which the second view of a buffer is expensive in exchange for the first view being faster is not obviously incorrect
09:52
<bakkot>
so I don't think "should" is at all obvious here
09:54
<bakkot>
Luca Casonato: https://github.com/tc39/proposal-arraybuffer-base64/issues/13 is the streaming issue, and https://github.com/tc39/proposal-arraybuffer-base64/issues/21 the one for encoding into an existing buffer
09:55
<bakkot>
the thing where you have a "prefix" argument to the one-shot API was my first suggestion, if I have understood correctly that this is what you were proposing; see response from justin in https://github.com/tc39/proposal-arraybuffer-base64/issues/13#issuecomment-911968641
09:56
<bakkot>
(and from peter, two comments down)
10:00
<littledan>
re: streaming: I think, in general, it's vaguely best practice that primitives that deals with data should have zero-copy and streaming APIs for doing stuff with them. To me, the main question is whether there are valid use cases for doing base64 on a fairly big thing that can't fit in memory/packets all together. I don't know of such use cases/environments.
10:01
<ryzokuken πŸ‡³πŸ‡΄>
might be a bit cursed but I've seen people pass around entire images encoded in encoded base64
10:02
<Michael Ficarra>
that's not even unusual
10:02
<ryzokuken πŸ‡³πŸ‡΄>
yeah, not sure how ideal it is, but it's certainly not uncommon
10:03
<littledan>
I know but there's a certain limit on how big they can get, right?
10:04
<littledan>
also I don't think HTML has a streaming API to set the src of an img tag...
10:04
<tkopp>
there are a lot of APIs that don't handle binary data at all. You can only send e.g. images via encoding
10:04
<Luca Casonato>

bakkot: My suggestion was this: https://gist.github.com/lucacasonato/06a74fe2658fbe5a2d9c24cc767006c0

No need for any extra option on the static API. This performs at most 3 byte copies for every remainder. The code can be optimized further.

10:05
<Michael Ficarra>
at Shape, we one-shot base64 decode something like 150kb of bytecode on the main thread every page load
10:05
<Michael Ficarra>
haven't run into any long task issues yet
10:05
<tkopp>
There is no "real" upper limit of the length of a string. Most of the limits are imposed by the server software that is used
10:06
<Ashley Claymore>
yes please
10:06
<Michael Ficarra>
let me introduce you to my good friend 2**53
10:06
<tkopp>
:D
10:06
<tkopp>
You might compress you string before you hit that Λ†Λ†
10:07
<tkopp>
*your
10:07
<bakkot>
ah, got it
10:07
<littledan>
there are a lot of APIs that don't handle binary data at all. You can only send e.g. images via encoding
it'd be good to understand use cases like this in some more detail
10:07
<Luca Casonato>
bakkot: do you have a link to your Web Streams impl ontop of the proposed streaming API? I can't find it in your slides
10:08
<bakkot>
it's in the playground
10:08
<bakkot>
https://tc39.es/proposal-arraybuffer-base64/
10:08
<Luca Casonato>
Ah, thanks!
10:10
<ptomato (at TC39, limited availability)>
rbuckton: my personal opinion is that I'd like to investigate Symbol.enter but with what I know at this time, full context manager support seems excessive. I'd hesitate to speak for the committee, but that would be my recommendation
10:10
<tkopp>
soap APIs from transportation/shipping companies come to mind immediately.
10:11
<littledan>
great, I'd love to hear about your experience with these and how they relate to data size and streaming
10:11
<bakkot>
github rest API returns contents as base64-encoded strings
10:11
<bakkot>
for files up to 100MB in size
10:14
<bakkot>
actually I guess only up to 1MB; the API changes a bit for larger files
10:14
<Bradford Smith>
From my point of view Ron was just considering a related problem - how to make sure developers are nudged toward using the resource management features he's defining - and then coming up with a possible solution to this. He presented it as a possible follow-on proposal. DE seemed at first to be saying that this problem is important enough to force changes to the existing stage 3 proposal, but I think he's backed down from this. I think the conclusion is not to include such a feature in the current proposal.
10:15
<rbuckton>
I'll reiterate that I don't have an appetite for full context managers. They add a level of complexity that I'm not sure is suitable for ECMAScript, and they would have a negative impact on the ability for static type checkers like TypeScript to make reasonable assumptions about control flow due to ability for any context manager bound to a using to swallow an exception.
10:18
<Bradford Smith>
Regarding the GC cleanup issue: I thought Ron was suggesting that engines could be encouraged to clean up any disposables that they themselves created (not every possible disposable) if they go out of scope without "leaking" anywhere else from the scope where they were created.
10:19
<Bradford Smith>
just encouraged, not required
10:19
<rbuckton>
If we're not doing full context managers, then the goal of the proposed change would be to resolve a concern about "unused" disposables. That would be addressed by Symbol.enter without the need to introduce a Symbol.asyncEnter. await using would still verify/capture [Symbol.asyncDispose] as it does today, but would call [Symbol.enter]() synchronously without the need to introduce an extra Await at the declaration site. That would also avoid needing to rethink AsyncDisposableStack.prototype.use to handle the async case.
10:20
<Ashley Claymore>
for using Symbol.enter as a way for types to enforce they are being assigned to using, could this also be done with Symbol.dipose setting a userHasAcknoledgedLifetime flag that either errors/warns if other methods are called without that flag set?
10:20
<bakkot>
re: streaming: I think, in general, it's vaguely best practice that primitives that deals with data should have zero-copy and streaming APIs for doing stuff with them. To me, the main question is whether there are valid use cases for doing base64 on a fairly big thing that can't fit in memory/packets all together. I don't know of such use cases/environments.
it's not just about whether it all fits in memory; for example, one might reasonably stream base64'd wasm bytecode into WebAssembly.compileStreaming. the advantage of streaming in this case is that you can start doing work before waiting for the whole download to finish. which is nice!
10:21
<bakkot>
similarly, if you're uploading base64'd data to a server, you might do binary data -> compression stream -> base64 stream -> fetch; it's nice to be able to start the network request as early as possible
10:21
<Ashley Claymore>
my gut feeling is also that DisposeStack.p.move is a simpler API to explain that the enter/exit symbols.
10:21
<rbuckton>
for using Symbol.enter as a way for types to enforce they are being assigned to using, could this also be done with Symbol.dipose setting a userHasAcknoledgedLifetime flag that either errors/warns if other methods are called without that flag set?
Yes, a user-defined implementation could conceivably make [Symbol.dispose] a getter that indicates the method was at least read.
10:21
<rbuckton>
my gut feeling is also that DisposeStack.p.return is a simpler API to explain that the enter/exit symbols.
what is return?
10:22
<Ashley Claymore>
sorry, move
10:24
<rbuckton>
Regarding the GC cleanup issue: I thought Ron was suggesting that engines could be encouraged to clean up any disposables that they themselves created (not every possible disposable) if they go out of scope without "leaking" anywhere else from the scope where they were created.
My intent was to state that as a remediation for an "unused" disposable, a host could leverage GC if necessary to ensure native handles don't leak, and that a user could use FinalizationRegistry to do the same. I worded it too strongly to expect that to always be the case, and that the outcome should be resource cleanup rather than a warning message like as what can happen for unhandled promise rejections. That wording was based on my prior experience with C#'s IDisposable and the C# team's recommendations to do likewise.
10:25
<Bradford Smith>
Yes, a user-defined implementation could conceivably make [Symbol.dispose] a getter that indicates the method was at least read.
Personally, I think you're chasing an impossible goal here. The Explicit Resource Management proposal as-is provides a useful feature. There's no need to try so hard to force its correct use. Leave that problem for another day. Just my $0.02.
10:26
<rbuckton>
sorry, move
move and exit are somewhat orthogonal to each other, so I'm not clear on the correlation you are making?
10:28
<rbuckton>
Personally, I think you're chasing an impossible goal here. The Explicit Resource Management proposal as-is provides a useful feature. There's no need to try so hard to force its correct use. Leave that problem for another day. Just my $0.02.
I concur. JavaScript itself can't reliably enforce lifetimes and ownership in the same way a language like Rust can, as that essentially requires a fully-baked runtime type system. Without that, we would be forced to take a major performance hit for every var/let/const declaration and every assignment to check or transfer ownership of an object's lifetime, which is a non-starter.
10:29
<Ashley Claymore>
for the examples where code is switching if the exit was a throw or return completion. Reaching DisposeStack.p.move also indicates that
10:29
<Ashley Claymore>
  • can also indicate that
10:29
<rbuckton>
I'm not convinced we even need [Symbol.enter]().
10:29
<rbuckton>
for the examples where code is switching if the exit was a throw or return completion. Reaching DisposeStack.p.move also indicates that
Ah, thank you for the clarification.
10:32
<rbuckton>

In a way, DisposableStack.p.move is a close approximation of Rust's move semantics as a way to "transfer ownership on assignment" similar to an affine type system, but in an imperative form:

using stack1 = new DisposableStack();
...
using stack2 = stack1.move(); // stack1 can no longer be used, its contents have been moved to stack2.
...
using stack3 = stack2.move(); // stack2 can no longer be used, its contents have been moved to stack3.
10:33
<rbuckton>
(which is part of the reason for the choice of method name as well)
11:01
<littledan>
I'm not convinced we even need [Symbol.enter]().
I agree. But if we did want to go in that direction, I think we should retract this proposal to Stage 2, as it's a big change and we don't have a concrete form of this yet.
11:02
<littledan>
I think we should conclude that we're not going in this Symbol.enter direction
11:02
<littledan>
this is just a very big thing to be considered an open question for a Stage 3 proposal
11:05
<rbuckton>
I think we should conclude that we're not going in this Symbol.enter direction
nicolo-ribaudo's suggestion to make [Symbol.dispose] a getter if you want to opt-in to requiring the use of using or a DisposableStack holds water and may be satisfactory, without the need to introduce a new symbol-named method to the Disposable protocol: https://github.com/tc39/proposal-explicit-resource-management/issues/159#issuecomment-1630532470
11:25
<Michael Ficarra>
it's so strange to me that IETF would explicitly not want to support sub-minute offsets
11:25
<Michael Ficarra>
it just feels like painting yourself into a corner for no good reason
11:25
<shu>
be the change you want to see in the world
11:26
<shu>
do you want sub-minute offset timezone in the world
11:26
<Michael Ficarra>
I am not a politician, I do not get to decide that
11:26
<ryzokuken πŸ‡³πŸ‡΄>
they considered it vestigial and unnecessary moving forwards
11:26
<bakkot>
if all the computer people collectively refuse to implement support for it, what are the politicians gonna do?
11:26
<ryzokuken πŸ‡³πŸ‡΄>
fwiw, the ISO format still accepts all sorts of input
11:26
<Michael Ficarra>
I would not be at all surprised if the DPRK changed their timezone (again) to a sub-minute offset
11:26
<bakkot>
the time is whatever my phone tells me it is, not what a politician announces
11:26
<ryzokuken πŸ‡³πŸ‡΄>
but IETF prefers to maintain a leaner profile
11:27
<shu>
I am not a politician, I do not get to decide that
you sell yourself short dear mr ficarra
11:27
<Michael Ficarra>
bakkot: the DPRK makes their own OS
11:27
<shu>
i too skinned Linux when i was 10
11:28
<ryzokuken πŸ‡³πŸ‡΄>
bakkot: the DPRK makes their own OS
I really wanted to respond but this isn't TDZ πŸ˜›
11:28
<shu>
yes, the limitation of being unhinged and deranged about time zones
11:51
<ptomato (at TC39, limited availability)>
FWIW, Asia/Pyongyang could still have a sub-minute offset. the limitation doesn't apply to named time zones
11:54
<ryzokuken πŸ‡³πŸ‡΄>
Yes, this only applies to in-timestamp offsets
11:59
<littledan>
I think the details of whether engines ship the Intl-only part separately or just together with Intl is something that we can leave to engines to decide. If an engine expects to take a really long time to do Temporal, they might do the Intl-only part. But Temporal should only ship with this included, and it'd be valid to ship at the same time. Within this, I think 2a would be the simplest way to organize the explanations.
12:02
<littledan>
I think the details of whether engines ship the Intl-only part separately or just together with Intl is something that we can leave to engines to decide. If an engine expects to take a really long time to do Temporal, they might do the Intl-only part. But Temporal should only ship with this included, and it'd be valid to ship at the same time. Within this, I think 2a would be the simplest way to organize the explanations.
err, never mind--I'm convinced by what Shu and Justin said, about how missing the .equals method is fatal for shipping separately
12:05
<shu>
sffc: no we can't implement the non-temporal parts sooner
12:05
<shu>
because of what dan just said
12:09
<sffc>
It still seems like we should stop returning Saigon and Kiev despite the lack of a Temporal.TimeZone.prototype.equals
12:10
<ptomato (at TC39, limited availability)>
that's what I was getting at, but I take Shu's point that that causes interoperability problems
12:11
<bakkot>
I do like this proposal but I still wish we had import program from 'source.wasm' with { imports: whatever, memory: new ArrayBuffer(1000) } etc
12:12
<bakkot>
instead of needing to import the source and then compile it yourself
12:12
<bakkot>
that's just kinda silly
12:12
<shu>
is that a static import with a new ArrayBuffer
12:12
<shu>
how does that work
12:12
<nicolo-ribaudo>
Evaluating expressions even before linking the module graph seems... difficult
12:13
<bakkot>
you do the downloading and so on right away but don't do the actual instantiation until you hit the import declaration
12:13
<bakkot>
this does not seem hard to me?
12:14
<sffc>
that's what I was getting at, but I take Shu's point that that causes interoperability problems
ok, sorry for my misunderstanding
12:14
<nicolo-ribaudo>

And you cannot capture bindings from outside the import declaration? i.e.

let buf = new ArrayBuffer()
import program from 'source.wasm' with { memory: buf } 
12:15
<bakkot>
no I am imagining that would work as written
12:15
<bakkot>
don't see why it shouldn't
12:15
<nicolo-ribaudo>
That could work with CJS where modules are evaluated before their dependencies, but with ESM buf does not exist until when all the imported modules are evaluated
12:15
<bakkot>
there are multiple notions of "evaluated" wrt wasm
12:16
<bakkot>
the obvious thing for it to do is to download the thing but not actually instantiate until you hit the import declaration, at which point buf is available
12:16
<shu>
what is "hit the import declaration"
12:17
<bakkot>
like, get to that line in the program
12:17
<Michael Ficarra>
evaluation semantics for an ImportDeclaration
12:18
<shu>
the import declaration is just parsed and collected and processed ahead of time right now, it's not even in the AST sent to the compiler
12:18
<shu>
i don't think import has evaluation does it
12:18
<shu>
like we could add it but that seems a radical departure from what it does right now
12:18
<nicolo-ribaudo>
Also, import declarations are hoisted. Capturing from inside them has the same problems discussed for function declaration decorators
12:19
<bakkot>
to be clear I am not super-seriously proposing this
12:19
<bakkot>
I agree the hoisting is annoying technically
12:19
<bakkot>
however, no real program relies on hoisting import declarations, because that's batshit
12:19
<nicolo-ribaudo>
Also to be clear, I also hope we'll have direct imports for wasm one day
12:19
<bakkot>
so it still feels like the code sample above should just work as written
12:20
<ljharb>
hm, can you class extends AbstractModuleSource { } if it's not constructable or callable?
12:20
<shu>
i don't understand the spec draft as written
12:20
<littledan>
if you use direct Wasm imports, then that Wasm module can import a memory from a different ESM module that explicitly constructs it.
12:20
<bakkot>
however, no real program relies on hoisting import declarations, because that's batshit
(hoisting in the function declaration sense, that is)
12:20
<nicolo-ribaudo>
hm, can you class extends AbstractModuleSource { } if it's not constructable or callable?
Yes but you cannot then call super()
12:20
<shu>

(hoisting in the function declaration sense, that is)

really? you don't write mutually recursive functions?

12:21
<ljharb>
Yes but you cannot then call super()
ok so there's no way for a subclass to get the internal slot in a self-hosted-in-JS implementation?
12:21
<nicolo-ribaudo>

(hoisting in the function declaration sense, that is)

really? you don't write mutually recursive functions?

Well, you don't write mutually recursive imports
12:21
<shu>
oh i misunderstood the point
12:21
<shu>
not that nobody relies on the hoisting function semantics, but the hoisting import semantics that are like the hoisting function semantics
12:21
<littledan>

It's pretty common to use function hoisting in a sillier way, like

foo.onbar = fn;
function fn() { }

In fact, fear of breaking this particular pattern is what's holding back function decorators

12:21
<bakkot>
not that nobody relies on the hoisting function semantics, but the hoisting import semantics that are like the hoisting function semantics
right exactly
12:21
<littledan>
not that nobody relies on the hoisting function semantics, but the hoisting import semantics that are like the hoisting function semantics
anyway yes this is how import statements work
12:22
<bakkot>
concretely, no one writes an import declaration at the bottom of a file and code which runs right away which uses a binding from the import at the top of the file
12:22
<Michael Ficarra>
nicolo-ribaudo: it shouldn't unconditionally throw, it should just throw if it's its own NewTarget
12:22
<shu>
i think the current spec draft is just wrong about the abstract constructor thing
12:22
<Michael Ficarra>
https://github.com/tc39/ecma262/pull/3094#discussion_r1230304753
12:23
<nicolo-ribaudo>
(I need to look at the proposal spec before answering to that)
12:23
<shu>
it's unconditionally throwing now but the comment suggests otherwise
12:23
<littledan>
it's unconditionally throwing now but the comment suggests otherwise
This is resolved by the Wasm subclass behavior
12:23
<shu>
how can you resolve that in the subclass behavior
12:23
<shu>
what installs the brand?
12:23
<littledan>
the cyclic module record superclass throws; the wasm module subclass does another thing
12:24
<littledan>
it's installed when parsing the Wasm module, by construction
12:24
<rbuckton>

It's pretty common to use function hoisting in a sillier way, like

foo.onbar = fn;
function fn() { }

In fact, fear of breaking this particular pattern is what's holding back function decorators

sillier? This is a common practice in the TS codebase, i.e.:

function createFoo() {
  const quxx = ...;

  return {
    bar,
    baz,
  };

  function bar() { ... }
  function baz() { ... }
}
12:24
<littledan>

sillier? This is a common practice in the TS codebase, i.e.:

function createFoo() {
  const quxx = ...;

  return {
    bar,
    baz,
  };

  function bar() { ... }
  function baz() { ... }
}
sorry I shouldn't've included a value judgement
12:24
<shu>
littledan: i don't understand. happy to see spec text though
12:24
<littledan>
shu: https://webassembly.github.io/esm-integration/js-api/index.html#get-module-source
12:25
<shu>
how does that interface with %AbstractModuleSource%
12:25
<nicolo-ribaudo>
It sets the internal slot in step 4 of https://webassembly.github.io/esm-integration/js-api/index.html#construct-a-webassembly-module-object
12:25
<littledan>
(oops sorry I was answering the wrong question)
12:26
<bakkot>
someone is typing loudly again
12:26
<nicolo-ribaudo>
However yes, there is no way for JS code to create objects with that internal slot with the current spec (@ljharb)
12:26
<nicolo-ribaudo>
someone is typing loudly again
Sorry, me
12:26
<ljharb>
that seems like a problem
12:26
<littledan>
someone is typing loudly again
did it stop for you?
12:26
<nicolo-ribaudo>
Do y'all think that throwing only if constructed directly would be an acceptable solution?
12:27
<ljharb>
that works for me, based on new.target or something
12:27
<nicolo-ribaudo>
Do y'all think that throwing only if constructed directly would be an acceptable solution?
(I do not remember why we throw)
12:27
<bakkot>
did it stop for you?
it has stopped now yes
12:28
<Michael Ficarra>
nicolo-ribaudo: yes, that is what we suggested here: https://github.com/tc39/ecma262/pull/3094#discussion_r1230304753
12:28
<nicolo-ribaudo>
I'm trying to find references as to why we introduced the throwing behavior in the first place
12:29
<littledan>
if there's no JS-exposed API for setting that internal brand slot (e.g., a super constructor parameter), then the constructor isn't very useful
12:29
<littledan>
whether or not it throws
12:30
<ljharb>
hm, that is true
12:30
<ljharb>
it seems important to be able to self-host in JS tho
12:30
<littledan>
to me this feels like something that's OK to unconditionally throw "for now" with a hope that we expand this out soon (maybe in the context of compartments)
12:31
<nicolo-ribaudo>
it seems important to be able to self-host in JS tho
Without custom module loading you cannot self-host modules anyway
12:31
<ljharb>
you could with on-the-fly source rewriting, no? i don't mean virtualization which indeed would require custom module loading
12:31
<littledan>
"instantiable" would be a name reflecting intuition? I think this sounds just vaguely computer-y.
12:32
<Michael Ficarra>
I don't like any of these new name suggestions
12:32
<Michael Ficarra>
the existing names are fine
12:32
<littledan>
you could with on-the-fly source rewriting, no? i don't mean virtualization which indeed would require custom module loading
If you're rewriting source, why do you care about using a real source object at all?
12:32
<Ashley Claymore>
'source' is much easier to write and spell than 'instantiable'
12:33
<ljharb>
If you're rewriting source, why do you care about using a real source object at all?
because user code would still need to interact with the resulting source phase object
12:33
<littledan>
sorry, which sorts of interactions are you picturing?
12:33
<danielrosenwasser>
'source' is much easier to write and spell than 'instantiable'
The good news is this is a power-user feature with a keyword that can get auto-completed
12:34
<Michael Ficarra>
importing and using wasm is power user now?
12:34
<ljharb>
sorry, which sorts of interactions are you picturing?
anything that's observable. i don't have a use case except that a self-hosted implementation should be able to be made indistinguishable from a C++ one
12:34
<littledan>
importing and using wasm is power user now?
when linking it yourself? yes, I think so
12:34
<ljharb>
since when has it not been
12:34
<Ashley Claymore>
I wish writing code snippets in non-IDEs had auto-complete
12:36
<Bradford Smith>
I find "instantiable" even less understandable than "source".
12:36
<danielrosenwasser>
What's your definition of a non-IDE? Even notepad++ has auto-complete for JavaScript :D
12:36
<Michael Ficarra>
apparently I don't understand the limits of the average developer nowadays
12:36
<Ashley Claymore>
Matrix
12:36
<Ashley Claymore>
github
12:37
<Ashley Claymore>
Slack
12:37
<Ashley Claymore>
Whatsapp ;)
12:37
<bakkot>
not convinced you ever did
12:37
<shu>
i'm surprised but point taken
12:37
<Michael Ficarra>
Twitter bio
12:37
<danielrosenwasser>
If someone judges you for a code typo in Whatsapp please let me yell at them
12:37
<Ashley Claymore>
Threads?
12:37
<bakkot>
that said it is getting less and less power-user-y as it becomes a more first-class target in languages like go and rust
12:37
<shu>
(like, what do you think you want to do with the thing you get from this phase, if not to instantiate it later?)
12:37
<ryzokuken πŸ‡³πŸ‡΄>
no JS in Whatsapp please
12:37
<danielrosenwasser>
JavaScript doesn't have threads
12:38
<ryzokuken πŸ‡³πŸ‡΄>
does Threads have JS tho?
12:38
<ryzokuken πŸ‡³πŸ‡΄>
sorry, I'll show myself out
12:38
<nicolo-ribaudo>
(like, what do you think you want to do with the thing you get from this phase, if not to instantiate it later?)
Well, with WebAssembly.Module you might do reflection and nothing else
12:38
<danielrosenwasser>
Probably only in Hermes' bytecode format nowadays
12:38
<nicolo-ribaudo>
But yes, you would almost always want to instantiate it
12:38
<shu>
i don't get what that means, you just want to hold on to it?
12:38
<Michael Ficarra>
I think ljharb is saying the opposite?
12:38
<ryzokuken πŸ‡³πŸ‡΄>
HHVM for JS
12:39
<nicolo-ribaudo>
WebAssembly.Module.imports() or .exports()
12:39
<Ashley Claymore>
https://nodejs.org/api/worker_threads.html#workerismainthread
12:39
<Michael Ficarra>
as it gets support in languages targeting wasm, using it manually becomes more niche
12:39
<Ashley Claymore>
how can their be a main thread if there are no threads......
12:39
<ryzokuken πŸ‡³πŸ‡΄>
it's part of the host, not JS
12:39
<Ashley Claymore>
:D
12:39
<danielrosenwasser>
import reflectable
12:39
<ryzokuken πŸ‡³πŸ‡΄>
πŸ™ˆ
12:39
<ryzokuken πŸ‡³πŸ‡΄>
I'm bad at jokes
12:40
<Andreu Botella>
import sourceable
12:40
<danielrosenwasser>
No, you're doing good here by backing my joke ryzokuken πŸ‡³πŸ‡΄ ,
12:40
<danielrosenwasser>
import saucable
12:40
<danielrosenwasser>
oh no
12:40
<danielrosenwasser>
import sauceable?
12:40
<ryzokuken πŸ‡³πŸ‡΄>
I think I'm old enough to start writing my own jokes eventually
12:40
<eemeli>
import raw
12:41
<Bradford Smith>
import uninstantiated?
12:41
<Michael Ficarra>
this is not TDZ
12:41
<Andreu Botella>
import saukable
12:41
<shu>
uninstantiated is fine but how is that worse than instantiable?
12:41
<ljharb>
i would argue that usage of "not JS" to interoperate directly with JS is still a power user thing, and will likely remain so for the foreseeable future
12:41
<ryzokuken πŸ‡³πŸ‡΄>
import raw
that could work actually
12:41
<bakkot>
"uninstantiated" is at least a word I have literally ever used before
12:41
<ljharb>
a word can be more precise and yet worse ergonomically
12:41
<bakkot>
"raw" sounds more like asset/blob/bytes to me
12:41
<danielrosenwasser>
But how often is this word getting typed out?
12:41
<Bradford Smith>
An "uninstantiated module" makes sense to me more than "instantiable module"
12:42
<ljharb>
But how often is this word getting typed out?
hopefully often enough to warrant this proposal advancing
12:45
<bakkot>
I think for JS developers, yes
12:45
<ljharb>
what are the "phases" identified for modules during this process? like what comes after "source"
12:45
<bakkot>
but if you are a Go programmer, you are going to want to write Go, and then a small JS wrapper to let the Go program interact with the webapp
12:45
<shu>
raw is worse than source for the same confusion, yeah
12:45
<bakkot>
and the way you do that is, you compile the Go to wasm, and then import the wasm from a JS module
12:45
<littledan>
honestly import compiled captures things well for Wasm (or import parsed??), but I'm not sure if it will be intuitive.
12:45
<bakkot>
this does not require being a poweruser of either language
12:46
<danielrosenwasser>
I was going to make a String.raw joke but Michael Ficarra said this wasn't TDZ
12:46
<Andreu Botella>
I guess some people might think that import compiled AOT-compiles the module code for JS?
12:47
<bakkot>
do we imagine using this for things other than wasm
12:47
<Michael Ficarra>
no one is stopping you from making terrible jokes in TDZ
12:47
<bakkot>
if not, can we just make it import.wasm
12:47
<danielrosenwasser>
My impression is that the anticipated frequency of use is not the reason why this proposal exists - moreso, it's a small set of important use-cases that compose well
12:47
<nicolo-ribaudo>
do we imagine using this for things other than wasm
KKL has a proposal for JS sources
12:47
<nicolo-ribaudo>
To do reflection on them, as well as custom linking
12:48
<bakkot>
ah, right
12:48
<bakkot>
and to avoid running afoul of CSP I guess
12:48
<danielrosenwasser>
Which is why "pick the most explicit name" seems like the right option for me, even if it's a little verbose
12:48
<nicolo-ribaudo>
Yep, to avoid eval-like
12:49
<danielrosenwasser>
But import source is still better than import module
12:49
<bakkot>
that suggests maybe import.reflect?
12:49
<Michael Ficarra>
please, source is fine 😩
12:49
<bakkot>
though I guess reflection might suggest also evaluation
12:50
<nicolo-ribaudo>
that suggests maybe import.reflect?
I think this was the original world in the proposal, but there are two use cases (custom instantiation and reflection) and it only covers one
12:50
<Rob Palmer>
import fetched
12:50
<bakkot>
fetched also suggests just raw bytes to me
12:50
<shu>
maybe the answer is there is just no intuition for half-processed things having names
12:51
<Rob Palmer>
import parsed
12:51
<nicolo-ribaudo>
maybe the answer is there is just no intuition for half-processed things having names
import half mod from "x"
12:51
<shu>
parsed i can live with but wasm isn't parsed but validated?
12:51
<bakkot>
validation is like parsing
12:51
<nicolo-ribaudo>
analyzed
12:51
<shu>
yeah
12:51
<shu>
parsed sgtm
12:52
<shu>
who hates parsed
12:52
<shu>
who hates the truth
12:52
<bakkot>
I could live with parsed
12:52
<nicolo-ribaudo>
What I dislike about it is that also a fully evaluated module has been parsed
12:52
<Michael Ficarra>
yeah but it's "only" parsed
12:52
<bakkot>
a fully evaluated module has also been source though
12:52
<shu>
yeah, pragmatics!!
12:53
<shu>
implicatures, specifically
12:53
<bakkot>
love me a gricean implicature
12:54
<Jesse (TC39)>
ooh grice fans
12:54
<Chris de Almeida>
we do have some time available tomorrow if folks would like to have further discussion regarding source phase imports naming
12:55
<Jesse (TC39)>
the Racket programming language uses "syntax" to refer to data that has been parsed -- ranging from simple expressions like 42 to entire modules -- but not yet evaluated
12:56
<shu>
that's in the context of macros
12:56
<shu>
in that there's a unified representation they manipulate
12:56
<shu>
whereas the thing we're getting is just kinda abstract
12:56
<Chris de Almeida>
import sauceable?
I would unironically support sauce
12:57
<Andreu Botella>
import abstract mod from "paper.js";
12:57
<bakkot>
I would unironically support sauce
that would be so confusing as an english language learner
12:57
<Chris de Almeida>
fair
12:57
<bakkot>
we do have some time available tomorrow if folks would like to have further discussion regarding source phase imports naming
maybe come back and see if import parsed is amenable to everyone?
12:59
<bakkot>
parsed i can live with but wasm isn't parsed but validated?
also since it gives you a different representation than the input I think it is in fact parsed rather than validated?
12:59
<shu>
bakkot: okay i'm convinced
12:59
<bakkot>
at least according to the taxonomy of https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
12:59
<shu>
also just polled internally
12:59
<shu>
V8 can live with parsed
13:00
<bakkot>
how did you conduct a representative sample poll at 6am
13:00
<bakkot>
I guess v8 is mostly in munich, nvm
13:01
<Christian Ulbrich>
TCQ pretty rough... -> https://github.com/ChristianUlbrich/tcq/tree/contemporary-edition I split into three packages and decided that it is not worthwhile to get the old stuff to working, so I am just porting the client to contemporary Vue...
13:02
<Christian Ulbrich>
Hope I have the client ported by the end of the day, what I am seeing is "special" to say the least, bust one step at a time...
13:05
<Chris de Almeida>
sorcery!
13:06
<Chris de Almeida>
maybe come back and see if import parsed is amenable to everyone?
guybedford: Luca Casonato some folks here signaling it may be useful to spend some time tomorrow. thoughts?
13:06
<eemeli>
If we change to something else from import source, should/will the "module source" references in the proposal also be updated?
13:08
<ljharb>
probably yes
13:08
<Jesse (TC39)>
ChatGPT ought to be able to suggest some terms
13:14
<shu>
eemeli: IMO that's not important at all
13:14
<shu>
it's not going to be an uttered name really
13:15
<ljharb>
when the proposal for JS ModuleSource objects arrives, that part will be
13:15
<eemeli>
shu: Not sure that I agree. We still need a generic name for the thing you get from this statement.
13:16
<shu>
sure, you need a name, but it's not a thing that developers are going to be typing, so i think any name is fine, really
13:16
<shu>
once the JS module thing itself exists, that might be typed, and we should be more careful about that
13:40
<Luca Casonato>
https://github.com/tc39/proposal-source-phase-imports/issues/53
13:41
<yulia | Back in October>
<still on leave, may not be able to actually answer here later> I wouldn't say it isn't viable, thats maybe too broad. a web code base can be entirely rewritten just for performance gains, at the cost of developing new features etc. But what we have found is that the rewriting of applications is unrealistic, and this stops people from moving to modules all together. In addition, this doesn't work so well when we consider non-web js applications that share modules with web applications, such as a good portion of the FX codebase, where we cannot use loading techniques such as module-preload
13:42
<littledan>
whoa Yulia is here! I just want to take this opportunity to thank you for organizing the meeting here in Bergen. It's a beautiful city and great to meet this very relevant and insightful academic research group.
13:42
<yulia | Back in October>
oh that is lovely to hear! i hope we can work more with the community there, they are very excited about tc39
13:43
<littledan>
oh that is lovely to hear! i hope we can work more with the community there, they are very excited about tc39
Yes, I hope so too. Talking to them, I think they didn't realize that they were actual TC39 members and can participate as delegates if they want, not just observe. I think there's a big opportunity for collaboration
13:43
<ryzokuken πŸ‡³πŸ‡΄>
I talked about some folks from the uni about this earlier
13:44
<yulia | Back in October>
Mikhail Barash is really great to work with, I've really enjoyed collaborating with the students at Bergen. Would love to join myself next year if we can do a plenary there again.
13:44
<yulia | Back in October>
my overlord is calling, i have to run.
13:44
<ryzokuken πŸ‡³πŸ‡΄>
Hoping we can improve our relationships with all of our researcher colleagues and utilize academic techniques to analyze proposals in addition to everything we do now
13:44
<yulia | Back in October>
enjoy the plenary everyone!
13:50
<Michael Ficarra>
apparently NTSC framerate is defined as a ratio as well
13:51
<Andreu Botella>
We should push for a version of BigDecimal where 0.99999... != 1
13:58
<shu>
ugh the web zoom client like pauses the video if i background the tab i think
13:58
<shu>
and it can't recover
13:58
<ryzokuken πŸ‡³πŸ‡΄>
the web zoom client is terrible
13:58
<shu>
this wasn't happening as much yesterday
13:58
<ryzokuken πŸ‡³πŸ‡΄>
but the app doesn't work on my computer either πŸ˜…
13:59
<shu>
well i can't install it per corp policy...
14:00
<ljharb>
does corp policy let you use parallels? you could have a mac in your mac and install zoom on the guest mac
14:00
<shu>
do i want to install parallels
14:01
<ryzokuken πŸ‡³πŸ‡΄>
(I know this is an unproductive discussion, sorry)
14:06
<Michael Ficarra>
dminor: they are talking about our proposed normalisation and omission of Infinity/NaN
14:07
<littledan>
but it's Waldemar who wants normalization...
14:07
<littledan>
I think the coercion with numbers is just an error
14:07
<ryzokuken πŸ‡³πŸ‡΄>
IEEE standards are paywalled?
14:07
<Michael Ficarra>
I am skeptical about the perf claims, there mostly isn't hardware acceleration for Decimal128 yet
14:07
<dminor>
Ok, so is this IEEE 754 decimal128 or not?
14:07
<Michael Ficarra>
so no matter what, you're implementing it using integer maths
14:08
<Michael Ficarra>
mostly
14:09
<ryzokuken πŸ‡³πŸ‡΄>
but these implementations could improve perf over time as hardware acceleration crops up
14:10
<littledan>
dminor: Yes, the idea is that we'd use IEEE Decimal128
14:10
<Chris de Almeida>
IEEE standards are paywalled?
yes... are you looking for something? <laughs in hidden>
14:12
<Michael Ficarra>
where did it say that decimals have object identity?
14:13
<shu>
it doesn't have operator overloading
14:13
<nicolo-ribaudo>
I thought the operator overloading discussion was about math operators
14:14
<shu>
=== is an operator
14:14
<nicolo-ribaudo>
Yeah for some reason I never realized it was part of that discussion
14:14
<ljharb>
oh oof, it wouldn't be a primitive?
14:14
<shu>
nope
14:14
<ljharb>
i don't see any point in doing a number system if it's not a primitive
14:15
<Michael Ficarra>
defining behaviour for === does not mean operator overloading
14:15
<Michael Ficarra>
operator overloading means deferring to some user code, no?
14:15
<chipmorningstar>
What about +?
14:15
<shu>
in this context it means overloading existing syntax operators
14:15
<Chris de Almeida>
It's dangerous to go alone! Take this.
14:15
<shu>
not necessarily user code
14:16
<Michael Ficarra>
defining behaviour for maths operators does not mean operator overloading
14:16
<ljharb>
i also understand the term "operator overloading" to mean for user code
14:16
<shu>
the constraint from engines is we don't want to add new paths to operators
14:16
<shu>
what phrase should be used for that constraint?
14:16
<Rob Palmer>
"builtin operator overloading"
14:16
<ljharb>
that position effectively kills a bunch of useful proposals, including decimal, imo
14:16
<shu>
where operator includes all operators, + and === etc
14:16
<Michael Ficarra>
shu: no new primitives
14:16
<rbuckton>
there's a distinction between user-defined operator overloading and the fact that JS operators are overloaded. Currently they are overloaded based on type and coercion (i.e., string, number, bigint)
14:17
<ljharb>
if "no new primitives" is the stance from engines i'd love to see some kind of public statement to that effect
14:17
<ljharb>
because we need something to point the massive mob of angry JS devs to
14:17
<shu>
it's no new primitives unless vastly compelling
14:17
<Michael Ficarra>
then decimal is dead in the water
14:17
<shu>
if you publicize it it will be taken outside of context as a standalone fiat
14:18
<ljharb>
i don't understand how R&T and Decimal aren't both vastly compelling - if neither of those hit the bar then that's the same as "no new primitives" imo
14:18
<shu>
you and i disagree
14:18
<rbuckton>
My understanding is that the position of implementers regarding "no new primitives" is due to implementation complexity, not whether they would fit within the spec itself?
14:19
<shu>
it's complexity and performance in the engine itself, yes
14:19
<ljharb>
you and i disagree
that's fine, but i think it's important to get a sense from the wider JS community about this sort of thing
14:19
<Michael Ficarra>
we may as well pack up and go home, language is done folks
14:19
<ryzokuken πŸ‡³πŸ‡΄>
"vastly compelling" always subjective. There's almost no public JS event I've been to where nobody was lamenting IEEE doubles.
14:20
<rbuckton>
"vastly compelling" always subjective. There's almost no public JS event I've been to where nobody was lamenting IEEE doubles.
Hard to parse double negatives...do you mean to say "every public JS event I've been to there was always someone lamenting IEEE doubles"? or that no one is complaining about it?
14:20
<ryzokuken πŸ‡³πŸ‡΄>
sorry, yes
14:21
<ryzokuken πŸ‡³πŸ‡΄>
I meant that I'm almost bored of hearing people criticize how we do Numbers
14:21
<Rob Palmer>
I'm assuming @ljharb is wondering how we can surface data for cases where significant developer demand exists, such that it would justify implementation burden that would otherwise be intolerable. I don't think he is encouraging mass pile-ons and pitchforks.
14:21
<ljharb>
exactly that
14:21
<ljharb>
but also, there WILL be massive pileons and pitchforks if we hide the actual position of browsers behind TC39 notes
14:21
<shu>
we literally do not know how to get high-quality signal for web developers, the closest we come is scaled surveys
14:22
<ryzokuken πŸ‡³πŸ‡΄>
I think the priority of constituencies is a reasonable solution
14:22
<Michael Ficarra>
well maybe a couple of pitchforks
14:22
<ljharb>
make a joint public statement from browsers saying decimals and R&T are effectively dead because "no new primitives" and why, and i suspect you will quickly get signal from web developers. whether it's high-quality is ofc another matter.
14:22
<Christian Ulbrich>
What amount of developer demand would convince an implementor, that an implementation is worth the burden?
14:23
<ljharb>
i would hope that's something an implementor feels obligated to answer
14:23
<Michael Ficarra>
even if we go by V8's statement yesterday about encouraging features that will make better user experiences, decimal is incredibly justified because web users will have better experiences when they get correct numeric results!
14:27
<shu>
What amount of developer demand would convince an implementor, that an implementation is worth the burden?
as i said yesterday, developer demand is not convincing in itself, but in a larger context it could add color. for example, if a proposal does not pose significant complexity (which is really about security) concerns, then developer demand tips the scale for me and V8 to support
14:27
<Bradford Smith>
"Do it in the backend" doesn't help if the backend is Node.js
14:27
<rbuckton>
This statement presupposes that "the backend" is not NodeJS and "the frontend" is not Electron
14:29
<Bradford Smith>
I may have missed this: Did the presentation include pointers to one or more known-good userland libraries for this?
14:30
<Michael Ficarra>
Bradford Smith: yes, the champion made one himself
14:30
<Michael Ficarra>
and linked to it from the slides
14:30
<dminor>
I don't question that this would be useful in node.js, but that doesn't convince me that this needs to baked into the language.
14:30
<Rob Palmer>
We have a huge amount of financial processing happening on the client-side. Common untransformed data is multi-cast to many users with low-latency. Lots of per-client per-window per-widget customized calculations happens on the client side.
14:32
<Bradford Smith>
I'm not talking about a playground for the current proposal. I'm talking about a library used currently by applications to handle Decimal use-cases.
14:32
<Christian Ulbrich>
As I have stated before, we were using -> https://mikemcl.github.io/decimal.js/ - I do not care about IEEEEEE4673838 as a developer, I just want something that worksβ„’, preferably from my good olde JS engine! :)
14:33
<littledan>
JS itself even has decimal processing on the client side (in Intl.NumberFormat, on strings when rounding options are used)
14:33
<ptomato (at TC39, limited availability)>
there's also http://mikemcl.github.io/big.js/ from the same author
14:33
<Bradford Smith>
OK, I see Christian's link
14:34
<ryzokuken πŸ‡³πŸ‡΄>
As I have stated before, we were using -> https://mikemcl.github.io/decimal.js/ - I do not care about IEEEEEE4673838 as a developer, I just want something that worksβ„’, preferably from my good olde JS engine! :)
while I empathize with the calls to stick to IEEE at all costs (and I believe we will), I'm afraid this view is representative of a majority of JS developers
14:34
<littledan>
I just don't understand the details of the claim that this proposal deviates from IEEE 754 decimal. I'd like to follow up on those in a more concrete way. The intention is to use IEEE 754.
14:35
<shu>
if we're going by developer anecdotes, i'd wager majority of js developers also just do not care about JS semantics either
14:35
<ryzokuken πŸ‡³πŸ‡΄>
fair, but the point I'm trying to make is that there's a strong signal that this is really popular among users
14:37
<Michael Ficarra>
devs are going to think we're incompetent and out of touch if we tell them decimals are not sufficiently justified
14:37
<littledan>
https://github.com/whatwg/html/pull/9486
14:37
<shu>
Michael Ficarra: specifically do you mean "decimals as primitives"
14:38
<ljharb>
decimals you can use === and other basic operators with
14:38
<Michael Ficarra>
if we have decimals as non-primitives, they will just think they're clunky
14:38
<ljharb>
most JS devs won't care or necessarily know about primitives vs objects but they will care about all the things "being primitives" lets them do
14:39
<ljharb>
and without being primitives, what's the value over just using a library - "i don't have to install it" imo is far far weaker than "it's more ergonomic"
14:39
<shu>
so is that "yes" to my question?
14:39
<Michael Ficarra>
ljharb: literal syntax
14:40
<Michael Ficarra>
shu: no, I think they will have different, but still negative, feelings about us
14:40
<Christian Ulbrich>
@shu I think so, they need to be first-class citizen, i.e. Primitives, with everything that entails, I am afraid.
14:41
<shu>
our position stands, and i've articulated as our not being convinced against the complexity (security) and performance tradeoffs
14:41
<ljharb>
and what i asked/suggested was that that position be stated somewhere publicly, outside of tc39, so it can be cited when making proposal decisions (for the benefit of the wider JS dev community)
14:42
<rbuckton>
I mean, how useful would it be to have actual integer primitives like int8 , int16, int32, uint32, etc. with proper overflow checking? Current approaches to constrain values to a specific integer space are often complex, such that we end up needing to add static methods to Math for proper integer division because all we have is Number.
14:42
<shu>
i am not a PR person, i am a standards person
14:43
<ljharb>
there is considerable overlap there, i suspect
14:43
<shu>
not for me
14:43
<ljharb>
i would hope for v8/chrome, though?
14:43
<shu>
to explain our standards positions to the general public? no
14:43
<ljharb>
wow, ok
14:43
<shu>
to explain our standards positions to stakeholders? yes
14:43
<ljharb>
that's surprising
14:43
<ljharb>
the general public are all stakeholders.
14:43
<ptomato (at TC39, limited availability)>
and without being primitives, what's the value over just using a library - "i don't have to install it" imo is far far weaker than "it's more ergonomic"
I agree with your position on Decimal pretty much, but I do think "I don't have to install it" is a huge motivation for serving the majority of the world's population that accesses websites on an unstable or metered internet connection
14:45
<Michael Ficarra>
true, it is justified for many reasons
14:52
<shu>
to be clear i don't mean that we wish to make standards positions private, i mean that i don't consider it my job to publicize
14:52
<shu>
like, twitter threads, blog posts, whatever
14:53
<shu>
dminor: are you contributing to irregexp?
14:53
<Chris de Almeida>
Jesse (TC39): do you want to have a continuation for Decimal tomorrow? if so, how long?
14:54
<nicolo-ribaudo>
irregexp seems like something cool to eventually learn how to contribute to
14:55
<shu>
please do!
14:57
<Jesse (TC39)>
Jesse (TC39): do you want to have a continuation for Decimal tomorrow? if so, how long?
sure, how about 20 minutes?
14:58
<shu>
FYI if you schedule it in the morning, i will not be able to attend
14:59
<Chris de Almeida>
shu: we can add to afternoon
15:04
<Chris de Almeida>
decimal queue capture is now in the notes
15:13
<Andreu Botella>
There is precedent in that /test/ === /test/ is false, but yeah, it is weird
15:17
<Christian Ulbrich>
There are other things, with NaN === NaN only being the most prominent one, but [] === []... are also not equal :) As are Dates...
15:20
<ljharb>
It’s not that syntax always means triple equals, but that the oddities are known and minimal and shouldn’t be increased.
15:34
<shu>
interesting point about regexps having creation syntax but have Object semantics
15:35
<shu>
but numeric literals having Object semantics feels it is unprecedented in all of PL. would be fascinating to see an exception
15:42
<Jesse (TC39)>
Re: the Decimal proposal, do I understand right that as currently proposed 1.0m === 1.0m would be false, yes? That's... weird.
indeed -- it's a bullet one would bite if you accept the "no overloading" approach. I'm happy to discuss whether we should make an exception for ===
15:43
<Jesse (TC39)>
i.e., make === be numerical equality when both lhs and rhs are Decimals
15:44
<nicolo-ribaudo>
but numeric literals having Object semantics feels it is unprecedented in all of PL. would be fascinating to see an exception
I would rather not use JS as the language for "nobody does this so let's try to see how weird it will be!"
15:52
<shu>
me neither?
15:52
<shu>
that was not a "would be fascinating for JS to do this as an exception", that was a "it would be fascinating to see prior art, i don't believe it exists"
15:55
<shu>
i.e., make === be numerical equality when both lhs and rhs are Decimals
i would not support this
15:57
<Jesse (TC39)>
i would not support this
understood -- the "no overloading" philosophy (which I still stand by) tries to respect that
16:00
<Jesse (TC39)>
in C# (a language that has decimals natively), you use a cmp function (returns -1, 0, or 1), which is also what I have in my current proposal. No ===
16:01
<rbuckton>
in C# (a language that has decimals natively), you use a cmp function (returns -1, 0, or 1), which is also what I have in my current proposal. No ===
C# has operator overloading that covers == and other operators
16:01
<Jesse (TC39)>
ah ok, thanks, didn't know πŸ‘οΈ
16:05
<rbuckton>
In C#, almost all primitives (except string) are "value types" that are essentially defined as structs, and all operations on these types flows through operator overloading. Since C# is a typed language, it determines which static operator method to bind at compile time so that the runtime cost is negligible, though for a number of built in operations those can also generate native code that is faster than the overload method.
16:07
<rbuckton>
for example: https://learn.microsoft.com/en-us/dotnet/api/system.decimal?view=net-7.0
16:08
<Jesse (TC39)>
heh love the PiggyBank class
16:13
<rbuckton>

We had a number of discussions about user-defined operator overloading a few years back. The thought at the time was that you would need to have some kind of syntactic opt-in to inform the runtime that it should consider operator overloads. The upside being that existing code wouldn't be effected by the cost associated with operator overloads, the downside being that it would be fairly easy to forget to include the syntax, especially if you are working with a value that is returned from a function defined in a different module.

It was something like with operators from Foo; to opt into using operators defined on the constructor Foo.

16:16
<rbuckton>
I'd hoped that we could tie operator overloading to something like struct, such that an implementation might have an easy way to recognize whether to even consider an overloaded operator (so it doesn't need to consider operator overloads for all other types), but that doesn't look to be viable with the direction we're going.
16:18
<rbuckton>
Alternatively, something similar we could use to tag an instance as opting-in to operator overloads like a value class C {} or something to that effect.