Comments (3)
Well, first of all, t last and the pipe operator aren't established only in the Reason ecosystem. The pipe operator is also widely used in the OCaml ecosystem, and so if you want to leverage that you'd still have to deal with both even if the Reason ecosystem changes. The fast pipe operator also isn't actually Reason-specific, but BuckleScript-specific, which makes it difficult to write shared client/server code, or even just to mentally switch between the two worlds. The pipe operator is also established in other closely related languages, such as F# and Elm, and being different makes it difficult to transfer idioms between them and to learn from what these other communities are doing. For example, the pipe operator itself originated in F#, which is a much newer language than OCaml, and in fact OCaml was the primary inspiration for the design F#. It was therefore easy to bring the operator over, and if that hadn't happened it's not very likely we'd have the "fast pipe" either.
Even functional languages that don't have an established pipe operator, or something equivalent, still use t last because it enables function composition by partial function application, which is a pretty big part of being "functional" in the first place. The entire reason the pipe operator exists is because it follows quite naturally from composition of curried functions and can be implemented as an ordinary operator, whereas the "fast pipe" must be implemented as a syntactic transform. Note that in OCaml this could still work with t first if all other arguments are labelled, since labels can be applied in any order and when applied would effectively leave t last anyway. But even this proposal was just shut down and ignored.
As for pros, better type inference in some cases is a benefit, but there are other cases where t last works better and it's not clear to me that it's a net win. Another benefit is marginally better performance by default, partially because you can't partially apply a function "by accident" (whatever that means), and partially because it's a syntactic transform, while the ordinary pipe operator is treated as a function call that would have to be, and usually is, optimized away (or rather inlined) like any other function call might be. But even this benefit is debatable, since the ordinary pipe operator could be implemented as a syntactic transform as well. it just doesn't have to be. Lastly, I've heard it argued that it makes it more "natural" to interoperate with from JavaScript, since JS is not a functional language and therefore usually has t first. That's not much of a winning argument for me either, but YMMV.
I'm sure there are more subtle issue with it, and there might be more benefits as well. This is just off the top of my head, as there's never actually been a properly reasoned argument made for t first and the fast pipe operator. And in lieu of that, from what I've been able to gather on my own, both t first and the fast pipe operator add up to terrible design decisions.
But what's even worse for me is how criticism from the community was flat out ignored, and the changes forced though. It's caused me to lose any trust I had in the governance of both BuckleScript and Reason, and led me to look elsewhere for a language, ecosystem and community that I can trust, and that seems more sustainable.
from bs-webapi-incubator.
Hi. Thanks for asking. There are no plans to do so, and I doubt there'll ever be, because "fast piping" is worse than useless. I also don't think it's becoming standard in Reason because there are a lot of libraries and bindings that use the established pipe operator and they're not going to change just for the sake of change.
I absolutely understand the frustration of having to deal with multiple piping operators, and to always have to remember which function needs which operator, but this was brought up and well known before the new operator was introduced, and just ignored. The obvious solution is of course to revert the terrible decision, not to break the entire ecosystem, but I doubt that'll happen either as there seems to be too much pride involved.
I hope you can see where I'm coming from and understand my decision.
from bs-webapi-incubator.
Thank you, that's good to know.
It seems like you're quite passionate about the issue, and I haven't heard such a strong dissenting opinion on the matter before. Other than the ecosystem fragmentation, is there anything else about fast-piping you don't like? I've mostly come to prefer it because type inference seems to be better when I use it compared to the regular pipe.
from bs-webapi-incubator.
Related Issues (20)
- Function for converting Node to real type HOT 1
- Project name HOT 2
- Nodelist forEach HOT 2
- Dom.Image does not exist (the current Dom.Image should be Dom.ImageData)?
- adding bindings to HtmlVideoElement HOT 3
- Binding for XHR HOT 1
- Classify for Dom.node HOT 4
- Adding replaceChild
- Canvas2d.putImageData creates erroneous calls when not using all the optionals. HOT 3
- Could be possible to perform auto-generation from WebIDL? HOT 3
- Bsdoc dependency makes contributing a bit difficult on Linux HOT 2
- Binding for URLSearchParams.entries() is incorrect
- Add bindings for HtmlTemplateElement
- unmet peer dependency warning HOT 1
- Regarding document.documentElement.scrollTop HOT 2
- Add functor to type CustomEvent.detail
- How to use HtmlInputElement (focus, select) ? HOT 5
- How to use addEventListener on window HOT 3
- Add DataTransfer bindings
- unsafeAsHtmlInputElement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bs-webapi-incubator.