You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I’m the author of a smart pipelines proposal. It has already been formally specified, it has a Babylon plugin under development, and it will be presented to the TC39 by @littledan next week alongside the original pipelines proposal and an alternative pipeline proposal.
The smart pipelines proposal has a “topic style” that is very similar to your proposal. (N-ary expressions are deferred to an “additional feature”.)
Right now I’m hurrying to help prepare the presentation and the Babel plugin for TC39, so I don’t have free time to examine your proposal in detail right now. But I will definitely take a close look at it sometime. In the meantime, I would love to hear your response to the similarity between our proposals. 👍
The text was updated successfully, but these errors were encountered:
I rewrited some of your "topic style" examples using this proposal & the original pipeline proposal.
Your example...
...could be rewritten as
promise|>await #
|> # ||thrownewTypeError(
`Invalid value from ${#}`)|>doubleSay(#,', ')|>capitalize(#)|> # +'!'|>newUser.Message(#)|>awaitstream.write(#)
promise|> #await ?
// diff1: the syntactic marker is needed|> #?0||thrownewTypeError(`Invalid value from ${?0}`)// diff2: 0 is needed in ?0|> #doubleSay(?,', ')|>capitalize// note1: there is no need to invoke the function|> #? +'!'|> #new User.Message(?)|> #await stream.write(?)
5|> # -3|>-#
|> # *2|>Math.max(#,0)
5|> #? -3|> #-?
|> #? *2|> #Math.max(?,0)
To remove those differences, some addition rules are needed.
Solution1
to resolve diff1: The pipeline automatically creates an #… expression if the pipeline includes a ?.
to resolve diff2: In this expression, all of the ?s point to the same argument.
Using these rules, my rewritten examples could be:
Your example...
...could be rewritten as
promise|>await #
|> # ||thrownewTypeError(
`Invalid value from ${#}`)|>doubleSay(#,', ')|>capitalize(#)|> # +'!'|>newUser.Message(#)|>awaitstream.write(#)
promise|>await ?
|> ? ||thrownewTypeError(
`Invalid value from ${?}`)|>doubleSay(?,', ')|>capitalize|> ? +'!'|>newUser.Message(?)|>awaitstream.write(?)
5|> # -3|>-#
|> # *2|>Math.max(#,0)
5|> ? -3|>-?
|> ? *2|>Math.max(?,0)
Problems
I don't think its a good idea to remove the syntactic marker though due to the garden path problem.
Solution2
to resolve diff2: recognize the |># pattern and point all of the ?s to the same argument.
Problems
diff1 is not resolved.
Solution3
Same as Solution2, but the |> is interpreted as |>#.
This would resolve all differences.
Problems
note1 would be "destroyed": 'hello' |> capitalize would be translated to 'hello' |> x => capitalize instead of 'hello |> x => capitalize(x)'.
Conclusion
Afterall, I don't think the original translations are too different, so keeping it as is would not be too bad.
But if you do, I think Solution3 is the most versatile one.
Let me know what you think!
Hi, I’m the author of a smart pipelines proposal. It has already been formally specified, it has a Babylon plugin under development, and it will be presented to the TC39 by @littledan next week alongside the original pipelines proposal and an alternative pipeline proposal.
The smart pipelines proposal has a “topic style” that is very similar to your proposal. (N-ary expressions are deferred to an “additional feature”.)
Right now I’m hurrying to help prepare the presentation and the Babel plugin for TC39, so I don’t have free time to examine your proposal in detail right now. But I will definitely take a close look at it sometime. In the meantime, I would love to hear your response to the similarity between our proposals. 👍
The text was updated successfully, but these errors were encountered: