News for hackers. Stuff that matters.
Re:TC39 Pipeline Operator – Hack vs. F# by junon on Tuesday September 14, 2021 @05:18PM (#28531413)
> as immutable data is easier to work with

Source? This hasn't been my experience. Going on 10 years of heavy Node.js ecosystem involvement, immutable data enthusiasts are exceedingly rare.

Plus, this is const vs let, which is a reach to call "immutable data". We're not talking about object properties.

Re:TC39 Pipeline Operator – Hack vs. F# by Zababa on Tuesday September 14, 2021 @05:37PM (#28531704)
> Source? This hasn't been my experience. Going on 10 years of heavy Node.js ecosystem involvement, immutable data enthusiasts are exceedingly rare.

Immutable.js is relatively popular and immutable records and tuples are a stage 2 TC39 proposal. From what I've seen, immutability is mostly popular on the frontend, probably because functional programming had a huge impact there. It's also popular in other languages (FP or FP inspired generally, so OCaml, Haskell, Scala, Elm, Elixir, Rust) that are relatively close to the web ecosystem.

> Plus, this is const vs let, which is a reach to call "immutable data". We're not talking about object properties.

I'm not sure what you mean here.

Re:TC39 Pipeline Operator – Hack vs. F# by djur on Tuesday September 14, 2021 @06:33PM (#28532421)
A variable being mutable (let vs const) is not the same as the data referenced by that variable being mutable. There are languages that favor immutability (Elixir, for instance) that permit rebinding of local variables.
Re:TC39 Pipeline Operator – Hack vs. F# by eyelidlessness on Tuesday September 14, 2021 @05:23PM (#28531499)
> Source? This hasn't been my experience. Going on 10 years of heavy Node.js ecosystem involvement, immutable data enthusiasts are exceedingly rare.

Not an authoritative source, but since you cite your own experience, mine has been the opposite. Especially so when TypeScript is also in the mix.

> Plus, this is const vs let, which is a reach to call "immutable data". We're not talking about object properties.

As I mentioned in a sibling comment, const is often used to signal the intent to treat an assignment as immutable. This isn’t universal, but I understand it to be idiomatic usage.

Re:TC39 Pipeline Operator – Hack vs. F# by pharmakom on Tuesday September 14, 2021 @05:21PM (#28531469)
State in React should be immutable. It’s not rare at all!
Re:TC39 Pipeline Operator – Hack vs. F# by junon on Tuesday September 14, 2021 @05:23PM (#28531494)
React != JavaScript.
Re:TC39 Pipeline Operator – Hack vs. F# by pharmakom on Wednesday September 15, 2021 @01:42AM (#28535655)
Yeah, of course. But vast majority of React is written in JavaScript and large numbers of JavaScript devs are writing React. It shows FP and immutability have significant base of practitioners in JS world - although many might not realise it.
Re:TC39 Pipeline Operator – Hack vs. F# by junon on Wednesday September 15, 2021 @06:01AM (#28537235)
I would argue most JavaScript developers do not use React. Perhaps in your own bubble, but there are way more people writing other things in JavaScript.