Hacker News new | past | comments | ask | show | jobs | submit login

Why didn't Apple just have their front-end emit GNU C with #line directives?



It would have probably been far more annoying to compile to something like that. I've not programmed in Objective C but I believe that it was designed to avoid some of the issues that arose out of C++ being originally a preprocessor like that on top of C. Given that they wanted to do that, having to compile to some kind of IR, then to C, they would have likely had a much harder time getting the code optimized in any reasonable manner. I would also imagine that this would make debugging any part of the compiler that ended up producing incorrect code far more difficult to do.


Again, this was NeXT; not Apple.

I believe that the early Objective-C compiler did emit C.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: