3 ms·
There’s no reason you couldn’t have a rust jit for development then compile the code for production (or stick with a jit for prod too).
by amenghra 2y ago
There’s no reason you couldn’t have a rust jit for development then compile the code for production (or stick with a jit for prod too).
- h4x0rr 2y agoHonestly it would probably be even faster than unoptimized aot compolation
- amenghra 2y agoSome developers need/are used to a fast edit-compile-run loop. The JIT doesn't even need to be optimized, just good enough to improve the developer experience.
- nindalf 2y agoThere's no reason? Are you sure about this? I think you mean there could theoretically be an interpreted Rust, but I don't think anyone has ever made a prototype of a Rust interpreter. The closest is probably rust-analyzer (the official language server), that maintains internal state and reacts to changes you make, but it doesn't create an executable artifact. The other is probably the Cranelift Backend (https://github.com/rust-lang/rustc_codegen_cranelift https://github.com/rust-lang/rustc_codegen_cranelift), which can produce debug builds quickly.
- amenghra 2y agoI meant no reason from a technical point of view. People might say most of the compilation time is spent in the type/borrow checker, but that's orthogonal. You can JIT potentially incorrect code and postpone static checks for a later time (or run them in parallel).
- dequan 2y agoThe cranelift backend itself has a JIT mode.