Survey: What are you doing with Nu? What do you want to do with Nu? What do you want to add to Nu?

117 views
Skip to first unread message

Tim

unread,
Sep 15, 2010, 10:03:17 PM9/15/10
to Programming Nu
This seems like as good a time as any for a survey. I'd appreciate as
many answers as we can get to these three questions. I'll start:

1. What are you doing with Nu?

Nu is my primary (only) scripting language. I use it to write quick
scripts to do system tasks, to do data processing and prep for iOS
apps, and to help my kids answer questions like "how many words in the
English language end with a unique 3 letters?" I'm also using Nu to
build web apps and APIs. Currently I've got a blog, a custom URL
shortener, a web site for my wife, and a couple of backends for iPhone
apps that are written with Nu. I'm currently not doing any direct
Cocoa or iOS development with Nu, but I think that's mainly because
the web/cloud is more interesting to me right now.

2. What do you want to do with Nu?

I'm working on better ways to host and deploy web apps and APIs
written with Objective-C and Nu. Some of my projects are running on
Rackspace nodes running Debian 5, others run on Mac OS 10.6 on an
Xserve or a Mac Mini. Eventually I'd like to make hosting and running
these apps as easy as running apps on Google App Engine.

3. What do you want to add to Nu?

I'm not feeling much pressure to add features to Nu, but some of the
things that I'd like to see include a) finishing the integration of Nu
and Objective-C blocks that Philip White started b) some toy projects
that use LLVM to generate code from Nu source and c) some performance
analysis and testing of Nu apps that use garbage collection vs. retain/
release memory management (but I'm not working on any of these right
now because I'm busy working on my answer to question 2).

your turn,

Tim

Jason Grossman

unread,
Sep 15, 2010, 10:10:12 PM9/15/10
to program...@googlegroups.com
> 1. What are you doing with Nu?

Running it on FreeBSD and MacOS. Learning it for fun. Playing with extensions, all of which so far have turned out to be silly or fruitless — e.g. a prototype-based version.


> 2. What do you want to do with Nu?

I'm considering writing a wiki server in Nu. (I know, like the world needs yet another wiki server ... only actually it does, because I nobody else's server has quite the balance of simplicity and features that I'm after.)


> 3. What do you want to add to Nu?

To Nu itself: a few things just for fun but nothing important. To the project: ideally, better packaging on non-Mac systems. Sadly, I'm not really competent to do that myself and probably never will be.

Jason

Brian York

unread,
Sep 15, 2010, 10:20:36 PM9/15/10
to program...@googlegroups.com
On Wednesday, September 15, 2010, timb...@gmail.com (Tim) wrote:

>This seems like as good a time as any for a survey. I'd appreciate as
>many answers as we can get to these three questions. I'll start:
>
>1. What are you doing with Nu?

Mostly writing scripts. Although my workplace (STScI) has mostly
settled on Python as the
way-to-do-everything-that-doesn't-need-C, I've found that, if
I'm the only one who has to use the scripts, then Nu handles
them quite well. In particular, I find Nu to be a wonderful way
of retrieving data from our SQL databases, and making the Nu
query builder was both faster and easier than convincing ITSD to
give me the necessary permissions to install the necessary
python modules on my system.

>2. What do you want to do with Nu?

Mostly scripting at the moment, mixed with teaching myself lisp
by trying to implement the CL functions/macros found in "On Lisp".

>3. What do you want to add to Nu?

The one thing that I'd really like to add is the ability to
import external packages. I've hacked something together based
around a nu-import macro that I wrote, but it would be nice to
make it less failure-prone and better integrated into the
language itself. Still working on that though.

-Brian
--
Brian York <pole...@gmail.com>
Proud Member of the Society for the Conservation of Angular Momentum
Visit the society web site at <http://briany.chaosnet.org/bio/scam.html>
Or visit my web site at <http://briany.chaosnet.org/>

Caio Chassot

unread,
Sep 15, 2010, 10:35:07 PM9/15/10
to program...@googlegroups.com
On 2010-09-15, at 23:03 , Tim wrote:
>
> 1. What are you doing with Nu?

I ended up finding Nu rather useful to play with live Cocoa, eg. injecting the console into a running app, or just loading nush and playing with Cocoa objects interactively.

> 2. What do you want to do with Nu?

I started digging into Nu because I wanted to use with with iOS. Haven't had the time yet, tho.


> 3. What do you want to add to Nu?

Succinctness. Nu itself and lisp in general are rather terse, this in stark contrast to Objective-C and the Cocoa frameworks. Same as MacRuby has HotCocoa to weed out the verbosity, I'd like Nu to have an equivalent library to help me keep it short.

That would range from simple things, like a join function, to do away with componentsJoinedByString, to more magic stuff like in HotCocoa that allows you to build GUIs out of a line or two of code.

I don't think these should be added to core Nu, but having a central officially sanctioned library with this purpose might be a good move.

I'd love to revise my -after macro and create -before and -around, and their class method equivalents too. I think these would be a great fit for such a library, exposing a lot of the power of Nu and bringing much needed succinctness to method swizzling.

Philip White

unread,
Sep 15, 2010, 10:45:47 PM9/15/10
to program...@googlegroups.com
On Sep 15, 2010, at 9:03 PM, Tim wrote:

This seems like as good a time as any for a survey. I'd appreciate as
many answers as we can get to these three questions. I'll start:

1. What are you doing with Nu?

Primarily I use it as a debugging tool while developing my shareware (I use F-Script about as often for this task). I've also used it to write a few fairly complicated scripts that I use everyday.


2. What do you want to do with Nu?

I want to use it in my shareware more, but I find I have a trouble debugging Nu. As a test run I wrote a large amount of the code for an in-house application that supports one of my shareware apps. I really enjoyed it, and probably saved a lot of lines of code, but I think I lost time on the debugging. If anyone has tips on this regard, I'm all ears.


3. What do you want to add to Nu?

Not much, other than finishing the C blocks project if someone else doesn't do it first (I got kind of derailed on that when I ran into a bug in Apple's objc runtime.) I have dreams of writing an Objective C wrapper to GSL and using Nu as the front end, but I'm unsure if it will be as useful as I imagine.
'
-Philip White



