About Nu

Hello and welcome to Nu.

I created Nu because I believe that we can do better at writing software. I also believe that the language we use makes a difference.

Writing software has gotten easy, but writing good software is still hard, especially when projects get large. Three things can make it easier to write better software:

  • Reducing the amount of code that we write. This is easier when we use more expressive languages.
    But watch out, reducing is not eliminating. When someone offers you a way to eliminate code, often they're just reshuffling your code into a different form, and it's often an opaque proprietary form that locks you into their opaque proprietary tools.
  • Reusing components that we or others have already written. This is easier when our languages provide well-defined mechanisms for reflection and dynamic binding.
    Reflection and dynamic binding give power to people. They give people who use software the ability to assemble their software systems at runtime, which means that they have the flexibility to replace and upgrade components. People who build software benefit even more; they can use reflection and dynamic binding to create specification tools that ensure that the components they use do exactly what they want.
  • Recycling code from past projects. This is easier when our languages allow us to write programs that treat code as data.
    There are many things that we can do when our code is data. Automatic code formatting and automatic documentation extraction are two simple examples. Code generation and transformation tools go much further.

Nu directly addresses each of these three areas.

What's Nu?

Nu is an interpreted object-oriented language. Its syntax comes from Lisp, but Nu is semantically closer to Ruby than Lisp. Nu is implemented in Objective-C and is designed to take full advantange of the Objective-C runtime and the many mature class libraries written in Objective-C. Nu code can fully interoperate with code written in Objective-C; messages can be sent to and from objects with no concern for whether those messages are implemented in Objective-C or Nu.

Why did I write Nu?

No existing language had the expressiveness and power that I wanted.

I wanted to write software with a language as flexible and powerful as Lisp, but I also wanted to be able to work with the many libraries and high-performance subsystems written in C, including the ones that I write myself. I also wanted a language that worked well with native threads.

Unlike other Lisp-like languages, for Nu, a tight integration with C was a top priority. That led me to build Nu on Objective-C and drove many other details in the implementation of Nu. The need to play well with C is what makes Nu "C over lambda."

Why build on Objective-C?

It is easier to integrate with C when you have a disciplined way of structuring C code. Popular scripting languages (Python, Ruby, Lua, etc.) make many implementation-dependent impositions on the C code that they call. Their artifacts are often called "glue code" and are usually ugly, cumbersome, and unpleasant to generate.

The Objective-C language is a proven technology for structuring C code in a way that allows run-time introspection and dynamic binding. These features allow Objective-C components to be bound to scripting languages with no component-specific glue code. But Objective-C can do much more. Objective-C can also serve as a platform for a powerful dynamic language. Nu was designed to take full advantage of that.

The Ruby Factor

Nu was also designed to provide many of the elements of successful scripting languages, notably Ruby, while adding the syntactic simplicity and flexibility of Lisp. Some of the elements that Nu draws from Ruby include:

  • Consistent object-orientation. In Nu, everything is an object.
  • The use of sigils to indicate variable type. A leading "@" denotes instance variables, "$" marks global variables, and "__" marks a variable as a generated symbol (generated symbols are used to write macros, which Ruby lacks).
  • The use of here strings and string interpolation.
  • Utilities: The Nu distribution includes a templating facility similar to Ruby's erb, and the Nu build tool, nuke, is modeled on Jim Weirich's rake.

System Requirements

Nu currently requires Mac OS X 10.7 or iOS 4.3 or greater.

Legal Details

Nu is open-source software that is copyrighted by Radtastical Inc. It is released under the Apache License, v. 2.0.

Except for attributed quotations, the text of this website is copyrighted by Radtastical Inc. and may not be reproduced without express permission. Permission is hereby granted for attributed quotes and excerpts containing up to 25% of an article.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.