4 ms·
maybe we could use ai to optimise compilers somehow.
by ekaryotic 2y ago
maybe we could use ai to optimise compilers somehow.
- phyrex 2y agoPeople are working on it: https://ai.meta.com/blog/compilergym-making-compiler-optimizations-accessible-to-all/ https://ai.meta.com/blog/compilergym-making-compiler-optimiz...
- cosmic_quanta 2y agoThe reason rustc and other compilers like it (e.g. GHC) are "slow" isn't because they are unoptimized; it's because they do A LOT of work! rustc is enforcing a strong and expressive type system, checking for ownership, generating code from macros, etc. It will always be an order of magnitude slower than C/C++ compiler, kind-of by design.
- imron 2y agoLarge C++ projects aren't exactly known for their stellar compile times either. Coming from a C++ background, I don't find Rust compile times to be that bad for comparable sized projects in C++.
- pjmlp 2y agoWhich is exactly why we traditionally don't build the world from scratch in C++, rather rely on binary libraries for 3rd party dependencies, or component frameworks. Additionally rely on dynamic libraries during debug builds.
- imron 2y agoIncremental build times in rust are also on par (and often faster) with c++ on the similar sized projects I’ve worked on.
- pjmlp 2y agoExcept those other compilers offer multiple toolchains, including interpreters, that are faster than rustc. Standard ML, Idris, ..., F#, Haskell and OCaml have interpreters, and REPLs, in addition to the full blown AOT compilation. Naturally Rust can also have those, however they aren't here today.