Tuesday, August 28, 2007

Change the name

So I changed the name of my Blog.

I really wanted to have something more generic to cover both programming and writing Fiction but nothing came to mind so I settled for Lisp, the AI language, the cool language. It is really more my language of choice even if I use Python for practical reasons.

Still newLisp shows some promise in being a practical lisp despite its warts and if I'm motivated enough Warts can be removed and replaced with something better.

Wednesday, August 22, 2007

New Lisp warts

Well I haven't need to dig too deeply to find warts in NewLisp. and some of them do seem to be by design.


  1. No tail call optimization (and nver will be or so the creator has said) seems a little antagonistic to functional programming. And pass by value is not your friend here.
  2. Contexts are inadequate for any of the jobs they are supposed to do, and they have been overloaded with too many jobs.
  3. Macros facilites are inadaquate, as there are no gensyms and there is no macroexpand function.
  4. Memory management seems to be a dogma. The only problem I have with pass by value is that it seems to go against the grain of functional programming. where you pass in functions expecting them to not modify their arguments, so why copy them? I think copy on write would be a better strategy. to adopt, perhaps a little more complex but favarable to functional programming.
  5. No Type system. THere simply is no facility for user defined types. and hence no way to do anything interesting like generic functions


Why contexts are inadaquate


Context take the place of Module, hash tables, objects (closures really) and pass by reference mechanism.

They fail as a packaging system as they have a flat namespace so that all modules must be global. Every scripting language that I know of supports hiarchical modules simply because it works better and reduces the changes of two differnt packages defining the same module. Without hiarchical contexts developing an extensive standard library for newLisp is going to be impractical. Note that all of the successfull scripting languages have large standard libraries, it is just one of the signs that a language is a success.

As hashtables they sort of will do but are inadaquate simply because you must stick all your hashtables in MAIN, where they share a namespace with any loaded modules. So I can't have one without exposing it to the world and the chances of name collision have increased again. If I could create an anonymous context and bind it to a local variable that would be better.

As a method of passing by referance. Sorry but that is a plain ugly hack, which forces the proliferation og global objects. Again if this must be the only way to do it then anonymous context are what is needed.

As Objects. Well no what we have here are not objects but what every other Lisp would call a closure. Except that again while in all other Lisps closures are anonymous here they must be named, in the same namespace as Modules and Hash tables (boy its getting crowded in there). Yet again anonymous context seem to be what is missing.

Unfortunately neither Hiarchical Contexts or Anonymous contexts are likely to be added. Form what I have seen the Project maintainer has already expressed the opinion that he does not like the idea of hierarchical Contexts. Anonymous ones meanwhile would I suspect play havoc with the whole ORO memory management Idea. As once they existed people would use them (quite Heavily I imagine).

Tuesday, August 21, 2007

Back to Lisp

Looks like I'll be playing wtih a little Lisp again rather than Python. May even need to chagne the name of this blog. This time in the form of newLisp this is a very small and seeming agile implementation of lisp.

It's not a Common Lisp, but instead does its own thing in what appears to be a very light weight manner, which still feels like lisp. All the While focusing on practical things like providing Network (indlucing HTTP) database, Threading and even GUI API's out of the box. As well as what seems like near seamless integration with C librarys, though only time will tell on that one.

Some other features are a little unusual such as a return to older scoping rules. And a namespace implementation called contexts.

Some of the design decisions have been critisised hevily, but others areue along the lines of try it and see it actually works out without being insane. So I'll go down this route.

As a first remark it is a small distibution at 1.1MB of source Tarball and is very easy to compile out of the box. For me on two differnt machines (with different Distos) It just worked.

I have two projects in mind:

1) See how much of the stuff in 'On Lisp' I can get working in newLisp
2) write a Rouge like console game using libcaca