Older blog entries for bmastenbrook (starting at number 6)

I suppose I should advodiarize what I've already announced to lispweb and the #lisp Yabos: Araneida (at least Araneida CVS) is now "Portable Araneida", meaning it runs on SBCL, OpenMCL, and Allegro, and a very particular version of ABCL. Araneida is a very nice web server that powers CLiki and lisppaste, and it's significantly easier to understand in my experience than portable allegroserve. It also doesn't depend on a compatibility library for most of the API of another lisp, making it somewhat easier to port.

I'm planning on releasing the latest version of chavatar web-based IRC client later tonight, when I'm in front of my PGP key. But, for now, there's a demo instance up and running - use username and password "demotar". It can't /join or /part channels, or change its password, due to being in demo mode, but it's enough to get a feel for it. It's running in #demotar on irc.freenode.net, if you want to see it talk.

Aha, advogato is back up, as evidenced by Christophe-blogging. I started the summer grindstone^Wjob on Monday, and hopefully at some point I'll get the after-work free time I have been expecting. Once I do, I'd like to hack on a few things:

  • Fix the accumulated bug reports in lisppaste and release
  • Determine whether Sven van Caekenberghe is still maintaining his XML-RPC implementation; if not, offer to run a CL.net for it and his XML parser (and give them ASDF-INSTALLable names too)
  • Fix a few bugs in the chavatar source, and possibly make a new CL.net project for this too. Then release the current version. (I'm thinking about making a tarball with all the dependent libraries as well, so that people with no Lisp experience can just edit a configuration file and run a shell script to run their own chavatar, provided they have SBCL installed.)
  • Sometime before this happens, get Dan to release a new araneida.
  • Help Taylor Campbell to get the T linker to output a Solaris/ELF binary and not a cruddy ancient SunOS/a.out binary.

Well, that's the plan at least. Who knows how far I'll get on any of these things? Not me, not yet.

Work has me doing JSP, which only serves to remind me of how nice it is to work with araneida. On the other hand, JDBC is a pretty nice way of talking to multiple databases. This gives rise to thoughts of JNI for SBCL or OpenMCL. Hm....

As a quick follow up to my post of yesterday, I've updated my common-idioms package to contain 100% MORE EVIL. Included are two symbol property-list abusing macros, one of which depends on order of expansion and is thus technically not ANSI.

The first of these macros is symbolic IF, which works as follows:

(let ((x (list 1 2 3)))
  (sif (cdr x)
       (sif (car it)
            (setf it 'foo))) x) => (1 foo 3)

The second is let-env, which is the unportable one I mentioned:

(let ((x 1)
      (y 2))
  (let-env env
           (append
            (let ((x 3)
                  (y 4))
              (setf x 5)
              (env (x)
                   (setf x 6)
                   (setf y 7))
              (list x y)) (list x y)))) => (5 7 6 2)
Also, the completely unportable but highly useful EXPAND-ONLY has been extended to allow expanding of all macros (pass T for the name list) and to return a second value containing an alist of (form expansion) pairs for forms that couldn't be found in the current expansion (happens often with SETF).

If you're interested, head over to CLiki and check it out.

So, I've decided to embarrass myself and release my s-expression to C translator. The goal here is to come up with a suitable target representation for a compiler, without having to worry about actual C syntax in the compiler itself. Since it supports macros, you can build the target language a bit higher too. As an example, consider Duff's Device - it can be expressed for a fixed amount of unrolling in plain C, but you can't vary that except with possibly some horrendously complex C++ templates. The macro to generate Duff's Device reads as follows:

#@(defmacro #@make-duff #@(to from count n-type size)
    `#@(let ((,n-type n (/ (+ ,count ,#@(- #@size 1)) ,size)))
         (switch (mod ,count ,size)
                 (case 0)
                 (do/while
                  ((setq (deref ,to) (deref (post-incf ,from)))
                   ,@#@(loop for i from (- #@size 1) downto 1
                          append `#@((case ,#@i)
                                     (setq (deref ,to) (deref (post-incf ,from))))))
                  (> (decf n) 0)))))
The #@'s there are to bounce back and forth between readtables - the s-expression C needs to be read into a table which preserves case and also preserves backslashes in strings, so #@ is defined to take you between that table and an ordinary one.

There is documentation up as well, and a developer mailing list. It's not complete yet at all, but already it's useful to me. Ideas, suggestions, and complaints about opening up lisp macros to C are welcome :-)

Also, I should mention my common-idioms package here - I see a lot of similar macros out there, and I recently noted that Pascal Costanza reinvented the destructuring-case macro. Mine has a few more features, so if you're doing some heavy destructuring you might want to take a look at it.

The rest of the package is worthwhile to me too - it contains an anaphoric if with a setf-it macro, an anaphoric if that tests on the second return value and binds "it" to the first (very useful!), multiple-value aggregating reduce (my favorite iteration construct of all time), and some other useful tools.

Mergearrific!

SBCL 0.8.8 has been released, and contains the OS X patch I previously maintained in the main distribution. No more patching! Big big thank you to Brian Downing for cleaning up the build process in the patch so it was cleanly buildable; I clearly lack any sort of abilities with make. Oh well. Big thank you also to Pierre Mai for finding the source of the RUN-PROGRAM bugs and to Christophe Rhodes for fixing the SIGTRAP handler to reflect this. Owners of single-processor machines rejoice in their SBCL buildability.

Hopefully binaries should be available shortly for a broad variety of platforms and uploaded in the UK morning. OS X binaries are prepared, and binaries for many of our other architectures that haven't seen binaries in a little while are also being built.

One thing that has come to my attention is that setting LD_PREBIND to YES on OS X interferes with SBCL buildability. You will have to unset this before building SBCL.

SBCL's 0.8.8 freeze is fast approaching, and Christophe Rhodes thinks he's got the SIGTRAP handler problem fixed (which manifests itself in hagning when using RUN-PROGRAM). I have put up a binary that has this fix in it; it would be lovely if people tested this and reported back whether it works or not. In particular we have had intermittent "illegal instruction" (SIGILL) problems and I would like to know if anyone can reproduce this on this binary - I can't.

On a side note, Clotho 0.2 is out. If you are interested in shaping what a native OS X Lisp IDE looks like, please join the project and produce MORE CODE!

29 Jan 2004 (updated 29 Jan 2004 at 22:57 UTC) »

Hey, cool! I have a diary!

Anyone who is interested in working on native OS X IDEs for Lisp, please visit the mac-lisp-ide list. To quote from that page:

The purpose of the mac-lisp-ide list is to encourage discussion about what a true, native Mac OS X ide for Common Lisp development would look and feel like, and to encourage the coding of such an IDE. Native here is defined as Cocoa, Carbon, or OpenGL, but not X11, terminal, or GNU Emacs/XEmacs-based. Topics of discussion should include but not be limited to:

  • Built in Emacs-like editor, based on CL
  • Socket connection to other Lisps, perhaps non-Common Lisps (Scheme)
  • Debugging and backtracing
  • Presentation-based GUIs using Cocoa
  • Object clipboard and REPL history
  • Integrated documentation
  • Threading

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!