How could one possibly bootstrap a C compiler(from source)?

Monke

I was looking into compiler bootstrapping, and I looked at how Golang implements bootstrapping from source, i.e., by building the last version of Golang implemented in C and using the generated executable to compile newer Go releases. This made me curious as to how the same could be done with C. Can you construct a C compiler on a computer with literally nothing present on it? If not, then how can I trust that the binary of the compiler I use doesn't automatically fill the binaries it compiles with spyware?

Related question, since the first C compiler was written in B and B was written in BCPL, what was BCPL written in?

Basile Starynkevitch

Can you construct a C compiler on a computer with literally nothing present on it?

The main issue is how (in 2021) would you write a program for that computer! And how would you input it?

In the 1970s computers (like IBM 360 mainframes) had many mechanical switches to enter some initial program. In the 1960s, they had even more, e.g. IBM1620.

Today, how would you input that initial program? Did you consider using some Arduino ? Even oscilloscopes today contain microprocessors with programs....

Some hobbyists today have designed (and spent a lot of money) in making - a few years ago - computers with mechanical relays. These are probably thousands times slower than the cheapest laptop computer you could buy.

You could also buy many discrete transistors (e.g. thousands of 2N2222) and make a computer by soldering them.

Even a cheap motherboard (like e.g. MSI A320M A-PRO) has today some firmware program called UEFI or BIOS. It is shipped with that program.... and rumored to be mostly written in C (several dozen of thousands of statements).

In some ways, computer chips are "software" coded in VHDL, SystemC, etc... etc...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How could comma separated initialization such as in Eigen be possibly implemented in C++?

How does one extract data from a string which possibly could get split by an optional comma character?

How could I possibly search a sorted binary tree any faster?

How could these alternate numpy `uniform` vs `random` constructions possibly differ?

How could I archieve this design with bootstrap 5? Spans stacked, one is inside the container one outside

in regex how could one match quotes and dots for c# programming

How to change background image based on screen size, possibly with Bootstrap

DOMException: Could not start video source with zxing and bootstrap 4 modal

I have a wordpress site. There is a form in one of the pages of the portal. How could I figure out the form source

How could I possibly debug "Couldn't find design note - undefined"?

How to access a possibly unexisting type-alias in C++11?

How to await multiple possibly uninitialized Tasks in C#?

In C#, how an method can be called on a possibly null instance?

What could this line of Javascript code possibly do?

How could I connect Windows C#, Android and Browser to one database using sockets. (Chat Application)

How could a thread return to a place different from the one it come from in C#?

How could I insert 2 borders in one Grid with c# code

How could one implement clone() method in TypeScript?

How could you combine these two scripts into one?

How to use map() with possibly()

How to possibly do this in ocl?

How it could be optimized [C++]?

How search for specific text in two columns with multiple criteria and with possibly more than one instance of key field?

How to return an array of objects in GraphQL, possibly using the same endpoint as the one that returns a single object?

Error compiling source code, possibly related to cpp

How to animate Bootstrap 4 cards one by one?

How could I commit to remote branch one by one automatically

How to completely bootstrap GHC & cabal from source

How to compile Bootstrap LESS source in VS 2013