--
You received this message because you are subscribed to the Google Groups "Programming Nu" group.
To post to this group, send email to program...@googlegroups.com.
To unsubscribe from this group, send email to programming-n...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/programming-nu?hl=en.


Brian York

unread,
Sep 15, 2010, 10:53:43 PM9/15/10
to program...@googlegroups.com
On Wednesday, September 15, 2010, phili...@mac.com (Philip White)
wrote:

>2. What do you want to do with Nu?
>
>I want to use it in my shareware more, but I find I have a trouble
>debugging Nu. As a test run I wrote a large amount of the code for an
>in-house application that supports one of my shareware apps. I really
>enjoyed it, and probably saved a lot of lines of code, but I think I
>lost time on the debugging. If anyone has tips on this regard, I'm all
>ears.

I frequently have the same trouble. I find that Nu's exception
reports are not generally especially enlightening (I find I miss
Python most when trying to figure out which line of code my Nu
script is crashing on).

Caio Chassot

unread,
Sep 15, 2010, 10:58:43 PM9/15/10
to program...@googlegroups.com
On 2010-09-15, at 23:53 , Brian York wrote:
>
>> I want to use it in my shareware more, but I find I have a trouble
>> debugging Nu. As a test run I wrote a large amount of the code for an
>> in-house application that supports one of my shareware apps. I really
>> enjoyed it, and probably saved a lot of lines of code, but I think I
>> lost time on the debugging. If anyone has tips on this regard, I'm all
>> ears.
>
> I frequently have the same trouble. I find that Nu's exception reports are not generally especially enlightening (I find I miss Python most when trying to figure out which line of code my Nu script is crashing on).

