(archive 'newLISPer)

August 20, 2008

Reasons to learn newLISP

Filed under: newLISP — newlisper @ 17:41

It’s that time of the year when many people face new academic challenges, so now’s a great time to learn newLISP! Here are some – frankly quite biased – suggestions as to why newLISP is a good choice for a first – or second or third – programming language. By the way, most of these suggestions are true of most programming languages.

1 It’s easy

newLISP is easy to download, install, and use. For most operating systems you’ll find an installer and/or prebuilt versions. You won’t have to build, compile, or make the software, and running it is as easy as typing its name.

It’s easy to program in, too. The carefully-designed syntax aims for readability and write-ability, without introducing too many special forms and conventions. Obscure function names have been replaced by more English-like ones, and the temptation to make use of every punctuation mark known to humankind has been resisted, for the most part. Although sadly I don’t think we’ll ever be able to say goodbye regular expressions. And there are some great introductory tutorials too. (I wrote one of them, so I’m biased!)

‘easy’ isn’t always the main reason for doing anything. Sometimes we do things not because they’re easy, but because they are hard. Sometimes we have to use things that aren’t easy to use to solve hard problems. But easy can be good when you’re learning something new. You probably didn’t learn to drive a car in a Ferrari…

2 It’s small

It would be hard to find a memory card on sale today with a capacity too small to hold newLISP – if you can find a 512KB memory card you’ll have plenty of room to spare.

More seriously: it’s a compact language that tries to provide everything you need and dispenses with much that you don’t. With about 350 functions, it’s a reasonably complete basic programmer’s toolkit without the complexity and advanced features of the larger languages. You can worry about making it bigger – or moving to a bigger language – later, when (or if) you outgrow it.

Yes, it hasn’t got sub-atomic reference de-clustering, quasi-optimal cyclical redundancy, or meta-stable bytecode traversal, to name just a few of the language’s most obvious omissions, but there’s plenty of useful tools to get you started. (I made those up, by the way, but that doesn’t mean that they don’t actually exist…)

3 It’s fast

newLISP is quick enough for most purposes, so you shouldn’t have too many problems with speed. For extra performance you can learn how to link to compiled C libraries, or write assembly code (two things which I’ve managed to avoid so far). The 50,000 word introduction I mentioned above is translated in about 0.4 seconds, which is too quick for me – better to take 10 seconds so that I can drink some coffee…

4 It’s versatile

Use newLISP to explore programming concepts, crunch numbers, write internet applications, analyze text documents, post rubbish to blogs, or compose music. You can learn many different styles of programming in newLISP: casual scripting (my favourite!), imperative programming, functional programming, object-oriented programming, and even a form of macro programming – you’ll be working with newLISP for a long time before you’ve exhausted newLISP’s potential and are ready to move on to bigger and more complex languages (if you want to). Instead of just following what other people tell you is the ‘right’ way, why not try the different styles and make your own mind up?

You don’t have to be a mathematician or computer scientist to use newLISP: musician, writer, artist, sysadmin, architect, web developer, surveyor, mathematician, tinker, tailor, soldier, sailor – if your work involves the computer, it could benefit if that computer works harder for you.

This is the sort of newLISP I use all the time:

(set 'dir (real-path))
(dolist (i (directory dir {^[^.]}))
 (set 'item (string dir "/" i))
 (set 'mod-date (date (file-info item 6) 0 "%Y%m%d-%H%M%S"))
 (rename-file item (string dir "/" mod-date i)))

which simply renames files based on their modification dates. But others are into newLISP like this:

 (let ((g (lambda (h)
          (expand (lambda (n)
            (let ((f (lambda (f n)
                    (if (< n 2) 1 (* n (f (- n 1)))))))
            (f (h h) n))) 'h))))
       ((g g) 10))

which is something to do with the Y function.

5 It’s different

newLISP is certainly not your Dad’s Lisp, and there’s plenty of tutting in some of the online communities who get easily worked up by the different. But perhaps you’re ready to find out for yourself what you think is good or bad, and perhaps you like to avoid doing the obvious and predictable. Or at least prove to your own satisfaction that your Dad was right all along.

6 It’s friendly

On the newLISP forum, genuine questions usually receive genuine answers. You probably won’t encounter the uncompromising attitudes that newcomers to other languages occasionally encounter. You might even get help from Lutz, the language’s author.

7 It’s not finished

newLISP is still developing. There’s room for contributions from you: plenty of investigations and discoveries still to be made, plenty of code and applications still to be written, and many subjects for writing and blogging about. If you want to take an active part in its development, there are plenty of oportunities waiting for you. You might even get your own function included in the next release (but it will have to be a really good idea!). It won’t be named after you, though.

8 It’s fun

Is programming fun? It’s not always fun; sometimes the code doesn’t do what you thought you told it to do. But newLISP has got to be fun, because the slogan says it is!

9 It’s free

Of course, sometimes the best things in life are free!


1 Comment »

  1. I prefer newlisp noe because of its dynamic eval and its f-expressions, and because of the usage of balanced binary trees instead of hash tables.

    Comment by schillingklaus — June 23, 2012 @ 18:13 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: