OSCON '08 Proposal
I’ve submitted this proposed talk to the O’Reilly OSCON in Portland this July. If you have ideas or suggestions to help improve it, let me know!
Nu: Uniting the Powers of Lisp and C
Description
Nu is an open-source scripting language written in Objective-C. It looks like Lisp, but has many semantic similarities to Smalltalk, the parent language of both Ruby and Objective-C. It builds a dynamic scripting capability on Objective-C that eliminates glue code and at the same time provides all the expressive power of a language where code is data.
Abstract
Modern scripting languages have brought revolutionary increases in programmer productivity. Besides being adaptable to many important specific tasks, scripting languages have also proven useful for “exploratory programming”, in which working high-level prototypes smoothly evolve into full implementations. Since most scripting languages are written in C, performance-critical functions and special-purpose libraries can be supported with C extensions. But these extensions almost always require instance-specific “glue code” that must be generated and maintained for each extension, and because of this glue code, the boundary between scripting language and C is awkward and inflexible. Modern scripting languages also include many powerful abstractions based on patterns originally developed in Lisp. But in their preference for ALGOL-style grammars, they make tradeoffs that leave them lacking the full expressive power of Lisp.
Nu is a high-level language that directly addresses these two limitations. Written with a Lisp-style grammar, Nu supports closures, macros, and first-class functions and has all the power of a language where code can be easily manipulated at runtime. But like the old physics joke, Nu is “C over lambda”, and its main goal is to provide a greatly simplified interface to C. To achieve that, Nu is written in Objective-C. It uses Objective-C’s reflective runtime to dynamically build message-passing interfaces between objects written in Nu and objects written in Objective-C. This allows Nu to fully interoperate with Objective-C with no glue code; from both languages, messages can be sent to and from objects with no concern for whether those messages are implemented in Objective-C or Nu.
Nu was released in October 2007 as an open-source project and has a small and growing community of users. Because of the extensive use of Objective-C in Apple’s OS X, Nu is especially well-suited to the development of applications using Cocoa, Apple’s NeXTSTEP-based framework, and the presentation will include many examples showing how Nu complements Cocoa. But Objective-C’s usefulness extends beyond a single platform, so we will also discuss ongoing work to use Nu on other platforms using a completely open-source component stack.
Biography
Tim Burks is an independent software developer based in Northern California. After spending a year exploring the combination of Ruby and Objective-C, he began a project to create a new language to fully exploit the power of high-level languages and Objective-C.
Comments (1) post a reply
I have to thank you. i stumbled across your language while looking for some way to do dynamic function definitions in ObjC. Lisp is my natural home (after doing work in Fortran, C, Pascal, Java, Python) and I was actually about to try implementing a very simple Lisp in ObjC to get access to Cocoa. Beautiful work. Thanks.