Indeed. Reliable stack traces sorely needed.

Matt Rice

unread,
Sep 16, 2010, 5:13:00 AM9/16/10
to Programming Nu
On Wed, Sep 15, 2010 at 7:03 PM, Tim <timb...@gmail.com> wrote:
> This seems like as good a time as any for a survey. I'd appreciate as
> many answers as we can get to these three questions. I'll start:
>
> 1. What are you doing with Nu?

Unfortunately my answer to this question is 'not a whole lot at the moment',
I have hacked up Nu for tab completion (but it only partially e.g. a
single part of a method)
so it will gladly tab complete e.g. (NSArray
performSelector:withString:) a non-existent method.
this works for me, but is less than intuitive

> 2. What do you want to do with Nu?

I would like to leverage aspects of the original openstep design,
that it was a cross platform middleware ported to a non-posix platform
to a new non-posix platform and investigate the usage of the API
in capability based security models.

the hope is that this will allow me to get a relatively high level API
up and running quickly without writing a complete posix emulator,
and allow me to use nu as a general purpose interpreter there.

I think nu will really play an important part, in that it will allow me to do
some hands on programming on the system without necessarily having
to be completely self hosting.

> 3. What do you want to add to Nu?

I would like to get good tab completion and a form of integrated
objective-c to nu documentation
similar to the 'help' function of guile, which allows one to document
a method in objective-c,
and access that help through nu (using the tab completion.)

it has been a while since i've looked at nu so maybe the situation has changed.

Louis-Philippe Perron

unread,
Sep 16, 2010, 9:43:27 AM9/16/10
to program...@googlegroups.com
> 1. What are you doing with Nu?
At the moment, exploration.  I encountered Nu about a week ago and I like it.  Seems to have the power to deliver.

> 2. What do you want to do with Nu?
OSX and iOS apps in Nu, with server side in Nu.
Simple, simple, simple. 

> 3. What do you want to add to Nu?
Nack?
the Nu web application interface...  seems to work great with Rack in the Ruby world and WSGI for Python.
+ handlers for nginx and Apache...  ideal scenario would have Nack working with Phusion Passenger (mod_rack).  

Blake Winton

unread,
Sep 16, 2010, 11:36:00 AM9/16/10
to program...@googlegroups.com
On 10-09-15 10:03 PM, Tim wrote:
> This seems like as good a time as any for a survey. I'd appreciate as
> many answers as we can get to these three questions. I'll start:
>
> 1. What are you doing with Nu?

Trying to solve some of the Project Euler problems.
And mostly re-learning Lisp/Scheme.

> 2. What do you want to do with Nu?

I'ld like to re-write my not-yet-submitted iPhone app in Nu, mostly
because I can now, and have it be accepted. :)

> 3. What do you want to add to Nu?

1) Something like ctypes or jsctypes for those times I want to call a
non-Objective-C-wrapped library.

2) A better debugger would be really nice, for those times I don't write
my programs perfectly the first time. ;)

3) A really simple iOS graphics library, something along the lines of
what's in Plua. <http://wikiplua.sourcedreams.com.br/index.php/Manual>

I guess that's more "What do I hope was added to Nu?". I'm not sure I
could add much myself, and certainly nothing of this complexity.

Later,
Blake.

Tim Burks

unread,
Sep 16, 2010, 2:16:41 PM9/16/10
to program...@googlegroups.com
Louis-Philippe,

Here's an example showing some server-side programming with Nu.

http://gist.github.com/582847

It is a simple location-sharing service -- you might use it to post
messages associated with lat/lng pairs. Messages are stored in
MongoDB.

The two code excerpts implement the same service, first with
Objective-C using blocks and then with Nu.

Tim

stephen white

unread,
Sep 16, 2010, 5:37:52 PM9/16/10
to program...@googlegroups.com
On 16/09/2010, at 11:33 AM, Tim wrote:
> 1. What are you doing with Nu?

Nothing at the moment, since I'm mainly programming in web browsers. I use Objective-J and keep on thinking about Nu. :)

