• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is CoreAudio C++ not Objective-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is CoreAudio C++ not Objective-C?


  • Subject: Re: Why is CoreAudio C++ not Objective-C?
  • From: Christopher Penrose <email@hidden>
  • Date: Wed, 20 Oct 2010 21:47:23 -0700

I disagree with Brian.  I began coding Objective-C on the NeXT in 1990 and I have finally accepted that vanilla use of the Objective-C runtime is not appropriate for low-latency real-time audio systems.  I haven't tried it yet, but there may be some interesting ways around the latency of message binding in the run-time as suggested in articles like this:  http://it.toolbox.com/blogs/macsploitation/bypassing-objectivecs-message-passing-mechanism-for-speed-24946

I have minimal C++ experience, a general dislike of its inelegant syntactical heft, but I really don't believe it was purely provincial preference that C++ was used in parts of CoreAudio.  It pains a part of me to say it, but It is better suited to the task of AudioUnits than Objective-C.  A computer language has its strengths -- a dynamic language is a higher latency language by design.   The important question:  does the additional latency matter?  I have found in many real-time applications that it does.

It would be nice, however, if examples did not use C++ (or Objective-C for that manner) when not necessary.  While I have been writing nothing but Objective-C for months for my current project, all of my direct audio code is written in c99.  There are a few SDK examples that had useful code written in C++ unnecessarily that required translation.  Despite Apple's best efforts the egregious namespace schism of Objective-C++ is something my company avoids like the plague.  But we will have to have a few .mm files I guess if we venture into custom AudioUnit design for some project.  It makes sense to me that an example demonstrating a c99 interface should be written only in c99.

Christopher Penrose

---------------------------------------
Sent from my Casio VL-Tone



On Oct 19, 2010, at 9:18 PM, Brian Willoughby wrote:

>
> On Oct 19, 2010, at 20:50, Chris Share wrote:
>> I'm just about to embark on some AU programming (porting a Windows VST plugin to
>> AU).
>>
>> I'm curious as to why CoreAudio contains C++ and is not entirely Objective-C?
>
>
> It took Apple a decade or more to fully accept ObjC, because not every developer came from NeXT.  The CoreAudio development effort started at least three years before Mac OS X was released, and certainly long before ObjC was fully understood by the company at large.
>
> Keep in mind that the Cocoa UI for AudioUnits is only a somewhat recent addition, or so I recall.  Originally, AudioUnits seemed to only support Carbon, and thus there was no ObjC at all in CoreAudio except for the non-CoreAudio parts of a host application.
>






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why is CoreAudio C++ not Objective-C?
      • From: "B.J. Buchalter" <email@hidden>
References: 
 >Why is CoreAudio C++ not Objective-C? (From: Chris Share <email@hidden>)
 >Re: Why is CoreAudio C++ not Objective-C? (From: Brian Willoughby <email@hidden>)
 >Re: Why is CoreAudio C++ not Objective-C? (From: "Ross Bencina" <email@hidden>)
 >Re: Why is CoreAudio C++ not Objective-C? (From: Paul Slocum <email@hidden>)

  • Prev by Date: Forcing "Live" mode on a Logic track from Audio Unit
  • Next by Date: Re: Why is CoreAudio C++ not Objective-C?
  • Previous by thread: Re: Why is CoreAudio C++ not Objective-C?
  • Next by thread: Re: Why is CoreAudio C++ not Objective-C?
  • Index(es):
    • Date
    • Thread