-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't see any assembly code for a self-hosting compiler #91
Comments
it needs to be bootstrapped with an existing compiler, once that is done you can use 8cc to compile 8cc and can forget about the existing compiler. that is what is meant by self hosted. |
Here's an idea. Write a compiler for a very simple, minimal language in asm. Then use that language to write a compiler for a slightly more complex language with more abstractions. Then write your C compiler in that. The way 8cc can be bootstrapped, is by using gcc or clang, since those already exist. You could also ask this guy. |
Thanks Elronnd. I knew this way , was just looking for assembly code(using which a c compiler has been implemented) to read . There are a lot of self hosted compiler code but I could not find in an assembly lang. |
@0decimal0 Your definition of self-hosting is not the one I have seen for years [https://en.wikipedia.org/wiki/Self-hosting_(compilers)](Wikipedia definition and history of the term). Bootstrapping is the name of the process for getting a compiler to run on and for a target machine. Sometimes people bootstrap starting with assembly, others start by cross-compiling. |
A self-hosting compiler involves writing a rudimentary compiler for a language X(Here C) in another language (Suppose assembly), I can't find any assembly or any other language used for compiling a code . I have been googling my wits out to find at least a simple guide to write a compiler in assembly for C language . Your blog is the closest one I found but still I don't see any .
The text was updated successfully, but these errors were encountered: