News for hackers. Stuff that matters.
Re:Go proposal: new package to provide generic slice functions by Rusky on Wednesday May 05, 2021 @02:31PM (#27053823)
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.

Re:Go proposal: new package to provide generic slice functions by pjmlp on Thursday May 06, 2021 @02:50AM (#27059929)
If 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.
Re:Go proposal: new package to provide generic slice functions by Rusky on Saturday May 08, 2021 @02:14PM (#27089470)
I 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.