Skip to content

Instantly share code, notes, and snippets.

@jspahrsummers
Created July 11, 2012 09:33
Show Gist options
  • Save jspahrsummers/3089293 to your computer and use it in GitHub Desktop.
Save jspahrsummers/3089293 to your computer and use it in GitHub Desktop.
What programming language or environment features are important to you?

Many Cocoa programmers, myself included, want a more modern programming language than Objective-C, and a more modern programming environment than Cocoa. There's been some talk about what would better fit the bill, and engineers are ready to build that solution, but the question first needs to be answered – what are the most important problems to solve?

I've created the following unordered list of hypothetical goals for improvement to Cocoa/Objective-C, and would like to see how important each one is to the community. If you're interested in sharing your opinion, please fork this gist and order the below list. Feel free to add anything that you think might be missing.

Thanks!

Potential Goals

  • Functional programming, where function application is the main way to invoke code. This does not refer to using objects in a functional style.
  • Referential transparency, also sometimes known as purity or immutability.
  • Easy parallelization, meaning it should be easy to make code run concurrently without ill effect.
  • Algebraic data types, in addition to or instead of Objective-C objects and inheritance.
  • Statically typed, to catch type errors at compile-time. This does not necessarily imply a C-like type system – many modern languages support type inference, among other things.
  • Powerful metaprogramming, to automate code generation or extend the language with itself.
  • Easy to learn (although subjective, it's still interesting to rank it against other goals).
  • Self-hosting, where the toolchain is written in the language/environment itself.
  • Compiled, instead of interpreted. This could mean compilation to an intermediate language (like Objective-C, C, or LLVM IR), not necessarily machine code.
  • Performant – in other words, how important is performance relative to expressiveness and flexibility?
  • Not Cocoa-specific, so that it is easy to port or slightly modify code to run without Cocoa frameworks. This mostly just implies the use of a language that already exists and is used for other purposes.
  • An existing body of open source code, available for use within a Cocoa project.
  • Can be invoked from Cocoa code – not having this implies always invoking Cocoa instead.
  • Can invoke Cocoa code – not having this implies always being invoked from Cocoa instead. Note that invoking Cocoa and being invoked from Cocoa are not mutually exclusive (but one is necessary).
  • Can define Objective-C classes, protocols, categories, etc. in the language itself. This doesn't imply anything about being able to link to custom Objective-C code.
  • Usable for AppKit/UIKit GUIs, in addition to being usable for a model layer (which is a requirement).

Note that this list does not, and is not meant to, capture the advantages and disadvantages of each line item.

@jspahrsummers
Copy link
Author

@jonathanpenn Thanks!

@jspahrsummers
Copy link
Author

For what it's worth, here's my list (with things I don't care about omitted):

  1. Can be invoked from Cocoa code
  2. Functional programming
  3. Statically typed
  4. Algebraic data types
  5. Referential transparency
  6. Powerful metaprogramming
  7. Easy parallelization
  8. Can invoke Cocoa code
  9. Can define Objective-C classes, protocols, categories, etc.
  10. Usable for AppKit/UIKit GUIs

@jonsterling
Copy link

jonsterling commented Jul 13, 2012 via email

@jspahrsummers
Copy link
Author

@jonsterling Well, this is why I personally prioritize referential transparency over invoking Cocoa. I favor the approach that @joshaber was proposing, whereby functional code can be embedded in an Objective-C program on a "call-into" basis (perhaps with some bridging of immutable Objective-C objects). Then there are no conflicts between the two models.

EDIT: Also, referential transparency is less important to me than static typing, which Clojure definitely does not have (to any serviceable extent).

@jonsterling
Copy link

jonsterling commented Jul 13, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment