4 ms·
I was only commenting on his claims about the academic literature on parsing, not whether he should use the techniques verbatim. The problem with structured ap
by cwzwarich 6y ago
I was only commenting on his claims about the academic literature on parsing, not whether he should use the techniques verbatim.
The problem with structured approaches to incremental parsing is that you rarely want incremental parsing alone. You’re going to want to do something else with the resulting parse tree (name resolution, type checking, compilation, etc.) and no structured approach to incremental parsing will help you there. Once you’re stuck writing an incremental type checker by hand, you probably have the right framework for also writing an incremental parser.
Rust has additional complications, e.g. the macro system and the fact that the language is defined by a single implementation.
- raphlinus 6y agoI can confirm that Rust's macro system presents massive difficulties. For example, rustfmt is currently broken for subdirectory in Druid because of the use of a `cfg_if!` macro. We filed a bug (https://github.com/rust-lang/rustfmt/issues/4266 https://github.com/rust-lang/rustfmt/issues/4266) but it got closed without (as far as I can tell) actually being fixed. Our present approach is to remove the use of the macro, but this is a bit of a bad sign: two features (macros and automatic formatting) that work fine individually, but their interactions break.