> 2. What do you want to do with Nu?

I would like to have Objective-J on server-side and client-side web services, with Nu as a combined bridge and scripting layer between web and native code in Objective-C and C. I would be able to write for web or native in Nu, with the option to drop down into Objective-J or Objective-C... or Javascript or C, where needed.

> 3. What do you want to add to Nu?

A new platform. :)

--
st...@adam.com.au

Blake Winton

unread,
Sep 16, 2010, 6:57:01 PM9/16/10
to program...@googlegroups.com
On 10-09-16 11:36 AM, Blake Winton wrote:
> On 10-09-15 10:03 PM, Tim wrote:
>> 1. What are you doing with Nu?
> Trying to solve some of the Project Euler problems.

So, to help me with this, I've added a port of a wrapper for the GMP
library for really big integers. I'm sure there are things I'm doing
wrong, but if anyone was interested in using or helping with it, it's at
<http://github.com/bwinton/mpinteger-nush>.

An example:
Fin:MPInteger (default)… nush -f MPInteger
Nu Shell.
% (set x ((MPInteger alloc) initWithString: @"178527987424739"))
178527987424739
% (set y ((MPInteger alloc) initWithString: @"843987998927493749"))
843987998927493749
% (x mpIntegerByMultiplyingMPInteger: y)
150675478859158236640518030456511

Later,
Blake.

Tim Burks

unread,
Sep 16, 2010, 9:49:23 PM9/16/10
to program...@googlegroups.com
Hi Blake,

We ought to be able to get this working with the native Nu arithmetic operators.

Long ago (now), Patrick Thomson and I talked about having the Nu +
operator send a message to the first argument that could be customized
for different types. Something like addValue: so that an operation
like

(+ one two three)

would be implemented as

((one addValue:two) addValue:three)

This would make your class much easier to use.

Also (loosely-related), have you considered making your class a
subclass of NSValue or NSNumber?

Tim

Grayson Ney Hansard

unread,
Sep 16, 2010, 11:13:51 PM9/16/10
to program...@googlegroups.com
> 1. What are you doing with Nu?

Nu is primarily a prototyping and extension language for me. Nearly every Mac application that I've written since I started using Nu has included it as an extension language (along with Applescript). I find that it's easier and quicker for me to prototype things out in Nu, test them on the fly, and then port them to Objective-C. Often, I have a button, menu, or action that simply calls into a Nu script that I've created. At the end of the day, I sometimes just leave the script in the app rather than rewrite anything.

> 2. What do you want to do with Nu?

I'd like to use Nu in more middleware situations. I love using it as a plugin system for Cocoa applications but have always wanted to find some time to extend it to function as an alternative to Applescript.

> 3. What do you want to add to Nu?

When I have the time again, I'd like to finish generator support in Nu. I'd also like to see some kind of recursion optimization so that I don't run into memory errors when working with large datasets. I'm always a bit hesitant about using recursive functions in Nu.

While I'm at it, auto-complete in the TextMate bundle would be awesome, but that's not really something for Nu proper, just a hesitation when starting a new project.

--Grayson

Louis-Philippe Perron

unread,
Sep 17, 2010, 8:41:41 AM9/17/10
to program...@googlegroups.com
On Thu, Sep 16, 2010 at 2:16 PM, Tim Burks <timb...@gmail.com> wrote:
Louis-Philippe,

Here's an example showing some server-side programming with Nu.

http://gist.github.com/582847

It is a simple location-sharing service -- you might use it to post
messages associated with lat/lng pairs. Messages are stored in
MongoDB.

The two code excerpts implement the same service, first with
Objective-C using blocks and then with Nu.

Tim

Thanks for the link Tim,
I am also a fan of Sinatra's architecture in the ruby world, so nunja seems right to me...
can't wait to explore it!

about the benchmarking of the GC vs reference counted...  is there different versions or it's a flag or option?
I'm currently benchmarking a bit around nu and would like to check both if possible.

