Apple and C#?
when i wish upon a star
I was listening to Debug #32: John Siracusa on Copland 2010 in which the subject of Apple needing a next-generation language was discussed.
The elephant in the room seems to be why not take advantage of C#? Guy and John both seemed to dismiss it out of hand, but it hits all the requirements:
- It's an ECMA standard, Apple could participate on the committee or fork the language.
- It already supports functional and imperative styles
- It already has unsafe{} and fixed{} to allow pointers and pinning garbage collected objects, so it has clean ways of dropping down to manual memory manipulation when needed. Unlike Java, it has the notion of structs that are "toll-free" bridged with unmanaged code.
- Xamarin already has an implementation of a bridge. Depending on whether you think they did it right or not, Apple could buy them or do their own version that corrects the mistakes. There's also RemObject's implementation that adds Objective-C style message selectors (with spaces in the names) to C#.
- Foundation is already a separate layer under Objective-C. John kept bringing up the issue of needing a new API. Why isn't it a problem for Apple to have Core Foundation and Objective-C? Especially in light of #3, where in C# you can drop down if you need to.
- Dynamic supports the equivalent of
id
in Objective-C and the reflection (introspection) support is good. You can already do a lot of the fancy things people do in Objective-C like create classes at runtime. - You would get things like automatically managed memory, LINQ, Reactive (IObservable), and more.
- Async/Await would be a big improvement to writing responsive UIs since proper asynchronous code doesn't need to be "inverted" from the synchronous version (that's the point behind async/await a lot of people miss - you just write the code like you would write the non-async version and let the compiler do the work).
I don't see why Apple needs to re-invent the wheel here, but I'm ready to be convinced that I'm wrong.
edit: Guy pointed out the interview with Miguel de Icaza on Debug #31 . I've linked to it before but I think it is worth linking again: it's really good!
This blog represents my own personal opinion and is not endorsed by my employer.