Easy to say "monomorphization is awful and Rust should never have done it", harder to say "I want all generic functions to be compiled to bytecode and to embed a Rust interpreter in every binary".
-
-
I'm sure i't find use for very rapidly compiled Rust 'things' beit modules or things i can update live.
-
I agree! I’m actually bullish on an interpreter as an opt-in compilation mode.
End of conversation
New conversation -
-
-
What about Swift witness tables as a kind of half-way? Also I would want interpreted only for newly-needed generic functions in an incremental compile and then my long-running compile process hot-swaps in monomorphized versions when they’re ready.
-
We tried witness tables (intensional type analysis). It was a giant mess (I wrote a lot of that code). I suspect it wouldn’t be much faster at runtime than just having an interpreter, and an interpreter would be faster to compile.
End of conversation
New conversation -
-
-
In C++ I can do forward declarations and add virtual interfaces between module boundaries to improve compilation speed (i.e. allow separate compilation). Is that kind of tuning possible with Rust?
-
Yes, you can factor into separate crates.
End of conversation
New conversation -
-
-
Could you explain more why it needs an interpreter and not "just" abstract (via vtable) over all the type things the code depends on (assuming data layout was still monomorphized)? E.g. ask vtable for size, copy function etc. What am I missing?
-
Because doing so is a giant mess. I wrote a lot of that code early on. I highly suspect that if we did it again it would be just as slow as interpreting the whole function.
- 7 more replies
New conversation -
-
-
As a development mode to improve iteration that can be turned off for release? Yes please!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
By interpreter, do you also mean a JIT? I suspect such a thing could also do good with regards to ABI: eg we could instantiate generics at runtime, when they're needed, even when dynamically linking.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.