News for hackers. Stuff that matters.
Re:Ask HN: Which TypeScript codebase should I study to get b... by mhermher on Thursday November 09, 2017 @11:32AM (#15663739)
Interested in that bootstrapping process. Is it just that the first version has to be compiled with some other language. From then on, you just use the previous version that you have compiled already?
Re:Ask HN: Which TypeScript codebase should I study to get b... by klodolph on Thursday November 09, 2017 @12:40PM (#15664253)
Yes, that is normal. If you can imagine, this process dates back to the first assemblers, which were written in assembly and then converted by hand to machine code.
Re:Ask HN: Which TypeScript codebase should I study to get b... by dcuthbertson on Thursday November 09, 2017 @12:54PM (#15664346)
From what I recall, start by writing a minimal compiler for language X in some other language, Y, and compile it. Now you have an X-compiler written in Y.

Rewrite the minimal compiler in X, and compile it using the one that was written in Y. That gives you an X-compiler written in X compiled from one written in Y.

To be sure _that one_ works, recompile your X source code with that last compiler. Now you have a compiler written in X and built with one also written in X.

Continue to add more features written in minimal-X to get X-compilers with more X features.

Re:Ask HN: Which TypeScript codebase should I study to get b... by pjmlp on Thursday November 09, 2017 @05:03PM (#15666211)
Just as small improvement, for the first step an interpreter is a better approach, just to ease the bootstraping process by not having to write a compiler backend twice.