Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's why the word "boot" is there


https://en.wikipedia.org/wiki/Bootstrapping in case someone reading this doesn't know.


Partly related:

The process of bootstrapping a compiler (not an operating system) is really interesting and the method used is ingenious.

I had read about it some years back.

Basically, at high level, it's a kind of chicken and egg situation:

After writing a compiler for language A (in language A), where A is a new language, how can you compile that compiler to an executable, so that you can compile application programs written in A?

Because there is not yet any runnable compiler for A.

I might not have described the issue very well.

And the concept of cross-compiling also comes into the picture, depending on the situation.

I don't remember the details perfectly now.

If somebody else who knows, describes it, I think it would be interesting for many people here.

Some links:

https://en.m.wikipedia.org/wiki/Bootstrapping_(compilers)

https://en.m.wikipedia.org/wiki/Cross_compiler


As I see it, the point of bootstraping a compiler is to develop a compiler in stages and that it doesnt require you to implement the full compiler in the original language.

For example, let's say you create a new language called Brute. You decide to write it in C (original language).

Stage 1: Create a Brute compiler in C, which can compile only a small subset of Brute language. Lets call it bruteC compiler.

Stage 2: Implement a compiler in Brute lang and compile it using your bruteC compiler. This produces brute-compiler executable.

Stage 3: Add new feature to your brute compiler source code and compile it using your brute-compiler executable, which produces new brute-compiler executable.. .

And so on... At the end your brute-compiler supports all language features and thus is self hosted.


Nice, thanks.


Uh, TIL.

I knew the bootstrapping expression and origins, but as a second language speaker it had never occurred to me that “boot” as verb was related.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: