Subject: Re: What open source implementation of Lisp do you prefer and why?
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 05 Mar 2009 20:48:14 -0600
Newsgroups: comp.lang.lisp
Message-ID: <DJqdnStSAJZzEy3UnZ2dnUVZ_uCdnZ2d@speakeasy.net>
Mark Wooding  <mdw@distorted.org.uk> wrote:
+---------------
| Javier <javuchi@gmail.com> writes:
| > So, for what are you using SBCL?
| 
| Mostly system administration stuff at the moment.  I generate my DNS
| zone files from a description in Lisp, and do something similar for my
| SSH configuration files.  There are a number of other things I want to
| do, but they depend on a big pile of other projects (in C, for
| interworking with other languages, unfortunately).
+---------------

Let me second Mark's recommendation of CL as a generic "file
generation language" [even though I use CMUCL instead of SBCL]:

- The obvious web stuff: Write/maintain in format X, run an X_to_HTML
  conversion scripts (in CL) whenever the source tree changes.
  [Fun choices for X include: sexps (HTOUT/CL-WHO), TML, LML, Wiki-style,
  TeX-like, PCL <http://www.gigamonkeys.com/lisp/markup/>, etc.]
  And that's not even including *active* web pages written in CL!

- Generating C source code [mainly but not exclusively header files].
  The looping features of FORMAT are *very* nice when building C
  tables, e.g., this bit clipped from a previous article of mine
  <news:F-udnZ3s2r7vWELbnZ2dnUVZ_jydnZ2d@speakeasy.net> [Sept'07]:

    I use it [the |0X| printing function shown earlier]
    a lot when building data initialization tables in C code:

    > (let ((data (loop for i below 24 nconc (list (random 0x100000000)
                                                   (random 256))))
            (instance "georgey"))
        (format t "~%foo_t ~a_foos[~d] = {~
              ~%~{~<~%~1,68:;  {~/0x/, ~2/0x/}~>~^,~}~%};~%"
              instance (/ (length data) 2) data))

    foo_t georgey_foos[24] = {
      {0x21a41a5c, 0x87},  {0x1c63b86e, 0xb4},  {0x894c25d5, 0xa1},
      {0x9979b7fe, 0xbb},  {0xc2ad44aa, 0x4d},  {0xe2826239, 0x70},
      {0x053b537e, 0x05},  {0x6ac226e8, 0xbe},  {0x1252ea73, 0x20},
      {0xe3001d4a, 0x12},  {0x9a006313, 0x31},  {0x299d2f64, 0x54},
      {0x90feb745, 0xda},  {0xc7ed257b, 0xc1},  {0xa6e8e18a, 0x51},
      {0x0fdb8569, 0xed},  {0x713c27e0, 0xa8},  {0xd975dbac, 0x2d},
      {0xb4263772, 0x85},  {0xe6cdaaa9, 0x48},  {0x7db24d29, 0xf8},
      {0x87e5aa36, 0xa3},  {0xb56e3dd7, 0xe2},  {0x3cf23443, 0x4e}
    };
    NIL
    > 

  At a PPoE I even got them to add CMUCL to the "approved" set of
  build tools so I could use it to parse somebody else's really nasty
  ad-doc documentation file and construct a set of mapping tables
  [relating kernel disk drive numbers to disk drive bay numbers,
  LED driver chip I2C addresses & register bits, & power control
  chip I2C addresses & register bits] into ".h" & ".c" files which
  then got compiled into a Linux kernel driver.  ;-}

- Talking to SQL databases. [I use PostgreSQL and Marsden's PG.]
  'Nuff said.

- Misc. system administration "scripting" stuff. My "~/bin/" directory
  has over 50 CMUCL scripts in it [as well as a couple of dozen leftover
  MzScheme scripts from before I moved over the The Dark Side!].


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607