Hacker News new | ask | show | jobs
by TheApexTheater 1711 days ago
There are a couple of reasons why creating a self-hosting compiler can be good idea:

1. Shows to others that your language is capable of a project of moderate complexity, as well as display what an "idiomatic" version of writing code is

2. Remove dependencies on parts you can't control (once you rewrite it in Zig, rather than C++, you don't need to worry about new C++ features or deprecations between versions)

3. Writing code in the language helps catch bugs in the language specification and in the compiler's implementation of the language.

These are just the ones off the top of my head, but people with more PL-Design experience may be able to elaborate.

1 comments

Contributions are another one I think. Both the authors and potential collaborators might find it more attractive to use their language of choice. Compilers also tend to pose a variety of challenges that force one to really dig into a language.
Yep.

I know it's entirely other end of the language spectrum, but I think that's why Typescript got successful while Flow did not; Typescript is in Typescript, while Flow is in OCaml. And nobody knows OCaml.

OTOH, eslint is making waves now and it's in golang, so. Who knows.

I suspect that you might mean esbuild (not eslint).
I'm not a golang fan, but one thing I've noticed about go is that it is possibly the most approachable yet real programming language for beginners I've ever seen. I think this is part of why go is doing so well in the devops space. Sys admins who are not really well versed in programming but know enough to write some scripts here and there are able to bring their domain specific knowledge of admin tasks and write code to contribute.