L-P 

Elizabeth Kellner

unread,
Sep 17, 2010, 8:53:52 AM9/17/10
to program...@googlegroups.com
I have had a very similar experience to Philip's below.

1. What are you doing with Nu?

I'm including a Nu Console in debug builds so that I can play with
Prototypes in running code. It's about half and half whether or not I
use nu or f-script.

2. What do you want to do with Nu?

I want to be able to test and develop code using an interactive shell.

3. What do you want to add to Nu?

Stack traces. A more robust console. Things like tab completion, for
instance. Also I've seen things get weird, either with the console or
a NuParser object, when code has unbalanced parentheses; it doesn't
error out cleanly. It all goes to debugging: when code is buggy then
nu isn't very helpful.

Blake Winton

unread,
Sep 17, 2010, 12:15:32 PM9/17/10
to program...@googlegroups.com
On 10-09-16 9:49 PM, Tim Burks wrote:
> Hi Blake,
> We ought to be able to get this working with the native Nu arithmetic operators.

Cool!

> (+ one two three)
> would be implemented as
> ((one addValue:two) addValue:three)
> This would make your class much easier to use.

I agree. In the meantime, I'm thinking that I should be able to use a
macro (or something) to switch off the type of the operands and call
either + or mpIntegerByAddingMPInteger…

> Also (loosely-related), have you considered making your class a
> subclass of NSValue or NSNumber?

It's not really my class, more a port from
http://code.google.com/p/mpinteger

How would making it a subclass help me? (I've had bad experiences in
other languages with trying to make more general types subclasses of
less general types. i.e. in this case, would addition be forced to
return an NSNumber if I subclassed from NSNumber? Cause if so, that
would be bad. ;)

(I also just read on http://tinyurl.com/nsvalue "Note that the type you
specify must be of constant length. You cannot store C strings,
variable-length arrays and structures, and other data types of
indeterminate length in an NSValue—you should use NSString or NSData
objects for these types." Since I'm reasonably sure that the data
structure I'm using is of variable-length, I don't know if NSValue is a
good fit.)

Thanks,
Blake.

Clay Bridges

unread,
Sep 17, 2010, 3:25:57 PM9/17/10
to Programming Nu
> Elizabeth Kellner wrote:
> I'm including a Nu Console in debug builds so that I can play with
> Prototypes in running code.  It's about half and half whether or not I
> use nu or f-script.

I'm mulling similar stuff, and curious what your thinking is, if you'd
care to share. Other than debugging, what are your concerns with nu.
What about f-script? Are you on OS X, iOS, or something else? If OS X,
have you considered MacRuby?

Thanks

Clay

Louis-Philippe Perron

unread,
Sep 17, 2010, 4:38:53 PM9/17/10
to program...@googlegroups.com
MacRuby is really nice, as advantage it can be aot-compilated.

Nu does Linux, iOS and has Macros...

I'm at this moment baking some benchmarks on nu, ruby, macruby and else... and can already tell you nu's edge is in being only a tiny layer when playing with Objective-c libs, Fast!

Clay Bridges

unread,
Sep 17, 2010, 8:21:36 PM9/17/10
to Programming Nu
> MacRuby is really nice, as advantage it can be aot-compilated.

My money is on MacRuby being the language X that folks have opined
about [1]. Given the support it has from Apple, and its integration
with Cocoa, I reckon it's at least a candidate.

I think Laurent dropped a "maybe on the iPhone" hint the other day.
When and if, that will be huge.

[1]: http://arstechnica.com/apple/news/2010/06/copland-2010-revisited.ars/

Jeff Buck

unread,
Sep 18, 2010, 1:17:52 AM9/18/10
to Programming Nu
Wow. I was offline for a few days and came back to find more activity
on this group in three days than we've had all year. This is an
interesting thread.


> 1. What are you doing with Nu?

I use Nu a few ways:

1. As an embedded console in my applications for poking around the
objc runtime and for changing non-UI parameter values at runtime.

