Earlier quoted context omitted.
That is definitely true, but from the article it's the backend that takes time, not the frontend where the language itself resides. If you compile go from llvm, it maybe as long as rust.
It’s not just Rust. Practically every compiler based on LLVM is slow. Swift, Zig, Clang. The Go compiler being written from scratch based on the Plan9 C compiler is a huge advantage.
What part of Rust compilation is the bottleneck?
31–40 of 62 posts
Re: What part of Rust compilation is the bottleneck?
#32Earlier quoted context omitted.
OCaml compiles just as fast without having to compromise on the type system.
But then you have to compromise on speed of generated code, poor support of windows, number of libraries and overall ecosystem, no ability to generate standalone executables and probably more but I tried OCaml only briefly so can't speak to all of its shortcomings.
Go support on Windows is also not great, plugin package doesn't work, filesystem support assumes POSIX semantics, cgo requires installing mingw.
Re: What part of Rust compilation is the bottleneck?
#33Re: What part of Rust compilation is the bottleneck?
#34One reason for me moving from Rust to Go was compilation speed. Go is a simpler language, so apples to oranges, but Go compiles so fast, which to me makes development very different.
OCaml compiles just as fast without having to compromise on the type system.
My love for types peaked when I was in my mid-40s, now that I'm 50+ I want simple things.
Re: What part of Rust compilation is the bottleneck?
#35Re: What part of Rust compilation is the bottleneck?
#36These are my very subjective hobby benchmarks running archlinux on an AMD 9 7940HS.
Of course the initial build or the release build take much longer, but it makes me hopeful for the future.
Re: What part of Rust compilation is the bottleneck?
#37Earlier quoted context omitted.
OCaml compiles just as fast without having to compromise on the type system.
Some see it as a compromising on types, I don't. After some years writing Scala code, trying to come up with even better types each day, Go to me is not a compromise but a relief. My love for types peaked when I was in my mid-40s, now that I'm 50+ I want simple things.
Of course it is good to be reasonable - some people completely fly off into the FP world and instead of actually building working stuff they think all day about some clever abstraction and types to model it.
Re: What part of Rust compilation is the bottleneck?
#38Earlier quoted context omitted.
OCaml compiles just as fast without having to compromise on the type system.
Some see it as a compromising on types, I don't. After some years writing Scala code, trying to come up with even better types each day, Go to me is not a compromise but a relief. My love for types peaked when I was in my mid-40s, now that I'm 50+ I want simple things.
Re: What part of Rust compilation is the bottleneck?
#39Monomorphization. For every generic function f, rustc will generate as many instances as there are type instances (shape instances? Does the Compiler distinguish between different kinds of references that all get compiled to pointers?). This feature has a cost. Compare to OCaml's uniform object representation that enables comparatively blazing compilation performance but pays a prize in performance and weird FFI rest…
May I take the opportunity to ask, what’s the reason for Metas somewhat heavy use of Ocaml? What’s the appeal? You already pointed out the insane compilation perf.
Imagine the safety of Rust but looking more like Python (or Haskell...), the concurrency of Go (since V5), and without a borrow checker (but a GC instead).
Re: What part of Rust compilation is the bottleneck?
#40Earlier quoted context omitted.
May I take the opportunity to ask, what’s the reason for Metas somewhat heavy use of Ocaml? What’s the appeal? You already pointed out the insane compilation perf.
It's a pleasant and practical language to write, yet fairly safe. Imagine the safety of Rust but looking more like Python (or Haskell...), the concurrency of Go (since V5), and without a borrow checker (but a GC instead).