3 ms·
This is one of the idioms that leads to large amounts of IR! Avoiding that means doing the flattening earlier, in a higher level IR.
by Rusky 5y ago
This is one of the idioms that leads to large amounts of IR!
Avoiding that means doing the flattening earlier, in a higher level IR.
- pjmlp 5y agoIf F#, Haskell, Scheme, Lisp and OCaml are able to do it and still remain fast compilers (there is more than one backend to choose from), I am sure Rust will manage it eventually.
- Rusky 5y agoI am not familiar with the compilers for all of these, but I can make a couple of interesting comparisons: * GHC does exactly what I suggested rustc needs to do- it does the flattening on an earlier, higher-level IR than LLVM's. (It is also not exactly a fast compiler, though!) * I'm not sure if this applies to F#, but in C#, LINQ compiles faster by not doing as much (if any) flattening in the first place.