Info
Levi is a Computer Science student with interests in programming language theory and other software topics. More info about him can be found at his main page.
This blog is an exercise in Lisp programming, a repository for information related to programming languages, and an effort to keep up-to-date with web and blogging technology.
Categories
Links
Syndicate
Interactive Fiction as Programming
Here's something novel: Craig Latta has created an interactive programming environment on top of a Smalltalk system based on the paradigm of interactive fiction. It's called Quoth, and he's created a screen-capture video demo of it featuring a simple musical application. He intends to use it for live musical demos; the interactive prose should make the programming possible to follow by a non-technical audience.
This isn't exactly an environment I'd like to use for programming anything substantial, but at the very least it's a very clever hack, and it's fun to see programs so fully anthropomorphised. I can see it being useful for making some rather entertaining presentations.
Unix System Programming in Scheme
The Unix Way, if such a thing even exists anymore in modern systems, is to glue small applications together into a sort of dataflow graph. This glue is typically applied through use of a shell scripting language, like that built into the Bourne shell. Unfortunately, the Bourne shell syntax becomes awkward very quickly when programs written in it progress pass the trivial stage.
Olin Shivers came to the rescue with the Scheme shell. It's a full Scheme system with extensions to make Unix programming easier. It has new syntax for process creation, input/output redirection, and system call interfaces. It manages to (almost) seamlessly merge the utility of Unix with the elegance of Scheme.
Shivers wrote a paper on the Scheme shell that goes into much more detail about his motivations, his design philosophy, and what using the Scheme shell for Unix programming is like. It seems to me to be an ideal solution for programs too complex to write trivially in Bourne shell script, but still within the realm of Unix scripting. I'll report again if and when I get a chance to use it.
#
Posted by: Levi
at 11:15 PM on Wednesday, September 28, 2005
  
Comments: (0)
Categories: Scheme
Context-Oriented Lisp
Thanks to the extensive metaprogramming facilities in Common Lisp, it is often used as an experimental testbed for new programming paradigms. Recently, Pascal Costanza and Robert Hirschfeld have come up with a new form of program structuring called Context-Oriented Programming.
Roughly, the idea is to create different "layers" in the software that expose different portions of objects' interfaces. This allows for changes in behavior based on context rather than just the traditional mechanisms of subtyping and composition. I'd explain further myself, but Bill Clementson has created a tutorial based on the example in Costanza and Hirschfeld's paper that does a better job than I could.
If you'd like to try it out, the ContextL extension to Common Lisp can be found at the Closer Project site, along with additional information about ContextL and Common Lisp's Meta-Object Protocol, which made ContextL possible.
Dangers of Destructive Functions
While finishing up the templates for the site, I ran into a little problem--suddenly, each type of page would only render one set of entries despite instructions to the contrary. After a good bit of debugging (inspect is my friend), I found the culprit: nconc.
The html-template library requires passing in a plist to the template printer in order to fill template variables. Originally, everything in the plists was generated on-the-fly, so nconcing them together wasn't an issue. However, I ended up adding a static plist entry at the end of one plist-returning function, and the first nconc after a compile would append all sorts of entries to the end of that one, making them part of the static data as well.
Lesson learned: Start out with non-destructive functions, and only optimize to destructive versions when it is necessary and safe to do so!
#
Posted by: Levi
at 01:23 AM on Tuesday, September 13, 2005
  
Comments: (0)
Categories: Lisp
Blog Software Update
I've finally got the running server switched over to the new version of my Lisp blog software. It's been under development on and off for months now, but I finally feel it's featureful enough to let it live relatively safely on the net. It now supports comments, which is one reason I was delaying, so feel free to drop me a line and let me know what you think.
#
Posted by: Levi
at 01:06 AM on Tuesday, September 13, 2005
  
Comments: (1)
Categories: Lisp Blog