news.volyx.in

A possible new back end for Rust (jason-williams.co.uk)

526 points by obl · 2360 days ago · 218 comments on HN

Article summary

The article discusses the possibility of using Cranelift as a new backend for the Rust programming language, which could potentially improve compilation times. Cranelift is a code generator written in Rust, developed by the Bytecode Alliance, and is designed to generate code fast using parallelism. The author presents benchmark results showing that Cranelift can compile Rust code faster than the current LLVM backend. The use of Cranelift as a backend could also allow for more control over code generation and optimization, and could potentially lead to a fully Rust-based toolchain.

Main themes

  • compiler technology
  • Rust programming language
  • Cranelift backend
  • LLVM
  • compiler optimization
  • toolchain diversity
  • contribution and maintenance
  • compilation time vs code optimization

What commenters say

  • Having a diverse set of compiler technologies is beneficial for the programming community, and Cranelift provides a viable alternative to LLVM.
  • The Rust community would benefit from a fully Rust-based toolchain, which would allow for easier contribution and maintenance.
  • The use of Cranelift as a backend could lead to faster compilation times, but may not match the optimization capabilities of LLVM.
  • The complexity of LLVM is a significant barrier to contribution and maintenance, and a simpler backend like Cranelift could be more appealing to developers.
  • The goal of a compiler should be to produce fast and efficient code, rather than just fast compilation times.
  • A fully Rust-based toolchain would allow for better integration and optimization of the language, but may not be worth the effort and resources required.
  • The LLVM monoculture is a result of its high quality and flexibility, rather than any deliberate attempt to suppress alternative technologies.
  • The trade-off between compilation time and final code optimization is a complex one, and different use cases may prioritize one over the other.