TC39 Pipeline Operator - Hack vs F#

submited by
Style Pass
2021-09-12 21:30:04

I want to take some time to share everything I know about the pipeline operator proposal that is currently in stage 2, to the best of my ability. This will, of course, be a somewhat biased account — it's my article, haha — but I'll do my best to present both sides while presenting my case. Also, keep in mind, that as thorough as I'll try to be, I'm completely sure I'm missing things. If you spot something or think of something, feel free to DM me on Twitter. I try to answer all of my DMs.

IMPORTANT: Before we get into this, there are folks, myself included, that have VERY strong feelings about these matters. Please keep those feelings in check, the folks that are working on these standards are good people trying to do right by the community, even if we disagree with them.

Simply put, the pipeline is an operator, |> in this case, that allows a software developer to "pipe" the evaluated expression from the left-hand-side (LHS) to some function or expression on the right-hand-side (RHS). There are several implementations and examples of this throughout the programming world in various languages, and we're in the amazing position that the TC39 — the governing body of the ECMAScript standard on which JavaScript is based — is considering adding such an operator to the ECMAScript standard (And therefor JavaScript). There were many competing proposals, two stood out the most, the Hack pipeline — currently in stage 2, and the F# pipeline — skipped despite being very popular.

Leave a Comment