Sunday, January 6, 2013

Objective-C is TIOBE Language of the Year Second Time in a Row

The TIOBE Index shows Objective-C as "Language of the year 2012". As it also won the honor in 2011, this now makes it only the 2nd language to win the award twice (Python won 2007 and barely edged out Objective-C in 2010), and the only one to win it twice in a row.

Although this surge in popularity is certainly largely due to the popularity of the iOS ecosystem (iPhone, iPad, AppStore), the fact that it continues despite Apple loosening its policies and alternatives popping up suggests that there may be more going on: maybe developers are discovering that Objective-C is a pretty fun and productive language, warts and all?

It'll be interesting to see wether Objective-C has now peaked, as Tiobe predicts, or wether it manages to expand back into other areas that could benefit from its qualities.

As last year, table and graphic reproduced here because Tiobe doesn't appear to keep an archive:

Position

Jan 2013

Position

Jan 2012

Delta in Position

Programming Language

Ratings

Jan 2013

Delta 

Jan 2012

Status

1

2

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

C

17.855%

+0.89%

  A

2

1

http://www.tiobe.com/content/paperinfo/tpci/images/Down.gif

Java

17.417%

-0.05%

  A

3

5

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Objective-C

10.283%

+3.37%

  A

4

4

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

C++

9.140%

+1.09%

  A

5

3

http://www.tiobe.com/content/paperinfo/tpci/images/Down.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Down.gif

C#

6.196%

-2.57%

  A

6

6

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

PHP

5.546%

-0.16%

  A

7

7

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

(Visual) Basic

4.749%

+0.23%

  A

8

8

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

Python

4.173%

+0.96%

  A

9

9

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

Perl

2.264%

-0.50%

  A

10

10

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

JavaScript

1.976%

-0.34%

  A

11

12

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Ruby

1.775%

+0.34%

  A

12

24

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Visual Basic .NET

1.043%

+0.56%

  A

13

13

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

Lisp

0.953%

-0.16%

  A

14

14

http://www.tiobe.com/content/paperinfo/tpci/images/Same.gif

Pascal

0.932%

+0.14%

  A

15

11

http://www.tiobe.com/content/paperinfo/tpci/images/Down.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Down.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Down.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Down.gif

Delphi/Object Pascal

0.919%

-0.65%

  A

16

17

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Ada

0.651%

+0.02%

  B

17

23

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

MATLAB

0.641%

+0.13%

  B

18

20

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Lua

0.633%

+0.07%

  B

19

21

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Assembly

0.629%

+0.08%

  B

20

72

http://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gifhttp://www.tiobe.com/content/paperinfo/tpci/images/Up.gif

Bash

0.613%

+0.49%

  B

Tpci trends 2013

Saturday, December 22, 2012

Android NDK now includes clang with Objective-C support

Apparently, the Android NDK started including clang in ndk-r8c. The Google folk had always disabled Objective-C from their gcc ports, making Objective-C support that much more difficult to achieve, but I had a hunch that disabling Objective-C from clang may well have been more effort than it's worth.

I just tried it with a vanilla, freshly downloaded ndk-r8d and a small Objective-C program compiled without problems, so it looks like my hunch was correct.

Of course, it didn't link because there is no runtime, but providing one is a much smaller effort than reconfiguring the entire toolchain. After that, it gets interesting...

Update: after getting a runtime, it linked and ran on my Galaxy II test phone.

Wednesday, November 7, 2012

Cocoa / Objective-C performance course at Kloster Eberbach

Stefanie Seitz is organizing a Cocoa / Objective-C performance course at Kloster Eberbach, held by yours truly, December 9-12th.

I am sure it'll be fun and hope it will be instructive. If you're interested, give Stefanie a shout!

Update: December was a bit optimistic for all involved, so we're tentatively moving this out to the beginning of March. I'll post the exact date once it has settled.

Thursday, November 1, 2012

CGLayer performance and quality

The CoreGraphics CGLayer object seems to keep causing confusion. I hope I can clear that up a bit.

The intent of CGLayer was to have some sort of object for optimized repeated drawing, similar to how you would call a drawing procedure multiple times, have multiple instances of a view or simply draw the same PDF or bitmap image multiple times. The difference was supposed to be that the drawing layer could do secret magic "stuff" to optimize the repeated instance drawings. Not giving away the specific representation or optimizations performed means that whatever is done can be adapted both to different contexts and with changing technology.

Currently, that primarily means a texture stored on the graphics card, and that is and was one of the possible optimizations. However, the reasoning for such an opaque optimized object goes back further, at least to NeXTStep/Rhapsody: DisplayPostscript was implemented as a server process, and despite Mach's fast memory-remapping messages, shipping images back and forth between the client and server was not an optimization, and so you couldn't use (client side) bitmaps for optimized drawing. Well you could, but it wouldn't be optimized.

With Quartz becoming a client-side drawing library in Mac OS X, some of the reasons for these distinctions disappeared, but the distinctions (such as NSBitmapImageRep vs. NSCachedImageRep) remained. I think there were plans for CGLayer to become a kind of NSCachedImageRep on steroids, for example maintaining OpenGL display lists, but as far as I could tell, those plans never really panned out: in my tests drawing a CGLayer always looked the same as drawing a cached bitmap, and also performed similarly.

In 10.5, most of the accumulated cruft was cleaned up, NSBitmapImageRep for examples is now only a fairly thin wrapper around its underlying CGImage, and NSCachedImageRep was deprecated completely in 10.6, as it no longer has any advantages. With these changes, drawing a CGImage or a NSBitmapImageRep became as fast as possible, with CGImages stored on the graphics card. At this point CGLayer was essentially abandoned, and for drawing to the screen, you can just as easily use a NSBitmapImageRep, CGImage, UIImage etc.

So is CGLayer now completely useless? Not quite! It turns out that when drawing to a PDF context, CGLayer will generate a PDF Form object, which stores the original drawing commands (vectors, text, images). This is obviously much better than drawing a bitmap, both in terms of quality and in terms of file size and performance.

So if your plans include printing or generating a PDF, then I would recommend taking a look at CGLayer for repeated drawing of (vector) content.