Hacker News new | ask | show | jobs
by wereHamster 2195 days ago
Writing old-style pure code to do changes in a deeply nested structure is cumbersome, both to write and read. Eventually every language will find nicer ways to allow programmers to express these mutations.

JavaScript doesn't provide a nice way to extend the language syntax, unlike some other programming languages. So most DSLs end up looking like imperative code but do pure mutations underneath. I understand, for the reader it's confusing, because unless you know that it's a DSL you never know whether the mutations are pure or not.

Compare that with Haskell, with its support for custom operators, allows for some quite succinct code to express deep mutations (cf. lens library)