News for hackers. Stuff that matters.
Re:Thought Experiment: An Introductory Compilers Class by Animats on Monday February 17, 2020 @11:03PM (#22353358)
This is more like "Compilers for functional languages I", to be followed by about two more courses.

Non-optimizing compilers for simple imperative languages are straightforward. There's a front end, which turns

    a = b + c;
into

    b c + a =
which can be represented as a tree. Then, for each operator, you generate code. So you generate something like

    load a0,b
    add a0,c
    store a0,a
Then you show how that can be generalized to cover functions, arrays, loops, etc. That's Compilers 101, Wirth's classic book on Pascal.

This article takes a completely different approach. All functional, all the time. Not sure whether this is good or bad, but it's definitely different. Is what this guy is promoting mainstream in advanced compiler work today, or is he off in his own world?

One issue with functional everything is that naive functional compilation is very inefficient. If you write

    f(g(a)) 
where a is some kind of big collection, and g produces a similar collection as output, then you have an intermediate variable which is itself a big collection. Much of functional programming optimization is about trying not to generate big intermediate values, but converting the problem to a pipeline instead.
Re:Thought Experiment: An Introductory Compilers Class by chubot on Tuesday February 18, 2020 @12:00AM (#22353578)
About the last paragraph, R and Pandas both have that issue. (Although I'm not sure if it's a bottleneck in typical code, since there are other problems too.)

But Julia and the newer Weld compiler apparently have loop fusion:

https://julialang.org/blog/2017/01/moredots/

https://dawn.cs.stanford.edu/2018/07/30/weldopt/