Live data from Hacker News

Working pipe operator today in pure JavaScript

github.com

11–20 of 109 posts

Re: Working pipe operator today in pure JavaScript

#18

This kind of stuff is why C++ developers has an almost overly allergic reaction to operator overloading.

C++ is the reason people have that reaction. The quintessential example in introductory texts for operator overloading is using bit-shift operators to output text. I mean, come on - if that’s your example, don’t complain when people follow suit and get it wrong.

Re: Working pipe operator today in pure JavaScript

#19
post #2

Since this library leverages Symbol.toPrimitive, you may also use operators besides bitwise-OR. Additionally, the library does not seem to dispatch on the `hint` parameter[0]. Now I want to open a JS REPL, try placing this library's pipe object into string template literals, and see what happens. Overall, cool library. [0] https://tc39.es/ecma262/multipage/abstract-operations.html#s...

what are your ideas regarding the pipe object in string template literals? I'm just looking for an overview to see if it sparks some ideas.

Re: Working pipe operator today in pure JavaScript

#20
post #8

Further proof that JavaScript accidentally became the new C++. “Aren’t you surprised that this syntax works?” is not praise for a language design.

Agreed!!!!

Serious q: but how does this sentiment change with LLMs? They can pickup new syntax pretty fast, then use fewer tokens...

Post reply on HN