▲ | avaq 8 days ago | |||||||||||||||||||||||||
They can't implement function application without tanking performance? I find that hard to believe. Especially considering that function application is already a commonly used (and, dare I say: essential) feature in the language, eg: `Math.sqrt(2)`. All we're asking for is the ability to rewrite that as `2 |> Math.sqrt`. What they're afraid of, my understanding goes, is that people hypothetically, may start leaning more on closures, which themselves perform worse than classes. However I'm of the opinion that the engine implementors shouldn't really concern themselves to that extent with how people write their code. People can always write slow code, and that's their own responsibility. So I don't know about "silly", but I don't agree with it. Unless I misunderstood and somehow doing function application a little different is actually a really hard problem. Who knows. | ||||||||||||||||||||||||||
▲ | nilslindemann 7 days ago | parent [-] | |||||||||||||||||||||||||
Your simple example (`2 |> Math.sqrt`) looks great, but when the code gets more complex, then the advantage of the pipe syntax is less obvious. For example,
becomes something like
or
That looks like just another way to write a thing in JavaScript, and it is not easier to read. What is the advantage? | ||||||||||||||||||||||||||
|