News for hackers. Stuff that matters.
Re:Writing a C Compiler, Part 1 by DSMan195276 on Friday December 01, 2017 @02:42AM (#15822556)
I agree completely, and I would add that the compiler doesn't even need to compile down to a system/architecture that actually exists. You can make your own simple 'architecture' with a minimal list of instructions that wouldn't require much more then a loop and some switch statements to emulate, and you're free to design it in any way to make your life easier. For an architecture that's designed to be targeted by C, you likely don't even need registers and could just use memory operands for everything.
Re:Writing a C Compiler, Part 1 by SAI_Peregrinus on Friday December 01, 2017 @12:02PM (#15825190)
There's also a reasonable chance that if you're interested in compiler design and making an architecture you're the sort of person who would enjoy learning a hardware description language. With a cheap FPGA dev board you could then implement your toy architecture and run your compiled programs on that. This adds substantial difficulty to the project, but is damn fun.