4 ms·
The author seems to be confusing about the runtime of a programming language and the power to extend a language. I would attribute the extensibility of javascri
by hsuresh 18y ago
The author seems to be confusing about the runtime of a programming language and the power to extend a language. I would attribute the extensibility of javascript for a jQuery like library.
- DLWormwood 18y ago> 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.)
- eru 18y agoWhy? Using that logic, Haskell should be in a easy set-relation with C, too, since compilers often translate Haskell to C.
- shaunxcode 18y agoI 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.
- halo 18y agoThe original C++ compiler, Cfront, was also a preprocessor/compiler down to C.
- scott_s 18y agoUsing 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.
- DLWormwood 18y ago> 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.)
- troels 18y agoYou seem to imply that there is a strict difference. I don't really see it. C code compiles down to machine code, so does that make C a library? And how about the lisp macro system, or dsl's where does that fit? How about frameworks? I definitely think there is a lot of greys between language and library.