"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Thursday, May 01, 2008

Objectively

"Rubinius switched from C to C++ to implement it's core VM"

For the life of me I cannot understand why projects use C++ rather than Objective-C. Hmm.

Catching up on comments to this post...

Yeah, I can be too brief sometimes. Here's the essence of what I like about ObjC vs. C++. ObjC attempts to keep the Obj and the C distinct, while C++ attempts to combine them. As a result the Obj in ObjC is very much like the Obj in Smalltalk. And the C on Obj C is very much like the C in ANSI C.

The Obj in C++ is significantly more complicated than the Obj in Smalltalk or in ObjC. The C in C++ is also significantly more complicated, to the point where I don't think it can be called "C". People will talk about the expressiveness of C++ and how much it has evolved over the years. I still very much prefer the simplicity of ObjC.

I am also surprised the ObjC has portability issues. With the GNU implementation?

And I am surprised about the Ruby kernel issue as well. I also thought this would be so small to warrant just C or even better, a subset of Ruby that compiles easily into C. This is what Squeak uses for its kernel. Gambit Scheme does something along the same lines, allowing a very C-ish dialect of Scheme that translates directly.

4 comments:

Anonymous said...

My understanding is that Obj-C is still seen as "that Mac language". I'd never thought about using it on anything but the Mac till you mentioned it here.

Anonymous said...

Sadly, Objective-C has never been and looks like it never will be truly portable. I say this as someone who has used it on various platforms from 1992 to the present.

Pete Kirkham said...

Compiler support, community, personal experience, performance concerns, better static type checking, template metaprogramming.

Or maybe they just want more people on the project.

Though I'd have thought the Objective C object model was closer to Ruby's, it doesn't really matter - you either want an exact match, or you want something which you know how to create good code in. Even fewer people know how to create good Objective C code than C++.

I am rather surprised there's enough code in the VM to warrant doing it in anything other than C though (or C which uses C++ syntax and stronger type checking). For a reflective language, you want the code model to be in the input language, not the VM implementation language. Writing lots of code in the implementation language for performance reasons implies that your VM's JIT isn't performing well enough, and won't help application code.

Anonymous said...

I know you go for brevity in your posts, but it would be good for someone like me - who knows nothing about Objective C - to hear what is good about it.

I remember iD used it at one point. And Apple is standing by it, in spite of many other language developments over the years. So what's awesome about Objective-C? More to the point, what is awesome about it that I won't find on the first page of my google results when I search for it?

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.