4 ms·
I am waiting for the milestone[1] for Zig to be able to bootstrap itself. Usually, this means the language is mature enough. [1] https://github.com/ziglang/zig
by xvilka 7y ago
I am waiting for the milestone[1] for Zig to be able to bootstrap itself. Usually, this means the language is mature enough.
[1] https://github.com/ziglang/zig/projects/2 https://github.com/ziglang/zig/projects/2
- PezzaDev 7y agoWhat are the advantages of this other than showing the language is competent enough that you can write a compiler for itself? Would it be better to keep a compiler written in a highly portable language such as c? Genuinely curious.
- jswny 7y agoI think it is usually considered a right of passage of a new programming language to prove that it is mature enough to self-host. Personally, I value that aspect highly because it means if I choose to work with a language that I can understand, read, and possibly contribute to the compiler if needed.
- tom_mellior 7y ago> Personally, I value that aspect highly because it means if I choose to work with a language that I can understand, read, and possibly contribute to the compiler if needed. You would have about the same if the compiler were written in a lingua franca. For whatever it's worth, I have in the past had to work inside the gfortran compiler, and I wouldn't have been able to do that if it were written in Fortran. Self-hosting (which nowadays often isn't "full" self-hosting, it's implementing a frontend and possibly parts of a mid-end only and letting a framework like GCC or LLVM do the rest) is useful because it proves that it has reached a certain level of maturity, as you say. Another advantage is that this gives you a non-trivial piece of software written in the language which can be used for testing and benchmarking. If you introduce a compiler bug, there is a certain likelihood that you will notice it immediately. This might not be the case if you only had small toy programs to test with.