Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The author seems to be confusing about the runtime of a programming language and the power to extend a language.

He wouldn't be the first... Objective-C (the big language of the moment due to its use on the iPhone) was originally designed to be a preprocessor in front of a vanilla C compiler, which reduces most of the syntax additions down to one single library call. (This makes it a strict superset of C, unlike C++, which isn't perfectly backwards compatible with C.)



Using another language as your target (such as an Objective-C compiler outputting C, or Stroustrup's original C++ implementation, Cfront, outputtting C) guarantees no relationship to the target language. If Objective-C is a strict superset of C (which I have no knowledge of), it is not because C was the target language.

Also, it's not accurate to call something a "preprocessor" just because its target language is a subset of the language it supports. It's a compiler - a source-to-source compiler, yes, but still a compiler.


> It's a compiler - a source-to-source compiler, yes, but still a compiler.

This was kind of my original point. The very first version wasn't a compiler, just a collection of pre-processor macros. I didn't have the opportunity to work with the language back when the bracket syntax was still macro'ed, but there were still some design warts in ObjC when I started before gcc was modified to support more modern, Java-like extensions to the language.... (I've written code that used the macro based NS_DURING/NS_HANDLER/NS_ENDHANLDER instead of the modern compiled @try/@catch/@finally version.)


Why? Using that logic, Haskell should be in a easy set-relation with C, too, since compilers often translate Haskell to C.


I think the difference is that obj c is a superset in that it supports all of the functionality/sytnax of c and then adds more.


The original C++ compiler, Cfront, was also a preprocessor/compiler down to C.




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

Search: