Programming Nu on GitHub
Nu and related projects are now in the programming-nu organization on GitHub.
Nu-2.1.0
Nu now includes built in operators for generating HTML and other XML-style markup.
For usage examples, see the test/test_markup.nu unit tests.
As a simple example, this Nu code:
(puts (&html (&body (&h1 "Hello!")
(&p "This is a test")
(&p "This is a second paragraph"))))
produces the following output:
<!DOCTYPE html><html><body><h1>Hello!</h1><p>This is a test</p><p>This is a second paragraph</p></body></html>
You'll note that no line breaks or formatting is included. These can easily be added with xmllint:
%nush sample-markup.nu | xmllint --format -
<?xml version="1.0"?>
<!DOCTYPE html>
<html>
<body>
<h1>Hello!</h1>
<p>This is a test</p>
<p>This is a second paragraph</p>
</body>
</html>
Also, the Nu source formatter (in beautify.nu) now produces prettier output.
Download Nu here.
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.
Nu currently requires Mac OS X 10.7 or iOS 4.3 or later.
Nu-2.0.1
This minor update contains better handling of classes whose init methods return something other than self, notably NSXMLDocument. It also changes loading of modules to use a single shared parser so that assignments made in a loaded file are available in the calling context (as they should have been).
This build was made from the "amalgamated" branch. Soon this branch will become "master". As with 2.0, this version of Nu is exclusively for systems running Mac OS 10.7 or iOS 4.3 and their successors.