00:39 | <jschoi> | It’s been a long time, and yet I’m realizing now that nobody seems to have proposed
|
00:48 | <ljharb> | why would it be rare to have an iterable topic? |
00:52 | <jschoi> | I don’t think having an iterable topic would be rare, but I do think that spreading an iterable topic into a function call or array/object literal within a pipe would be pretty rare.
Though, even when it does happen, |
05:00 | <ljharb> | arrayOfNumbers |> Math.max(...(..)) ? |
05:01 | <rkirsling> | ^ this seems like a nice syntactic "test case" for evaluating the various options |
06:09 | <jschoi> | Yeah, I’ll acquiesce that flattening into Math.max and min does happen. Though I’d be a bit surprised if such calls exceeded 0.1%, let alone 1%, of all JS function calls that would benefit from piping.
I’m actually kind of excited about |
06:37 | <rbuckton> | I can't say I'm thrilled with how ...x looks for property access. |
06:42 | <rbuckton> | I'm still of the opinion that F#-style pipes would have been better. arr |> (x) => Math.min(0, ...x) means no special topic is needed, PFA or no PFA. |
07:05 | <ljharb> | that's a nonstarter tho based on browser feedback |
07:05 | <ljharb> | personally i think .. is way worse than ^^ or && |
07:22 | <rkirsling> | I mostly like .. except that I think there are so many cases where parens would be needed (at least from a lint perspective) that one would almost need to consider it a four-character thing (..) , which might in itself rule it out |
07:26 | <rkirsling> | I hate %% but I think this discussion actually makes me come around to ^^ a bit |
08:12 | <Ashley Claymore> | the main thing I like about ^^ is the shape resemblance with |> |
08:27 | <rkirsling> | interesting |
08:27 | <rkirsling> | I don't know about that, but in this context, I was appreciating how ^^ can sit next to . and ... nicely |
08:30 | <rkirsling> | if we could type dots above like ˙˙ then that'd be cool but we can't so ^^ stands as a typable alternative |
09:05 | <Nic> | that's a nonstarter tho based on browser feedback |
09:09 | <Nic> | Maybe even syntactically limiting it to 1 parameter, like we do for setters |
09:48 | <Ashley Claymore> | Something that looks exactly like a function but isn't a function sounds not great |
10:00 | <Ashley Claymore> | the main advantage for the reader of f# is that it probably wouldn't be arrow functions, and would instead be curried functions - so looks almost like method calls. If every f# pipe was an arrow that sounds verbose
vs
|
10:01 | <Ashley Claymore> | if we can't find a token, then maybe the pseudo arrow is a good compromise |
10:03 | <Nic> | I mean, either an arrow-like thing to give a name, or an expression that just gets called, with a cover grammar |
10:04 | <Nic> | If it starts with `( identifier ) =>` it's one, otherwise its the other |
10:05 | <Nic> | Something that looks exactly like a function but isn't a function sounds not great |
15:16 | <Richard Gibson> | there have been suggestions to embed an identifier inside the pipe syntax like e.g. getData() ~x> Object.entries(x) ~a> handleEntries(a) ~a> Object.fromEntries(a) (although I think they were |identifier> , which wouldn't work because getData() |x> Object.entries(x) |a> handleEntries(a) |a> Object.fromEntries(a) already has a valid parse) |
15:29 | <rkirsling> | thanks I hate it |
15:30 | <rkirsling> | (I mean l do find |x> amusing à la bra-ket notation...but also that's not what this is) |
15:32 | <jschoi> | I can't say I'm thrilled with how ...x would always tokenize as spread-x and never topic-member-x, and a |> ...x would always be a syntax error (no topic in pipe body).And you would nearly always want to do a.x instead of a |> .. .x anyway… |
15:33 | <jschoi> | there have been suggestions to embed an identifier inside the pipe syntax like e.g. ~ , I don’t think ~~ as topic has been proposed either. It’s not bad either, maybe more of a pain to type. |
15:34 | <jschoi> | Though it may be a problem with XOR in ~~~… |
15:35 | <nicolo-ribaudo> | ASI in ``` x |> ~~ f() ``` is bad though |
15:47 | <rkirsling> | took me a sec to decipher what you meant but oof yeah that's a non-starter |
17:46 | <TabAtkins> | yeah i think that makes the syntax a non-starter, fwiw |
17:48 | <TabAtkins> | We've avoided unary operators for the ASI reasons Nicolo just brought up. If we're using an existing operator it has to be binary, so them being adjacent is impossible. |
18:23 | <jschoi> | The committee temperature for .. seems quite cold, alas. I suppose it’s understandable. I’ll add .. and ~~ to the wiki table of rejected topic tokens later with reasons.I also need to post an update in #232 saying basically that the champions have been busy proposing lower-hanging fruit over the past two years. |
18:29 | <jschoi> | There was some talk at the last plenary’s TG5 about maybe doing another pipe usability study, sparked by a suggestion from Michael Ficarra. At the time, there was some surprising new positive enthusiasm about Hack pipe from Mark Miller, too. If a new TG5 study demonstrates usability benefits from the pipe operator, when compared to deeply nested expressions or temporary variables, then other committee members may become more amenable to pipe. The study could also evaluate the usability of the remaining candidate topic tokens. (The TG5 meeting notes aren’t up yet. If anyone knows how best to contact Mikbar Barash, I’d like to ask him to let me look at the meeting notes before he posts them.) |
18:37 | <Ashley Claymore> | @mikbar-uib:matrix.org ? |
23:50 | <rkirsling> | note that it's Mikhail Barash, abbreviated to mikbar 😅 |