News for hackers. Stuff that matters.
Re:Writing a C Compiler (2017) by delta_p_delta_x on Friday June 09, 2023 @11:53AM (#36259734)
I took a compilers course last year, based off UPenn's CIS341[1]. The lexing + parsing lectures were blitzed through, and we didn't even write the parser for the semester-long compiler assignment. The parsing section of the assignment was for us to simply assign shift-reduce precedences to operators and expressions, and OCaml's Menhir took care of everything.

I have written a recursive-descent parser, and it boils down to essentially turning the context-free grammar into a bunch of mutually-recursive functions, which is frankly rather tedious work.

I am much more interested in how a modern compiler is able to optimise a call to `std::accumulate` into a fast, tight, and vectorised loop in assembly.

[1]: https://www.seas.upenn.edu/~cis3410/current/

There are no comments on this comment yet.