News for hackers. Stuff that matters.
Re:Defunctionalisation: An underappreciated tool for writing... by galaxyLogic on Monday March 09, 2020 @11:48AM (#22526347)
I think JavaScript should be the perfect language for explaining these concepts. Many programmers understand JavaScript, and it has higher-order functions.

And many programmers use JavaScript so they could easily start adopting this mechanism in their actual programs.

Re:Defunctionalisation: An underappreciated tool for writing... by choeger on Monday March 09, 2020 @12:09PM (#22526517)
But it lacks ADTs. And defunctionalization without ADTs is way more complicated to explain due to the necessary boilerplate.
Re:Defunctionalisation: An underappreciated tool for writing... by garethrowlands on Monday March 09, 2020 @12:42PM (#22526815)
It might be easier in Typescript, which at least has a type system that can say or.