News for hackers. Stuff that matters.
Re:Grain: A strongly-typed functional programming language f... by exDM69 on Sunday April 25, 2021 @08:13AM (#26932135)
let vs. let rec is in ML and Scheme and some other languages. But the compiler could transform the let rec into a let, and e.g. Haskell does it so the programmer does not have to.

It's not exactly a trivial algorithm as it involves finding strongly connected components from the dependency graph and then topologically sorting that.

I implemented this for a toy programming language compiler project, it was a fun one. Luckily I had SCC and topological sort from Haskell's Data.Graph module.

Re:Grain: A strongly-typed functional programming language f... by pjmlp on Sunday April 25, 2021 @03:19PM (#26935688)
Haskell does it, because being lazy evaluated helps quite a lot in such algorithms.