2. As a prototyping tool for quickly trying out new plugins in my
application.

3. As a code generator. Nu macros let me create my own compact mini-
language while targeting different environments.

4. As a scripting language for utilities and shell-type tools.


> 2. What do you want to do with Nu?

I'd like to be able to keep more of my plugin code in Nu, but I
sometimes have performance issues with the relatively slow speed of
interpreted Nu. And if I'm using macros, translating the code to objc
can be tedious and ugly. So I'm very interested in using LLVM to
generate native code from Nu code dynamically at runtime.


> 3. What do you want to add to Nu?

I use Nu enough as an embedded runtime console that I wanted a better
way to see my environment than poking around a line at a time from the
Nu console. So I've been developing a runtime browser for inspecting
Nu objects (cells, code, data) as well as objc runtime objects. Think
of it as a slimmed-down Nu-aware Fscript-like browser. I have a rough
working version of this that I am polishing up. It's not part of the
Nu proper (it will be a separate framework), although I made a few
changes to the internals of Nu to support some of its functionality.

I'd also like to work on the LLVM-based code generation tool described
above.

And like several others have noted, I think Nu's lack of detailed
error diagnostics can be an unnecessary roadblock. We can do a better
job reporting the information that the parser and the evaluator have.
A full debugger is a big task, but there's certainly some low-hanging
fruit that we could work on in the short term to produce better error
messages.

Jeff

Clay Bridges

unread,
Sep 19, 2010, 3:36:41 AM9/19/10
to Programming Nu
1. What are you doing with Nu?

Flirting.

When the iPhone SDK first came out, I decided to attempt creating an
iPhone app. I discovered Nu, and thought it might be a route around
learning Objective-C. This now greatly amuses me.

2. What do you want to do with Nu?

I've since become snuggly with Objective-C. I'm almost done with an
app, a turn-based strategy game for the iPhone. I lack only an AI, and
am feeling the constraints of the language more exquisitely. So I'm
giving Nu another look, and hoping this is not an elaborate
procrastination ruse I'm playing on myself.

3. What do you want to add to Nu?

I'll get back to you. ;)

Elizabeth Kellner

unread,
Sep 21, 2010, 6:44:21 AM9/21/10
to program...@googlegroups.com
I'm on OSX.  I haven't really looked at MacRuby, mostly I think because I last looked at Ruby a number of years ago.

Basically I want to do some amount of test driven development, when my project allows for it.  Most of the time I'm developing code in some type of test harness.  Usually now its a cocoa app, though in the past its been some nu scripts.  When it was nu, I'd usually start the base app, start the Nu console, and run a Nu script to instantiate some objects and then I'd see if their behavior was correct.  

Alternatively, I've also tried having some test cases in Nu and compiling the app as a bundle, and running the test cases against that.  As much as I'd like a replacement for the cocoa unit test suite (the test harness really), so far I find it just a little too hard to use.  I was spending too much time debugging the tests compared to the code under test.

When my prototype involves me working more with webkit, I use f-script for the object browser.

Elizabeth

stephen white

unread,
Sep 21, 2010, 7:09:45 AM9/21/10
to program...@googlegroups.com
On 21/09/2010, at 8:14 PM, Elizabeth Kellner wrote:
> When my prototype involves me working more with webkit, I use f-script for the object browser.

Yes, I'm looking forwards to the Nu version of the object browser. :)

--
st...@adam.com.au


Nick C

unread,
Jun 26, 2012, 11:18:03 AM6/26/12
to program...@googlegroups.com
1. What are you doing with Nu? 
Trying to learn the basics. 

2. What do you want to do with Nu? 
Develop an iOS app that does a relatively large amount of artificial intelligence processing and depends heavily on the OpenCV framework for computer vision (which is C/C++).

3. What do you want to add to Nu? 
Let's add a wiki to grow a suite of tutorials, examples and reference documentation.

Reply all
Reply to author
Forward
0 new messages