3 ms·
> (see, eg., google's carbon which iirc, seeks to be ast-free single-pass) Carbon’s (mostly hypothetical) frontend is actually 3 passes: lexing, parsing, and a
by cwzwarich 3y ago
> (see, eg., google's carbon which iirc, seeks to be ast-free single-pass)
Carbon’s (mostly hypothetical) frontend is actually 3 passes: lexing, parsing, and a semantic analysis pass, each with separate IRs. One of their arguments is actually that they are more efficient as separate passes operating on packed data structures rather than e.g. a parser that calls into a lexer for each individual token. In a way, this is a claim that Wirth’s approach is inherently inefficient on contemporary CPU microarchitectures.
- mjburgess 3y agoHmm, i read it as "wirthing" each layer. since, iirc, the IR representation of each pass is in fact, basically, just a linear array of ints. So you have linear scans on top of linear scans.