9 ms·
> It's a little unfortunate that some of the cool features of Rust need to be put into the "use sparingly" category. This is just the reality of engineering --
by msbarnett 7y ago
> It's a little unfortunate that some of the cool features of Rust need to be put into the "use sparingly" category.
This is just the reality of engineering -- there are no silver bullets.
Sure, it'd be nice if any language could give you the space efficiency of dynamic dispatch with the runtime efficiency of monomorphized generics, but those two things are fundamentally in tension. Neither Rust nor any other language can fix that.
Rust at least gives you a fairly easy choice of which you want in any given circumstance. Most languages just pick one or the other universally.
- heavenlyblue 7y agoOne way to fix it is jitting. I am wondering if Rust has a project of shipping Rust compiler embedded in your executable, so that one could compile sym into code.
- msbarnett 7y ago> One way to fix it is jitting. Also not a silver bullet, because there's non-zero costs in memory, CPU overhead, I$, etc to the statistics gathering, stop-and-jit-the-dynamic-call-and-change-the-call-sites and so forth. In long running server processes this can mostly amortize out nicely over a very long run, but for interactive applications it can add noticeable lag.