Live data from Hacker News

I loved C. But it always fell short for me. Objective-C fixed that.

red-sweater.com

71–80 of 82 posts

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#71
post #64
post #56

Earlier quoted context omitted.

I dunno--in an age where we have actual, halfway decent garbage collection, referring to ARC as something that might compete favorably with those "real" high level languages makes my eyes go a bit crossed.

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. C programmers take a memory profile, deploy the appropriate pool/arena allocator, and get on with their job, comfortable with the fact that their former allocation bottleneck is now in the average case register-fast. ARC fits better with the C world of quickly tuning bottlenecks to register speed. Have you ever debugged C code…

People in 2011 lose weeks to tuning allocators and collectors in real high level languages.

But that's, statistically, almost no people out of 'people who use GC'. There aren't that many allocators in common use that even have much in the way of tunable parameters (I can only think of the JVM ones, offhand), the people who spend weeks tuning them have very particular needs - high throughput, low latency, high-enough complexity to warrant a high-level language. These are the sort of people who also do things like start at a PHP page and end up chasing performance improvements in the bowels of a network kernel driver. It's done, but it's unrepresentative.

ARC fits better with the C world

It seems like a much more central reason ARC is more suitable than a GC for Objective C than 'GC tuning is occasionally a dark art'.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#72

Earlier quoted context omitted.

That's an excellent page, thanks! This actually makes me wonder... how much overhead is in each objective c object over a similar struct in c?

In terms of size, they're almost the same (Objective-C classes are implemented with structs). In terms of speed, the difference is absolutely huge. You can generate a random number faster than you can make an Objective-C call. But, it's fast enough for 95% of things people do with it.

Objective-C message sends are not much slower than C++ virtual calls:

http://mikeash.com/pyblog/performance-comparisons-of-common-...

And that's from 2008. Clang's improved it a lot.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#73
post #71
post #64

Earlier quoted context omitted.

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. C programmers take a memory profile, deploy the appropriate pool/arena allocator, and get on with their job, comfortable with the fact that their former allocation bottleneck is now in the average case register-fast. ARC fits better with the C world of quickly tuning bottlenecks to register speed. Have you ever debugged C code…

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. But that's, statistically, almost no people out of 'people who use GC'. There aren't that many allocators in common use that even have much in the way of tunable parameters (I can only think of the JVM ones, offhand), the people who spend weeks tuning them have very particular needs - high throughput, low latency, high-enough…

What can I tell you here? You're right, of course: most apps don't care about performance at all, either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language.

I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but they're also disproportionately important apps.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#74
post #73
post #71

Earlier quoted context omitted.

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. But that's, statistically, almost no people out of 'people who use GC'. There aren't that many allocators in common use that even have much in the way of tunable parameters (I can only think of the JVM ones, offhand), the people who spend weeks tuning them have very particular needs - high throughput, low latency, high-enough…

What can I tell you here? You're right, of course: most apps don't care about performance at all , either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language. I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but…

I think eropple's point was that ARC is not a very high-level sort of approach to GC, i.e., not Lisp-style exact GC.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#75
post #73
post #71

Earlier quoted context omitted.

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. But that's, statistically, almost no people out of 'people who use GC'. There aren't that many allocators in common use that even have much in the way of tunable parameters (I can only think of the JVM ones, offhand), the people who spend weeks tuning them have very particular needs - high throughput, low latency, high-enough…

What can I tell you here? You're right, of course: most apps don't care about performance at all , either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language. I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but…

I think eropple's point was that ARC is not a very high-level sort of approach to GC, i.e., not Lisp-style exact GC.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#76
post #73
post #71

Earlier quoted context omitted.

People in 2011 lose weeks to tuning allocators and collectors in real high level languages. But that's, statistically, almost no people out of 'people who use GC'. There aren't that many allocators in common use that even have much in the way of tunable parameters (I can only think of the JVM ones, offhand), the people who spend weeks tuning them have very particular needs - high throughput, low latency, high-enough…

What can I tell you here? You're right, of course: most apps don't care about performance at all , either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language. I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but…

Ah, I read it more as 'It's 2011, where's my flying car/why aren't just about all apps running in managed environments'. Sort of like one says, 'It's 2011, why did syslogd just brick my server'. And it's not a completely lisp-machiny, neckbeardy sentiment, 10 odd years ago everyone was telling us the flying car was just around the corner - Apple was busily trying to bridge Java into Rhapsody, Microsoft was working on .NET/CLR. And yet, and yet...

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#77
post #54
post #34

I've only coded a (really) simple app in Obj-c, but disliked the syntax.

Now, I've coded a lot of stuff in Objective C for iOS, and it works just fine, and I actually think it's a pretty good language. I'm glad that Apple has helped bring it more into the spotlight. But ramitos is right; it really is a Frankensteinian bolt-on addition of Smalltalk, syntax-wise. The message passing code simply does not look like C. That said, I'd encourage everyone to give it a chance. I, too, had a negati…

> The message passing code simply does not look like C.

Arguably that's a very good thing, because passing a message has very different semantics from calling a function. Making the syntaxes of these operations identical would encourage a lot of confusion between two very different operations.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#78

Is anyone using Objective-C as a systems language? That is, without Cocoa and other Apple libraries and APIs? Otherwise, why is it worth comparing it to C? Is anyone suggesting that Linus could write the Linux kernel or git in Objective-C? Objective-C is more fairly comparable to Java, C#, Qt or GTK rather than plain C. Most people who say they like Objective-C actually mean they like programming for Macs and iPhones…

Yes, I am. And it is fine, either using ObjFW, GNUstep (which is essentially Cocoa) or just writing it raw with my own framework. It is a nice language, and the C apis to the runtimes are pretty nice.

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#79
post #74
post #73

Earlier quoted context omitted.

What can I tell you here? You're right, of course: most apps don't care about performance at all , either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language. I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but…

I think eropple's point was that ARC is not a very high-level sort of approach to GC, i.e., not Lisp-style exact GC.

That's right (sorry, forgot about this thread). Not saying that ARC is bad, for where it's used--but it doesn't strike me as terribly "high-level".

(Neither, though, does C++, and smart pointers don't help there either. ;) )

Re: I loved C. But it always fell short for me. Objective-C fixed that.

#80
post #76
post #73

Earlier quoted context omitted.

What can I tell you here? You're right, of course: most apps don't care about performance at all , either in space efficiency or time efficiency. Those apps shouldn't use C, and should certainly use a GC'd language. I'm only reacting to the idea that (pp) "because it's 2011, nobody should be using ARC". Well, a statistically tiny number of apps may require the bare-metal performance that hand allocation provides, but…

Ah, I read it more as 'It's 2011, where's my flying car/why aren't just about all apps running in managed environments'. Sort of like one says, 'It's 2011, why did syslogd just brick my server'. And it's not a completely lisp-machiny, neckbeardy sentiment, 10 odd years ago everyone was telling us the flying car was just around the corner - Apple was busily trying to bridge Java into Rhapsody, Microsoft was working on…

The last years I thought that Objective-C was perhaps not future-proof enough when MS pushed .Net more and more into being desktop class.

And now MS shows WinRT that is not .Net. Hmmm... :)

Post reply on HN