3 ms·
> Javascript VM´s these days are fairly complex beasts with huge amount of man-hour and expertise. You know what else is a MASSIVE time and money sink? C/C++.
by mamcx 7y ago
> Javascript VM´s these days are fairly complex beasts with huge amount of man-hour and expertise.
You know what else is a MASSIVE time and money sink? C/C++.
Combining 2 big and nasty complex stuff you get something even bigger.
----
I don't say to blind rewrite. Is know to be:
> an exercize in vanity and why not say it, stupidity.
But this must take in account TIME. Right now, is not the time for a rewrite, but is better to have it planned.
----
I'm not naive saying this. This is my life (as a rewriter of codebases for several years and many projects). I'm moving a medium sized ERP project to Rust. In parts, too. Focusing in data exchange, yes. But if we don't do it, then the complexity behind will kill us.
- pjmlp 7y agoDepends, using WinUI, Qt or Gtkmm is way faster than Gtk-rs, regarding productivity.
- oscargrouch 7y agoThe topic of rewrite, i think it depends a lot of the context. Some things might make perfect sense for a rewrite, but i still think that a very optimized with huge amount of man-hour piece of sophisticated and complex C++ codebase like Spidermonkey VM are not one of those things. Theres no gain in clear performance, unless theres a better algorithm being implemented, no clear gain in productivity, as C++ and Rust are both equaly complex beasts, and with not much gain in security, if you already implemented in "modern c++" and are using smart pointers, including in API´s and moves correctly. The other gains in security/safety that you might have with Rust, are maybe lost if you think that the C++ codebase have been used and tested in every possible scenario, so a lot of bugs are corrected, and if you think that given this is a Jit VM you will have to use Rust´s unsafe{} in a lot of places, i still think, giving the context, that is not a smart thing to do, and it will be more like a trophy to Rust, but without a more pragmatic and realistic approach to the matter, not focusing properly on results. Not much gain, you will end with a worse and more buggy JIT in the end, and will have to spend more years, only to get parity to the VM you already had in the first place.
- mamcx 7y agoThat is correct, in the SHORT time. The thing with rust is that it provide safety guarantee FOREVER. Is like null. You can write null-safe code in any language... as long your developers become "compilers" and by discipline make sure EVERY LINE is null safe. But when your lang do it for you, is a problem that get solved. C++ demand a lot of attention to details that are unnecessary in rust. This is where the gain come.