News for hackers. Stuff that matters.
Re:What part of Rust compilation is the bottleneck? by KingOfCoders on Saturday March 16, 2024 @05:03AM (#39724358)
One 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.
Re:What part of Rust compilation is the bottleneck? by pjmlp on Saturday March 16, 2024 @08:03AM (#39725149)
OCaml compiles just as fast without having to compromise on the type system.
Re:What part of Rust compilation is the bottleneck? by KingOfCoders on Saturday March 16, 2024 @08:33AM (#39725358)
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? by naasking on Saturday March 16, 2024 @09:08AM (#39725565)
I'd call that disillusionment with bad type systems, which are indeed unnecessarily complex. We have yet to achieve a typing "nirvana", but we're getting closer IMO.
Re:What part of Rust compilation is the bottleneck? by margorczynski on Saturday March 16, 2024 @09:01AM (#39725520)
From my experience this simplicity is something you pay the price along the way - development is harder (a good typing gives you a lot of hints about functionality and puts bounds on developers on how to use it) and more error prone (less stuff gets caught by the type checker, instead you find it out in runtime).

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? by pjmlp on Saturday March 16, 2024 @12:58PM (#39727499)
I am almost 50, and my point of view on Go from 2012 has hardly changed.

http://lambda-the-ultimate.org/node/4554#comment-71504

At least it does generics now.

Re:What part of Rust compilation is the bottleneck? by sigsev_251 on Saturday March 16, 2024 @03:20PM (#39728682)
> At least it does generics now

Not in gccgo

Re:What part of Rust compilation is the bottleneck? by pjmlp on Sunday March 17, 2024 @04:42AM (#39732907)
Indeed, as you see on other remarks from me I am aware of it, my point was about the language as designed, not the implementations ecosystem.

TinyGo also doesn't do them.

Re:What part of Rust compilation is the bottleneck? by kjksf on Saturday March 16, 2024 @08:16AM (#39725239)
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.
Re:What part of Rust compilation is the bottleneck? by pjmlp on Saturday March 16, 2024 @08:24AM (#39725301)
OCaml optimizations are certainly better than Go compiler that hardly does inlining and only recently got some PGO support, and those that care about using LLVM or GCC backends have to compromise on fronteds that still don't do generics.

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? by sigsev_251 on Saturday March 16, 2024 @10:24AM (#39726205)
> using LLVM backends

Wait, there is an LLVM based Go toolchain? I thought the Go crowd was known for their NIH obsession.

Re:What part of Rust compilation is the bottleneck? by pjmlp on Saturday March 16, 2024 @11:03AM (#39726536)
TinyGo.
Re:What part of Rust compilation is the bottleneck? by makapuf on Saturday March 16, 2024 @05:33AM (#39724467)
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.
Re:What part of Rust compilation is the bottleneck? by GrumpySloth on Saturday March 16, 2024 @06:16AM (#39724649)
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.

Re:What part of Rust compilation is the bottleneck? by kjksf on Saturday March 16, 2024 @08:18AM (#39725262)
Minor correction: Go compiler used to be a modification of Plan9 C compiler, then a Go port of that modification but then it was completely rewritten as a SSA-based compiler so today it has almost nothing to do with the original Plan9 code.
Re:What part of Rust compilation is the bottleneck? by rvdca on Saturday March 16, 2024 @08:08AM (#39725179)
I will chime in to day that rust is also building a alternative to the LLVM backend in the form of cranelift : https://github.com/rust-lang/rustc_codegen_cranelift
Re:What part of Rust compilation is the bottleneck? by txdv on Saturday March 16, 2024 @07:20AM (#39724897)
Zig is moving away from LLVM. Its already has its own backend targeting debug builds for x86 and arm. ReleaseFast and ReleaseSmall is an entire different beast, but its going to be tackled eventually.
Re:What part of Rust compilation is the bottleneck? by KingOfCoders on Saturday March 16, 2024 @05:46AM (#39724520)
I wonder why we do not split up compilation more - especially for web developer. Rust does this a little with "check", C with "-O".

I want fast compilation for my dev cycle or for unit tests, I want slow compilation with optimizations, escape analysis, correctness etc. for production (the distinction between a compiler and linter is also not clear, some compiles do what linters do in other languages).

Re:What part of Rust compilation is the bottleneck? by jokethrowaway on Saturday March 16, 2024 @05:55AM (#39724555)
We do, you have profile configuration for dev or for release

You can get pretty big differences in terms of compile speed / binary size

Re:What part of Rust compilation is the bottleneck? by IshKebab on Saturday March 16, 2024 @11:17AM (#39726655)
Giving up entirely on the compile time of "performance" builds can be bad too though, e.g. for people writing games, audio software, etc.
Re:What part of Rust compilation is the bottleneck? by bluGill on Saturday March 16, 2024 @01:21PM (#39727711)
Only if you need to test the full game. If you can unit test algorithms and learn something then fast builds matter.
Re:What part of Rust compilation is the bottleneck? by anonyfox on Saturday March 16, 2024 @06:28AM (#39724689)
second that. also another point: I write most Go code using only the stdlib, so there is no dependency web to take care on top of the actual code.
Re:What part of Rust compilation is the bottleneck? by KingOfCoders on Saturday March 16, 2024 @06:49AM (#39724755)
I also have much less dependencies with Go compared to other languages, especially in TS.