Earlier quoted context omitted.
Well, OCaml Rust compiler also didn't use LLVM and used its own lightweight code generator and I think self-hosted Rust compiler frontend was in fact faster than OCaml Rust compiler frontend.
With both projects, how much of the improvement is simply building for the second time?
Zig self hosted compiler is now capable of building itself
101–110 of 285 posts
Re: Zig self hosted compiler is now capable of building itself
#102I was thinking of learning Rust but it seems a bit overkill due to manual memory management as compared to languages with similar speed like Nim, Zig, and Crystal. How would one compare these languages? Is it worth learning Rust or Zig and dealing with the borrow checker or manual memory management in general, or are GC languages like Nim or Crystal good enough? I'm not doing any embedded programming by the way, just…
Re: Zig self hosted compiler is now capable of building itself
#103Earlier quoted context omitted.
From talking to a Googler the reason why Google devotes resources to Kotlin is that there was and still is a large external demand from the Android development community for Kotlin.
Kotlin adoption was triggered from inside, with some anti-Java attitude. https://talkingkotlin.com/the-first-kotlin-commit-in-android...
Re: Zig self hosted compiler is now capable of building itself
#104Best alternative to C, built with solid foundation to ensure fast compile speed, fast iteration, and easy to maintain code
I don't understand why people want fast compile speeds so much. My day job is/was writing C on something that requires 30+ minutes for one compilation run. It feels like people want fast compilation speeds because they need to keep running their software for some reason. Fast compilation speeds are a nice to have but basically irrelevant for normal developing of software in my experience.
Re: Zig self hosted compiler is now capable of building itself
#105Earlier quoted context omitted.
Happy to see the C backend coming along. LLVM is a major barrier to use on esoteric embedded devices.
You can also target C through Wasm. https://github.com/WebAssembly/wabt/tree/main/wasm2c
The simple example in the README.md seems straightforward enough, but I wonder if there are any pathological explosions in practice.
Re: Zig self hosted compiler is now capable of building itself
#106Earlier quoted context omitted.
> written in Zig instead of C++, uses significantly less memory, and represents a modest performance improvement That's particularly interesting considering the rust compiler in rust has never been as fast as the original OCaml one
I wonder how much this statement still holds. I've never used the OCaml bootstrap compiler but performance wise, the rust compiler has improved incredibly since the 1.0 release.
Re: Zig self hosted compiler is now capable of building itself
#107Hello HN! Here is some context to decorate this announcement: The Zig self-hosted compiler codebase consists of 197,549 lines of code. There are several different backends, each at varying levels of completion. Here is how many behavior tests are passing: LLVM: 1101/1138 (97%) WASM: 919/1138 (81%) C: 740/1138 (65%) x86_64: 725/1138 (64%) arm: 490/1138 (43%) aarch64: 411/1138 (36%) As you might guess, the one that thi…
> written in Zig instead of C++, uses significantly less memory, and represents a modest performance improvement That's particularly interesting considering the rust compiler in rust has never been as fast as the original OCaml one
Re: Zig self hosted compiler is now capable of building itself
#108Re: Zig self hosted compiler is now capable of building itself
#109Earlier quoted context omitted.
I think Zig prefers explicit memory management, because allocations may fail and should be handled explicitly, and because automatic deallocations lead to hard-to-predict lifetimes (excess memory usage, and bugs for resource handles that are destructed at hard to predict moments). These are things that a "systems language" programmer should put in the work to do correctly/near-optimally, and not ask the compiler to j…
And as we know from C, every developer is quite capable of taking care of use after free possible bugs.
Re: Zig self hosted compiler is now capable of building itself
#110Best alternative to C, built with solid foundation to ensure fast compile speed, fast iteration, and easy to maintain code
I don't understand why people want fast compile speeds so much. My day job is/was writing C on something that requires 30+ minutes for one compilation run. It feels like people want fast compilation speeds because they need to keep running their software for some reason. Fast compilation speeds are a nice to have but basically irrelevant for normal developing of software in my experience.