2019-03-01 [15:27:58.0000] was the main issue with do expressions the completion values of statements [15:42:20.0000] I think so, yeah. [15:42:25.0000] Specifically loops and similar stuff. [15:42:44.0000] And likely wanting to expose the same things as eval() does, which is... often not very useful. 2019-03-03 [12:31:31.0000] i think there may be a bug in the spec of PropertyDefinitionEvaluation [12:31:37.0000] or ClassDefinitionEvaluation [12:32:26.0000] can anyone verify that the calls to PropertyDefinitionEvaluation in 22.a.i and 22.b.i aren't covered by any definitions of PropertyDefinitionEvaluation [12:33:41.0000] well 22.a.i may be covered but it doesn't seem that 22.b.i is [12:37:44.0000] it also seems like testing the toString of a static method isn't tested [12:38:40.0000] You're asking whether PDE is defined for every possible ClassElement m? [12:38:47.0000] yes [12:38:53.0000] i think it's missing `static MethodDefinition` [12:39:34.0000] that would just chain to MethodDefinition [12:39:48.0000] interesting [12:39:58.0000] ok so part 2 [12:40:08.0000] my engine has been including `static` in the toString [12:40:16.0000] while also passing test262 [12:40:25.0000] is this an indication that test262 is missing something [12:41:32.0000] sounds like it, but don't know. 2019-03-06 [15:57:53.0000] Domenic / etc: if `import()` could land now by putting it Annex B for the moment, or putting a "this section is normative optional on it or something, would that be something you'd consider acceptable? [15:58:30.0000] I agre this would be super dumb, but it seems like it is better than the current state, which is also super dumb, and erights suggested this would be acceptable to him in https://github.com/tc39/proposal-dynamic-import/issues/26#issuecomment-392280836 [15:59:48.0000] I don't really care. 2019-03-07 [16:02:28.0000] cool, that's what I figured. [04:59:47.0000] ljharb: https://github.com/web-platform-tests/wpt/pull/15720 might be of interest [05:48:21.0000] Hello all. Would this be a good place to see if there's any interest in a new language feature? I've already searched ESDiscuss and couldn't find any real discussion on it, though it was touched upon. [06:24:17.0000] superamadeus3: It's an appropriate place. Whether it's a *good* (i.e., useful) place varies over time, I'd say. [06:29:12.0000] Well, I'll take my chances! The proposal is for a "try expression" which allows for imperative error handling patterns similar to how it's typically done in Go. While I came up with the semantics organically, it resembles a discussion I found on ESDiscuss from 3 years ago (specifically this post: https://esdiscuss.org/topic/just-try#content-4). [06:30:03.0000] Here's a github gist with my attempt at an overview of it's behavior: https://gist.github.com/superamadeus/e81c0524d6991c6977cb4ab34b82321a . I apologize ahead of time if this has been proposed before, as it seems like it shouldn't be that novel of an idea. [09:05:41.0000] annevk: thanks [09:06:35.0000] superamadeus3: can you add some examples that don’t use await? [09:06:59.0000] i don't understand this example [09:07:07.0000] or what this is doing in general [09:07:24.0000] oh wait i see now [09:07:30.0000] it's an approximation of how go returns errors [10:19:20.0000] Hey, [10:19:28.0000] I updated the gist to show examples without await. [10:21:38.0000] Here's the link again for convenience https://gist.github.com/superamadeus/e81c0524d6991c6977cb4ab34b82321a [10:27:35.0000] Yes, the goal of the proposal is to resemble this error handling pattern. It essentially wraps any expression into a result type `Result = [TValue, undefined] | [undefined, TError]`. [10:28:19.0000] Also, sorry if this is spammy. I'm not totally used to IRC. If there's a better place for this discussion I would be happy to move it/set it up! [10:29:47.0000] superamadeus3: i think we’d first need a Result before we’d want to add syntax to produce it [10:34:15.0000] ^ [10:34:56.0000] ljharb: For sure. Would that have to be a separate proposal, or could it be part of the same one? [10:35:06.0000] I’d think separate [10:35:15.0000] syntax is expensive, and a hard hill to walk up [10:42:13.0000] Cool, thanks. [10:45:19.0000] What might the next steps be if I want to work on this? Make a repo for the proposals and work on documentation and a spec for it and hope the community takes interest? [10:46:41.0000] (Not to simplify the work that must go into it) [10:53:07.0000] you might consider checking with the Promise.allSettled champions if they'd consider using a more general result type [10:54:01.0000] the thing they're currently returning refers to promises in particular, but if there were a pattern for Result in JS, they could use that instead. [10:54:18.0000] ("checking with" = opening an issue on https://github.com/tc39/proposal-promise-allSettled ) [10:57:55.0000] but more generally, I don't know that this would be worth it, especially if we end up with syntax for statements in expression position more generally - you could just write `let [user, err] = do { try { [foo()] } catch (e) { [void 0, e] } }` instead of `let [user, err] = try foo()` [11:18:28.0000] Bakkot: thanks for the lead! I'll check out that proposal. And hm, that's valid! I think it's worth exploring at least academically, or even if it just ends up being a babel plugin that I use myself :) 2019-03-08 [10:24:57.0000] `var √ = Math.sqrt;` being a syntax error makes JS literally unusable. [10:28:41.0000] at-mathias time to extend the identifier syntax [10:32:54.0000] TabAtkins: we [10:33:09.0000] TabAtkins: we've already tried to make Math.TAU a thing too :-/ [10:34:23.0000] what can i do to make Math.TAU a reality [10:35:24.0000] it seemed like some delegates were too afraid of being first-movers on "actually making math awesome" [10:35:40.0000] so getting it shipped as a constant in other languages would help :-p [10:37:02.0000] lol [10:37:22.0000] srsly tho, https://tauday.com/tau-manifesto [10:39:16.0000] greetings TC39 members :) I have a proposal that I am looking to get shepherded in. I am fairly new to the process but have read through the proposal documentation. You can find my suggestion here: https://www.npmjs.com/package/dry-forloop [10:39:54.0000] Thank you to anyone who can assist me with the process. This is super exciting! [10:41:31.0000] michaelboegner: can you provide some more information on what this is trying to solve, etc [10:44:07.0000] sure, so I see a couple use cases: 1. It provides a simple, easy to understand reduction of the traditional forLoop without anything other than what you would expect to find in said loop, i.e. no extra bells and whistles, it's still a forLoop, just as dry as possible [10:44:58.0000] well the existing forEach is "just a for loop" [10:45:10.0000] i'm confused about what adding all this extra stuff is doing [10:45:28.0000] 2. You could argue at this point, hey, but I've got forEach. That basically does the same thing, right? I would say, no, in that you cannot manipulate the start, operator, length and iterator traditionally found in a forLoop using a forEach. This means that you can do things like nesting and manipulation of iteration that forEach doesn't provide, I don't believe at least. [10:45:59.0000] ```array.forDry((e) => { array.forDry((f) => { solution.push(e + f) }, 1) }); console.log(solution); Expected return: [ 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 7, 8, 9, 10 ]``` [10:46:19.0000] right but what's the use case for manipulating all those things [10:47:06.0000] The alternative is nesting two forLoops, which means writing a much wetter code [10:47:30.0000] alternatively [10:47:38.0000] i'm not sure what that code does [10:48:00.0000] does it skip the first element? [10:48:36.0000] it's equivalent to a nested forLoop with the iterating variable starting at 1 [10:48:56.0000] like `array.forEach((e) => array.slice(1).forEach((f) => { solutions.push(e + f); }))` [10:49:05.0000] sorry, i thought i indluced the array [10:49:21.0000] so those are equiv [10:49:28.0000] but the one i posted seems much clearer [10:49:42.0000] michaelboegner: your proposal should maybe show a couple examples of what the equivalent code would be with current JS [10:49:57.0000] well you should write up a proposal [10:50:10.0000] so yeah, so the instructions just say to come here and talk to you [10:50:16.0000] so that's what i'm doing [10:50:24.0000] What should a proposal look like? [10:51:08.0000] nevermind, i found one in github [10:51:10.0000] at a minimum: what is the problem, why does the problem matter, some possible solutions to the problem [10:51:19.0000] I appreciate everyone's time [10:51:31.0000] yeah we're also working on making it easier for new people to get involved [10:52:47.0000] cool, thanks again for taking a second to talk it out with me [10:53:30.0000] michaelboegner: it'd help to document prior art - showing where this pattern is so common in JS or other languages that it warrants being in the language instead of in userland [10:54:09.0000] michaelboegner: also to make a case for why this is cleaner than, say, using forEach and checking the index, or using flatMap and returning `[]` [10:54:44.0000] awesome. Will do for sure [10:56:30.0000] (also i hope your npm package doesn’t actually modify Array.prototype; that can be very dangerous and has interfered with other proposals in the past) [12:32:40.0000] Personally, these modifications to start/end belong in functions that return modified arrays themselves (or rather, iterators over the array). Traditional for-loops are terrible UX-wise in the first place, but they're so ubiquitous people learn how they work anyway; scattering the same functionality over a handful of arguments makes the readability much worse. [12:33:21.0000] So like `array.forEach(e=>drop(1, array).forEach(f=>solution.push(e+f)))` [13:13:10.0000] TabAtkins: +1 2019-03-09 [21:32:59.0000] is the order taken as meaningful in text like this? [21:33:00.0000] https://tc39.github.io/ecma262/#sec-primary-expression-regular-expression-literals-static-semantics-early-errors [21:33:00.0000] (i.e. do we consider *which* early error gets prioritized in `/+/gg` to be specified?) [21:35:47.0000] I'm assuming not, because V8 and SM both complain about the flags first, and the reason I'm even asking is because I'm playing the video game called "JSC early error whac-a-mole" [21:36:29.0000] (it's easily as fun as a Zachtronics title 😂) [21:59:27.0000] rkirsling, I would say no, since it does not define semantics differentiating between those two early errors [22:00:22.0000] Bakkot: hmm. I'd ask for a counterexample but then I kind of doubt one exists? [22:01:04.0000] since I suppose one might view it as needlessly specific [22:01:49.0000] there is a bit of an edge case related to this: `0++` is, for some reason, an early Reference Error rather than a Syntax Error, so I am not sure what `try { eval('0++; /r/gg;'); } catch (e) { console.log(e.name); }` should print [22:02:26.0000] interesting [22:02:48.0000] it's like a static race condition lol [22:05:20.0000] in trying to determine if this is specified I have not yet been able to find an answer, but I did learn that `eval` acts as identity for anything which is not of Type string [22:05:34.0000] i.e. `x = {}; eval(x) === x` is true [22:07:40.0000] huh. fair enough. [22:58:56.0000] anyone have any suggestions for how to most cleanly handle this? https://github.com/tc39/ecma262/pull/702#discussion_r263966562 [04:25:49.0000] rkirsling: ParseScript() and ParseModule() both say: "If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-dependent, but at least one must be present." [04:31:44.0000] Which I think answers your question [07:52:48.0000] i don't think any implementations report more than one error [07:53:55.0000] this is interesting though https://gc.gy/19851876.png [09:26:41.0000] jmdyck: I wonder if the semantics for PerformEval and/or CreateDynamicFunction should be updated with similar wording - currently they just say "if any early errors are detected, throw a SyntaxError or a ReferenceError exception, depending on the type of the exception", which is a little ambiguous because it refers to "the" exception but there can be more than one. [10:20:02.0000] Bakkot: yup. And it might be nice to factor out the commonalities, but I think that might be tough. [11:46:57.0000] jmdyck: cool, thanks! [11:47:19.0000] devsnek: also note that the JSC/Ch ReferenceErrors are late ones [12:53:03.0000] rkirsling: as in they don't throw on invalid regex? [12:54:59.0000] devsnek: the right type of error is thrown for `0++` and for `/r/gg` but they're thrown at runtime [12:55:02.0000] I just put up a fix for early invalid flags: https://bugs.webkit.org/show_bug.cgi?id=195514 [12:55:32.0000] introducing the notion of early ReferenceError at all is still a todo item [12:55:58.0000] that's weird [12:57:44.0000] yeah the "late SyntaxError" there is surprising [12:58:16.0000] but my understanding is that "early ReferenceError" is a comparatively new concept [12:58:44.0000] 'twill be fun to address, I expect [13:02:54.0000] oh whoa but SM's SyntaxError there is actually for `0++` [13:03:14.0000] so that too is a bug [14:45:02.0000] rkirsling: looks like chakra is an early ReferenceError [14:46:46.0000] devsnek: hmm...so it is. I thought they didn't have that notion either though 🤔 guess either I was mistaken or it changed recently [14:47:15.0000] 0++ is all over the place though https://gc.gy/19876609.png [14:47:32.0000] engine262 uses acorn which considers all early errors syntax errors :( 2019-03-10 [18:05:21.0000] Bakkot: hah, I hadn't noticed that you're literally in the midst of refactoring that text (https://github.com/tc39/ecma262/pull/1464) [19:21:51.0000] tbh I don't think "early ReferenceError" ought to be a concept in the spec [19:22:17.0000] just throw a SyntaxError [19:26:22.0000] interesting [19:26:41.0000] Bakkot: is that a reversible decision? [19:28:30.0000] rkirsling: depends on whether anyone is depending on it. But we have generally said (and found) that _removing_ an error which is only observable to correct programs via `eval` (or equivalents) is not problematic, since that happens whenever we add new syntax, so I would guess that changing the type of such an error would likewise be acceptable. [19:30:13.0000] Bakkot: Yeah, I feel like moving from one sort of error to another would be okay, aside from any concern about popular frameworks/libraries checking which kind it is [19:31:36.0000] I guess my immediate thought was that someone would object on account of the original reason for introducing the concept (whatever that may be), but maybe I'm wrong? [20:05:44.0000] early Reference Error was introduced in ES6, so discussion might be findable [20:09:28.0000] draft 10 was the first that had it, 2012-09-27. [20:10:22.0000] release notes don't mention it. [20:22:47.0000] There's some history in https://github.com/tc39/ecma262/issues/691 [20:57:20.0000] jmdyck: that is certainly an interesting thread [21:06:05.0000] from the spec text perspective, they're also rarer than I was thinking [21:11:02.0000] of the 40 `Static Semantics: Early Errors` sections, there are only four ReferenceError cases (demonstrated by `0++;`, `++0;`, `0 = 0;`, and `0 += 0;`) and they all boil down to "AssignmentTargetType is ~invalid~" [21:11:58.0000] perhaps that does raise a question of whether it's truly worthwhile [07:41:30.0000] rkirsling: honestly I'd expect those to all be syntax errors, like on a design level [11:42:09.0000] devsnek: yeah I added my vote for that to the thread jmdyck linked -- apparently Allen had already said the same, which I totally wasn't expecting 2019-03-13 [10:46:46.0000] aw man, V8/SM/XS have full ES2019 support now but JSC still needs to implement the F.p.toString revision [10:47:21.0000] and by "aw man" I guess I mean "hey maybe I should do that" 2019-03-14 [10:55:55.0000] lol [10:55:55.0000] ``` [10:55:55.0000] λ eshost -sx "print(new Date('08.10.2023'))" [10:55:55.0000] #### ch, jsc, sm, xs [10:55:55.0000] Invalid Date [10:55:55.0000] #### v8 [10:55:55.0000] Thu Aug 10 2023 00:00:00 GMT-0700 (Pacific Daylight Time) [10:55:56.0000] ``` [11:02:13.0000] One day, someone will spec a date parser [11:03:12.0000] is that star trek time [11:03:39.0000] what is that called with the decimals, stardate [11:06:30.0000] cloudshu: yeah, but it looks like it's always one decimal point: https://en.wikipedia.org/wiki/Stardate [11:06:59.0000] ah [11:15:40.0000] Someone from Mozilla was nearly there with a Date parser spec [11:16:22.0000] /me remains hopeful [11:19:44.0000] annevk: yeah, it's a crying shame that morgan's work was lost there. She had spent a LOT of effort outlining the intersection behavior. [11:20:18.0000] frankly, that's partially my fault. By the time we went looking for it, she had left the company and it had sorta disappeared. [11:21:05.0000] I did not realize we lost it, ouch [11:25:35.0000] /me certainly doesn't know where it is, and I don't know if any of the SM people from then that are still around do, either [11:44:03.0000] efaust: 😢 [12:12:17.0000] `new CivilDateTime(2023, 08, 10)` :) [12:13:11.0000] hmm temporal also has fromString [12:14:30.0000] efaust: it’s not lost; i found a fork of it. It’s on the proposals repo. [12:41:19.0000] Doesn't that 08 actually mean 10 [13:05:43.0000] ljharb: wait, really?! \o/ [13:15:39.0000] I don't think that repo included most of the supporting materials [13:17:10.0000] fair, i'm not sure morgan's repo ever did tho [13:17:23.0000] like i'm not sure the supporting materials ever got posted anywhere accessible - but if they did, what was the url? [13:24:42.0000] ljharb: http://mrrrgn.com/date/ per https://bugzilla.mozilla.org/show_bug.cgi?id=1274354#c1 [13:25:10.0000] https://github.com/tc39/proposal-date-time-string-format links that too [13:26:45.0000] https://github.com/tc39/proposal-uniform-interchange-date-parsing is also interesting; why did all of these get stalled? [13:27:38.0000] mathiasbynens: Date.parse >