>>105595032Okay, grant me the knowledge. What do you mean by devirtualization? I've just rechecked what it is to avoid needlessly embarrassing myself and yeah - it's an optimization that relies on _statically_ inferring that some instance of an abstract class is an instance of some particular subclass. We don't have this info at compile time if we represent AST via class hierarchy and generate the trees in runtime.
If you just messed up the terminology and meant something like "use enums with tags and cases inside function", then it would be very painful to write (and compared to OCaml, there would be a lot of manual plumbing, and the compiler wouldn't catch some dumb errors like non-exhaustive pattern-matching). Oh, std::variant? It is borderline impossible to use with recursive sum types (and nontrivial ASTs are always recursively defined) and std::visit is ugly as sin.
Re: arena allocators. Yeah, that might've improved things, but we haven't tried since we got the acceptable perf and decided not to bother further. Personally, I thought that hash consing might've been really game-changing, but again, lack of time and different priorities. Maybe I'll revisit it one day.
Also, I think it's important to compare _idiomatic_ code in different languages (although I admit that the ability to optimize the shit out of a piece of code matters as well).
>>105595132Hey, don't forget about XMonad! AFAIK they use zippers to represent window configurations. Cool stuff.
>>105595381>Emacs>>Commonly used>>No viable alternatives>LOLHe is correct though. But IMO Emacs is a bit cheating since it's a tooling for itself.