If one views the CLR/.NET runtime and associated libraries as the future of windows, then the F# programming language could be seen in that light as the most native functional language. Meaning that it has support from the OS creator, presumably integrates best with their libraries, etc.

Is there a similar logical choice of language on the Mac OS X platform? While the most-native language itself is obviously Objective-C, is there a first-among-equals or most obvious functional paradigm language that stands out?

  • 1
    why the down vote? I know it is somewhat subjective, but seems like it does have a (potentially useful) answer?
    – sdg
    Nov 4, 2011 at 1:16
  • My downvote was because your question is based on speculative assumptions, which you don't back with any actual facts. But even if the premise of your question is somehow true (I'm not saying it isn't, just that you didn't make the effort to show it), still I would probably downvote because the listed criteria for choosing a language made me think you are looking for shopping advice, not choosing a language (that's a personal dislike). Sorry it took me so long to explain the downvote.
    – yannis
    Nov 4, 2011 at 3:34
  • @Yahhis Rizos - thanks for the details. My assumptions were not intended to be particularly speculative. Microsoft does support F# as their only/primary functional (non-research) language for .NET (that I know of), and it does therefore integrate well with .NET libraries, not clear what backing that would require. As far as shopping, that's why I tried to circumscribe my critera as best I could, but we may just disagree on these types of questions at all. thx
    – sdg
    Nov 4, 2011 at 12:48

3 Answers 3


Objective-C, as has been said, is the lingua franca for Mac development, if you want to hook in with Cocoa easily. That said, the best alternative language for Cocoa development is probably MacRuby, which is a Ruby implemented in Obj-C and can directly interface with Cocoa. It's not a functional language, it has some functional constructs. It's sorta developed by Apple (open sourced from Apple).

If you want a functional language for Mac OSX development, I think the best choice is Nu, which is a sorta-Lisp dialect built in Obj-C and can hook directly into Cocoa. It's not like F# (supported by the OS creator), but it is actively developed.


I"m just going to to throw this out there from outside the functional programming community...


Or, more formally, Objective-C++ since clang finished implementing the full c++11 spec.

Programming primarily in C++11 gives you strong support for immutable data structures, template meta-programming and you can use Apple's blocks across all of C, C++ and Objective-C code. Blocks are easier to use than C++ lambdas, see Mike Ash's comparison.

At the same time, you can trivially flip between Objective-C and C++ classes in the same source file, each can contain pointers to the others objects, so calling native code is inherent.

  • "Functional" is a pretty fuzzy term, but I think it takes more than C++11's lambdas and closures to win that label. Those features are useful, but they make C++ functional only in the same sort of way that you can write OO code in C. Besides, the "functional" umbrella tends to extend over other features like partial function application/currying, every-expression-has-a-value, immutability by default, function clauses, guards... One might also expect other things that aren't strictly FP, like pattern matching. Oct 9, 2013 at 5:06

Mac/OS is based on "Objective C". This is basically C with added OO. It pre-dates C++ and is generally considered a cleaner and simpler OO version of C, but, without the backward compatibility. This is definiately the way to go if you want to access the Mac/OS specific features like the "Aqua" GUI.

As Mac/OS is based on BSD unix, the full catalog of Unix languages is available C,C++, perl,Python etc. etc. etc. These all work well but are not so well integrated with the Apple "eye candy".

  • 6
    -1 Objective C doesn't predate C++. Both appeared in 1983, but Brad Cox and Tom Love started working on Objective C in 1981 and Bjarne Stroustrup began work on "C with Classes" in 1979, so C++ actually predates Objective C. Also saying that MacOS is based on BSD is not entirely accurate: MacOS X is based upon the Mach kernel, and it does include certain parts of NetBSD and FreeBSD via NeXTSTEP. MacOS X is based on NeXTSTEP (+other stuff) which in turn is based on BSD (+other stuff) would be a little bit more accurate.
    – yannis
    Nov 4, 2011 at 2:57
  • 6
    And of course "This is basically C with added OO", is extremely misleading. Objective C is basically C with Smalltalk-style messaging would be a better generalization...
    – yannis
    Nov 4, 2011 at 3:00
  • @YannisRizos Are you saying Objective C has no OO? Displacing "C with added OO" and replacing it with "C with Smalltalk-style messaging" is no less misleading.
    – Jason S
    Nov 4, 2011 at 4:40
  • @JasonS You are right. Any generalization is misleading. But I would argue that "C with Smalltalk-style messaging" is a little bit more accurate than "C with added OO" as Smalltalk-style messaging implies OO (so I'm not saying Objective C has no OO) and it also provides a correct historical background, as achieving Smalltalk-style messaging in C was the main reason Objective C was created.
    – yannis
    Nov 4, 2011 at 4:56
  • @YannisRizos Saying "MacOS X is based upon the Mach kernel" is not really any better. It would be more accurate to describe the OS X kernel as based on XNU, the BSD part of which provides the POSIX API, which is probably more relevant to this discussion than Mach, as it provides full POSIX compliance.
    – Jason S
    Nov 4, 2011 at 4:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.