4 ms·
Brian's choice to use C is perfectly well justified: "I am thinking that we should choose C to implement our PL/0 compiler. Eventually we will want to have thi
by foxfluff 5y ago
Brian's choice to use C is perfectly well justified:
"I am thinking that we should choose C to implement our PL/0 compiler. Eventually we will want to have this compiler run on many different platforms, including Unix, MS-DOS, and potentially even CP/M. C is a language that will run on every platform I would want to run our PL/0 compiler on, so C works for me. C also requires no special setup so our usual development platform of vim on OpenBSD will work just fine. Finally, it will help with bootstrapping the self-hosting version of the PL/0 compiler, since we in theory could natively compile the C implementation on our target platform then use that to compile the PL/0 implementation, also on the target platform."
The reader may learn something from these posts whether they choose to write a compiler in C or not.
- eatonphil 5y agoI don't mean to debate Brian's choice (your quote shows it does fall into my exception anyway) but mention to readers here why they may be more interested in following guides on compiling/interpreting implemented in other languages than C.
- fishmaster 5y agoC is actually a huge disadvantage here for me, since I have no use for it outside of this tutorial which makes it hard to justify learning it on top of learning how a compiler works...