Re:Show HN: My own C compiler (just for fun)
by apk17 on Wednesday June 15, 2016 @05:02AM
(#11907996)
Horribly. C++ has so many features, and interactions between them, that you really don't want to be dragged into that as a toy project. I'd wager that the C++ language spec is longer than the source of a functional C compiler (both without the standard libraries).
[ Parent
| on HN ]
Re:Show HN: My own C compiler (just for fun)
by userbinator on Wednesday June 15, 2016 @07:49AM
(#11908671)
Maybe the interactions aren't actually the issue because the features are quite orthogonal and independent of each other, and the complexity is really the natural result of the interactions between them. If I wanted to write a C++ compiler I'd probably start by adding features in this order:
- Member functions in structures; constructors; destructors
- Single inheritance
- Virtual functions
- Exceptions
- Multiple inheritance
- Virtual inheritance
- Templates
There's definitely more I haven't listed, but the first few don't seem too difficult...