February 22, 2008 — nu
Last week Colin Barrett suggested that I take a look at SmallSockets, a lightweight Objective-C wrapper for BSD sockets. Today I downloaded the code, built it as a framework, and ran it through a few simple exercises with Nu. Like its name suggests, SmallSockets is simple, but that also means that it’s really easy to use.
Here’s a quick demo.
Continue reading →
January 07, 2008 — nu
When Dave Dribin pointed out the new Objective-C wrapper for MacFUSE, I took a quick look at its interface. It’s super-nice and easy to use from Nu. As a quick demo, I ported one of the MacFUSE examples
to Nu and then modified it to create a read-only filesystem based on nested dictionaries.
The code is in the NuFUSE.git repository at code.neontology.com. To run it, you’ll need to install the lastest MacFUSE and use a Nu that you’ve built from my git repository. Leopard-only.
UPDATE
After Bill Bumgarner released his nifty RuntimeFS for viewing classes in the Objective-C runtime, I decided to try the same thing with Nu. The result is objcfs,
a single-file nush script that implements a file system as a daemon. As a bonus, objcfs also shows class and instance method descriptions.
March 13, 2008 — nu, iphone, linux
The Nu git repository now contains all the source code and related build tools to build Nu for Linux and the iPhone. iPhone support is currently for the simulator only, and so far, I have only tested Linux support on Ubuntu 7.10 running in VMware Fusion.
While there’s a lot of interest in the iPhone, the Nu Linux support is what has me the most excited.
Details are on Programming Nu.
March 21, 2008 — nu, speaking
Many thanks to Jonathan Rentzsch for posting this video of my talk!
Continue reading →
November 25, 2007 — nu, cocoa
This weekend I used Snapz Pro to make my first screencast. Call me lazy: I did it in one take and there’s no audio, but I think the result is pretty good for a first try. It’s also given me a couple of ideas for more online demos to do soon.
Click here to read more and to see my screencast.
Thanks to Jonathan Rentzsch for twitter-coaching me in screencasting and for compressing my video.
September 30, 2007 — nu
It is time to unleash Nu on the world.
You can download Nu and read all about it at my new web site, Programming Nu.
To all who waited, thanks for your patience.
I especially appreciate those who helped review and test a preview of Nu, notably Matt Mower, David Phillip Oster, Colin Barrett, and Patrick Thomson. I’m hoping to work more with each of them and with others who want to help me answer the question “What’s Nu?”
February 16, 2008 — nu
With many Cocoa design patterns, getting started is the hardest part. Distributed Objects is a perfect example of this. Run these two scripts to see how simple Distributed Objects can be. It’s all Nu, so there’s no compilation necessary. Be sure to use Nu-0.3.0 or later.
Continue reading →
March 08, 2008 — nu
Nu’s not a bad little language for processing text. The key is to take advantage of the many features of the Foundation classes.
Here’s a small example that might help you the next time that you’re playing Scrabble.
Continue reading →
March 10, 2008 — nu, github
Last week I put a git repository for Nu on github. Over the weekend, I started pushing some of my smaller open source projects there, too. I think that github is a great, great tool, but that its value comes from something bigger than a site design, git, or any of the projects that it hosts. Let’s talk about that.
Continue reading →
March 06, 2008 — nu, iphone
The first iPhone app in Apple’s sample code is a simple program called HelloWorldClassic. That’s also the first iPhone app to be rewritten in Nu, and I’m guessing that means it’s the first app written in any interpreted scripting language that runs on the new official iPhone SDK.
Want to help me test it?
Continue reading →
August 20, 2008 — nu
The NSProcessInfo class is a handy resource for Nu scripts that need to know something about themselves and their operating environment. To get details on NSProcessInfo, check the online Apple documentation or just introspect the class in nush, the Nu shell:
% (puts ((NSProcessInfo instanceMethodNames) description))
Continue reading →
February 01, 2008 — nu, linux
Lately I have been working on a version of Nu that I have modified to run on Linux. For now, it’s running on Ubuntu (Server 7.10), but other distributions can be easily supported. As you might imagine, there are several things that make this interesting.
Continue reading →
February 07, 2008 — nu, linux
Here’s an update on my port of Nu to Linux.
Dependencies
So far I’ve been running on Ubuntu 7.10 in VMware and using debuggable versions of libobjc and libFoundation that I built from source. Nu also depends on libffi, and on Linux it uses the “stock” libffi that Ubuntu and Debian users can install with apt-get.
Continue reading →
August 30, 2007 — nu
I have been testing Nu by bootstrapping a small set of tools for software development. As they’ve matured, I’ve come to rely on them daily. Some of them required some thought and an occasional new feature in Nu, but none needed much code or time to develop. They aren’t as many-featured as some of their alternatives, but they are lean, clean, and do just what I need.
Continue reading →
September 05, 2007 — nu
Nu has had while and until operators for a couple of months now, but I had put off trying to support break and continue. This morning I realized that I could use an existing Objective-C pattern to add them easily (one of many reasons to take regular showers). The key was to use exceptions.
Continue reading →
October 17, 2007 — nu
Timely observations by Steve Dekorte:
A language that uses objects on the bottom can use them for everything, but a language with closures on the bottom needs other types or “atoms” for things like numbers, lists, etc and then scatter around functions for operating on those other types. If you care about simplicity, consistency and organization, this is a big difference.
Beginning with Nu-0.2.0, Nu includes full support for Lisp-style closures.
Continue reading →
September 17, 2007 — nu, ruby, meetup, speaking
A reminder: I’ll be giving a preview of Nu at the SF Ruby Meetup tomorrow night.
Since time is limited, it will mostly be a demo session. I’m planning to show some of the things that I did at C4 [1], talk a bit about my reasons for writing Nu, show a couple of small random examples, and then close with a fun multithreaded desktop app.
January 07, 2009 — nu, iphone
January 07, 2009 — nu
Here is “plister”, a trivially short Nu script that I use to display property lists of all formats. It requires a recent build of Nu with the NSObject readFromPropertyList: extension.
#!/usr/local/bin/nush
(set ARGV ((NSProcessInfo processInfo) arguments))
(set filename (ARGV 2))
(puts ((NSObject readFromPropertyList:filename) description))
Here’s an example showing usage:
Continue reading →
September 03, 2007 — nu
I’d like to get some feedback on at least one aspect of Nu before anyone else becomes dependent on it: the use of sigils to indicate the type of a name binding.
Continue reading →
September 10, 2008 — nu
Ever wonder what’s inside those .webarchive files that are saved by Safari? It turns out that they are just property lists, a common representation that Apple uses for externalizing structured data. Here’s a short Nu script that opens a saved webarchive file and prints its contents.
Continue reading →
December 31, 2007 — nu
Here’s a little script that dumps the contents of your address book and your iCal events for the past year. The iCal part uses the Leopard-only CalendarStore interface.
Continue reading →
January 13, 2008 — nu
Following John Franco, here is a definition of the Y combinator in Nu:
(function Y (X)
((do (procedure)
(X (do (arg) ((procedure procedure) arg))))
(do (procedure)
(X (do (arg) ((procedure procedure) arg))))))
Continue reading →
March 23, 2008 — nu
While it’s not my favorite environment, it’s certainly possible to use Nu from within Xcode. That’s especially useful for platforms that have undocumented dependencies on Xcode. Here are some tips.
Continue reading →
October 03, 2007 — nu
It’s been interesting to see all the discussion about Nu. Now I understand why professors and public speakers ask questioners to identify themselves. Anonymous comments seem a lot more hostile than ones that come with names attached.
Some common questions have come up and rather than get into the various threads, I’ve pulled them together into a Frequently Asked Questions about Nu page on Programming Nu.
October 17, 2007 — git, nu
Many visitors to Programming Nu have already seen this, but now that Nu development has gone public, I’ve switched from Subversion to git for version control. So far my only problem has been stupidly typing “git clean” before committing files (don’t do that!).
But everything else has been great, including having gitweb to browse my repository on the web.
Continue reading →
March 06, 2008 — nu, iphone
The iPhone SDK was released today. It looks like it’s going to be a lot of fun.
Continue reading →
August 16, 2007 — nu, ruby, meetup, speaking
Bosco gave me some time to talk about Nu at the SF Ruby Meetup.
BRIDGES and BEYOND – Tim Burks will present the latest twist on his RubyObjC bridge, a new language written specifically to be a glue language for Objective-C. In a lot of ways it’s like Ruby, but in one important way, it’s Lisp. You might say that it’s “Ruby with Parentheses”, but it’s called Nu, and it’s not just for the desktop. We’ll take an in-depth look at a blog server written in Nu that has a built-in Objective-C webserver, a Nu page templating engine, and an ActiveRecord-style ORM based on Apple’s CoreData framework.
Tuesday, September 18, 6pm.
March 24, 2008 — nu
Here’s a small example that implements the same method in Nu and in Objective-C. In this case, we’ll look at the method that allows us to index arrays with integers, which lets us do things like this:
[Oxygen:~/Desktop/Repositories/Nu] tim% nush
Nu Shell.
% (set a (array 'x 'y 'z))
<NSCFArray:361620>
% (a 1)
y
Continue reading →
January 06, 2008 — nu
Check out Nuki,
Patrick Thomson’s new wiki project that’s entirely implemented with Nu.
Patrick reused lots of existing components to build Nuki: NuMarkdown, NuHTTP, CoreData, and Nu itself. He also recycled from the still-infantile Nudge, the issue tracker that I’ve been writing with Nu (which has recently gotten some helpful patches from Louis Gerbarg, watch for those to appear in the git repo soon).
See Patrick’s announcement
for the source and more detail on Nuki.
August 14, 2007 — nu, events, speaking
I’m back home after spending yesterday with my family on the Santa Cruz boardwalk. While we were getting tossed around on the rides, someone found a URL that crashed NuBlog (such a dumb name—someone please suggest a replacement), and that had my blog down for the afternoon.
Many thanks to Wolf Rentzsch for giving me the chance to speak at C4 [1], and to everyone for all the kind words, backchannel chatter, and blog coverage.
Continue reading →
November 09, 2010 — clouds, google-app-engine, mongodb, epub, nu, nukit, xmachine, stackmob
Today I spoke at 360iDev in Austin about work that I'd been doing to evaluate and build some different ways to create APIs and data services for iOS apps. As an experiment, I put my presentation materials in EPUB form and presented with iBooks and an Elmo document camera.
Here's a link to my EPUB. To read it on your iPad or iPhone, add it with iTunes.
Get Ahead In The Clouds! (EPUB)
Contents:
-
APIs 101
-
Google App Engine
-
Building APIs with MongoDB
-
APIs for Objective-C Geeks
-
If that's not easy enough, One More Thing (StackMob)
May 27, 2008 — nu
Late last week I got a copy of the new edition of Aaron Hillegass’
Cocoa Programming for Mac OS X,
and since then I have been porting examples from selected chapters to Nu. To organize and share the results, I posted a
git repository
and since then, Adam Solove and Jonathan Yedidia have pitched in to help with the conversions.
So far, we’ve covered 12 of the 33 chapters that contain code examples, and I hope to get the rest converted in the next few weeks.
If you’d like to contribute, get the source for the original examples from Aaron’s Big Nerd Ranch site, and after you’ve finished a conversion, grab a github account, fork my repository, commit and push your changes up to your fork, and then send me a pull request.
To make things easier, here are some tips for converting existing Objective-C projects to Nu:
Continue reading →
March 08, 2008 — nu
Here’s how you can use Distributed Objects to remotely evaluate code on your simulated iPhone. This is obviously not for shipping applications, but I think you’re going to want to know how to do this when you’re debugging your app.
Continue reading →
August 19, 2009 — blogging, nu
This blog is now running in the cloud. That’s not very special in itself; lots of other blogs and web sites run on cloud servers. It’s running on Debian Linux; that’s not very special either. But this blog is built with Nu and Objective-C.
Continue reading →
April 04, 2008 — nu
Here is a Nu version of Marcus Crafter’s RubyCocoa screen capture script. It doesn’t add anything new to Marcus’ script; it just shows how the same underlying interfaces can be used from Nu.
Continue reading →
August 11, 2007 — nu
Ask a physicist and you’ll get the answer to a well-known riddle. “What’s Nu?,” it’s “c over lambda”. Physicists use the Greek letter nu to represent the frequency of light, which can be expressed as its speed c divided by its wavelength lambda.
Nu also is the name I chose for a project that relates a different C to a different lambda. Nu is a new programming language that binds the expressive power of Lisp to the pervasiveness and machine-level efficiency of C by building on the power and flexibility of Objective-C.
A major goal of Nu was to make it easier to build and reuse software components. Consistently with that, Nu was built from many preexisting components and many well-developed ideas. There’s not much that’s new about Nu except for its particular combination of recycled parts.
Continue reading →
December 17, 2007 — nu
There’s a new tool in the Nu source distribution. It’s called nubake, and you can use it to “bake” Nu source files into compiled objects. I won’t call it an obfuscator because Nu has a way of making everything open, but nubake can be useful for simplifying Nu applications and giving them a bit of tamper-resistance.
Continue reading →
February 24, 2008 — nu, threads
One of the big problems I had with the Python and Ruby bridges to Objective-C was that neither Python nor Ruby worked well for multithreaded programs. For both, the best we could hope was to use them on an application’s main thread. But if you (like I) wanted to use a scripting language to write actions to be run on other threads, you were out of luck.
But Nu is different.
Continue reading →
March 04, 2008 — nu
August 19, 2007 — nu
OK, I realize that until there’s a release, some people might consider this hype. But since a
few
skeptical
readers
have asked, “where’s the code?”, here’s the ubiquitous
currency converter
example, ported from Phillipe Mougin’s F-Script
to Nu.
Continue reading →
December 12, 2007 — nu, cocoa
By now we’ve seen plenty of toy demos of the various scripting language bridges to Cocoa. The word is out that scripting languages can be used to build significant applications, but the gap between demonstration and reality still seems wide. Also, it’s not easy to compare and qualify bridges. Microbenchmarks miss the point; as a developer, I want to know “can this bridge go all the way with me?”
And, “if I get stuck, then what?”
Continue reading →
March 02, 2008 — nu, actors
The Actor model of programming was presented in 1973 by Carl Hewitt, Peter Bishop, and Richard Steiger. You can find their original paper online and their ideas can be found in many contemporary programming languages, including Erlang and Io.
An actor is an abstract encapsulation of computation that makes it easier to represent multiple concurrent streams of control. One way to see actors is as objects that run in their own dedicated threads; messages are sent asynchronously from actor to actor, and each actor concurrently receives and responds to its messages, often by sending new messages to other actors.
I’ve written a short Nu program that sketches a pattern for actor-oriented programming in Objective-C. Except for its use of Nu blocks (a.k.a. anonymous functions), my entire example could be easily rewritten in Objective-C, and with a certain loss of flexibility, message selectors could be used instead of Nu blocks to build a purely Objective-C solution. But once you’ve seen it in Nu, you may not want to go back.
Continue reading →
August 17, 2007 — nu
I think that experienced programmers will find that Nu is surprisingly simple, mainly because there’s so little that’s really new about it. I reused a lot of existing Objective-C objects and idioms and drew nearly everything else from Lisp and Ruby. To me, Nu is as much a cherry-picked set of idioms as it is a language.
Here are some details.
Continue reading →
November 29, 2007 — nu, cocoa
Are you getting tired of waiting for Wil Shipley to release Delicious Library 2?
I hear that he is adding the ability to publish your library online. But why wait? Here’s a web server that you can inject into Delicious Library and start sharing your library today. It’s primitive, but you can easily customize it to your heart’s delight. It’s the same web server that I used in my screencast, and it is built using NuAnywhere, which ships with Nu and NuHTTP, a reusable web server component that I wrote to plug into Cocoa applications.
Continue reading →
December 14, 2008 — nu, linux
I have an experimental Debian package that contains a Nu interpreter built for Debian Etch (4.0). This Nu is built to use the GNU Objective-C runtime and GNUstep-base, the GNUstep open-source equivalent of Apple’s Foundation classes.
With GNUstep support, “NuFound” (aka libFoundation) support is dropped. GNUstep is actively maintained and adds at least one very important feature (UTF-8 support) that is missing in libFoundation.
All source code changes for this build are now in my Nu github repository and I will soon also add a nuke task to build the Debian package.
Please be aware that this is very new. So far it has only been tested in a VMware image, but because it is based completely on stock Debian components, I think it will hold up well.
A link and more details are below.
Continue reading →
December 19, 2007 — nu
I was recently asked for an Objective-C to Nu conversion guide. That’s a good idea, and although it’s not yet written, I have a few example conversions online that may be helpful. One big one is NuPagePacker, my Nu port of Aaron Hillegass’ open-source PagePacker program. I’ve also posted the git repository for NuAnimatingViews, a port of the AnimatingViews example in the Leopard Developer Tools. That example uses CoreAnimation and required some improvements to Nu that aren’t in any existing release. To run it, you’ll need to either build your Nu from my git repository or wait for the next release of Nu.
After looking back over my code and the glimpses I’ve gotten of other people’s Nu code, here are some thoughts on the substance and style of programming in Nu:
Continue reading →