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
>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/>
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.
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:
--
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.
>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).
Indeed. Reliable stack traces sorely needed.
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.
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.
Here's an example showing some server-side programming with Nu.
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
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. :)
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.
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
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,
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
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.
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.
Yes, I'm looking forwards to the Nu version of the object browser. :)