programmierung - 27.11.2004 - 26.12.2004

Snurf: a Python-based Blogging System - a nice little blogging system that doesn't require a database

Delayed Execution with Python

The original text has moved to the PyDS weblog. The reason is that I cannot manage the text properly with the new software because the necessary tools are not available here (specifically, source code formatting doesn't work here, and besides the text is too huge - at least when it is saved as XHTML).

Delayed Execution with Python

Delayed execution - delayed execution or lazy evaluation - is a very practical tool in programming. Unfortunately, not all programming languages support this tool directly. Languages that support closures and objects, however, can be extended quite easily to support delayed execution. I describe one approach for Python in this text. The text contains a series of Python code examples that show how a whole range of powerful Python language features can be used. The text could also be interesting for those who have less interest in lazy evaluation. Here's the original article.

Brian Mastenbrook: Forth porn

Memories come flooding back. PowerMops - an integrated Forth environment for the Macintosh - is now also available for OS X. I haven't looked at it in a long time, but the description still sounds as cool as it did back then. Direct native code compilation and integration with the various toolboxes and nowadays also with the Cocoa frameworks. And all of this in an object-oriented Forth.

I found the original article at Planet Lisp.

Charming Python: Implementing "weightless threads" with Python generators - Very interesting concept on how to build extremely resource-efficient threads in Python using generators - cooperative multitasking in 100% Python

Contracts for Python - Programming by Contract in Python based on descriptive metaclasses

Microsoft attempts to patent object persistence

Toll - simple and banal object serialization. That sort of thing has existed for years, nonsense for decades. And Microsoft wants to patent it...

At kasia in a nutshell there's the original article.

Adding Optional Static Typing to Python

Guido van Rossum is thinking about optional static typing for Python. Very interesting, because optional static typing on one hand preserves the highly dynamic nature of Python, while on the other hand offering type declaration as an option for optimization. You can get a great sense of what something like this could accomplish by trying out PyRex - which already offers something like statically typed Python today. Here's the original article.

The "Thank you Poland!" Letter

Hey folks, thank you!

I found the original article at Industrial Technology & Witchcraft.

Why's (Poignant) Guide to Ruby

Ok, I've seen a lot of crazy stuff. But this Ruby introduction is really completely insane. Definitely worth checking out. Even if you have zero interest in Ruby or programming languages. The author must be completely out of his mind - I don't know what he's taking to produce books like this, but I'd like two kilos of it.

Here you can find the original article.

Paolo Amoroso: McCLIM works with CLISP

Way cool: the most portable of all Common Lisps has received a few modernizations lately. And now McCLIM runs on it too - though of course only on CLX, and thus on OS X only under X11. But at any rate, it's quite an interesting platform. Especially since CLISP is the Common Lisp that most closely resembles a scripting language in terms of its environment.

Hmm. CLISP runs on the Zaurus. The Zaurus also has a system variant with X11. With CLISP+CLX+McCLIM+X11 you should be able to build the smallest reasonably complete Lisp machine in the world on the Zaurus.

At Planet Lisp you can find the original article.

Ann: Revival of the BytecodeHacks

Some of you may still remember it: the Bytecodehacks for Python. A wild module that allowed all sorts of shenanigans with code blocks - and was used, among other things, in older Zope versions for restricted execution of Python methods. Certainly, the whole thing is the wrong approach and violates good taste and sensible programming. I love it.

Here's the original article.

SnakeSQL -- Pure Python SQL database supporting NULLs and Joins

Nett - a SQL database in Python that supports significantly more than Gadfly (for example, simple joins, foreign keys, and null values). Ok, like Gadfly, it won't be a miracle for performance, but as a SQL option for installations that don't require a C compiler, it's certainly useful.

Here's the original article.

Brian Mastenbrook: Old News

An interesting side note: the Xerox Lisp Emulator - an emulator developed by Xerox for their Interlisp machines - is included as part of the Grammars Writer Workbench. I still have a set of Medley Lisp floppies lying around at home - and two Xerox Lisp machines sitting in the corner. Nice devices with a neat graphical system. Ok, far from the performance of a Symbolics, but since they were my first Lisp machines, I like them anyway somehow.

Included with the Xerox files are emulators for DOS, Linux, SunOS and Solaris. So I might have a chance to get my old Medley Sysouts running on Linux.

Somewhere in there is also the Medley Common Lisp - so not just the Interlisp-D, which is somewhat archaic compared to more modern Lisps (for example, it only has dynamic scope). However, I would first need to dust off my old Interlisp-D knowledge to figure out how to open a Common Lisp listener on the machine again, if it's not in the root menu...

I found the original article at Planet Lisp.

ReportLab - PyRXP - Very fast validating XML parser for Python - built on RXP

GNU Development Tools for the Renesas H8/300[HS] Series - Documentation on how to build a cross-compiler for the RCX

Lego-Mindstorms Simulator - Simulation of LeJOS programmed RCXs in Java

Another Update: how to get rcxcomm working with OS X 10.2

The problem with the rcxcomm stuff under 10.2 is that the headers from the JNI under 10.2 have incorrect links and therefore don't work. To fix it, you simply need to add to the line in lejos_2_1_0/rcxcomm/src/Makefile where CCOPT is defined:

 CCOPT = -g -O ${JNILIB_TYPE} -framework IOKit -framework CoreFoundation -I/System/Library/Frameworks/JavaVM.framework/Headers -I/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Headers

The latter part is the new one - I simply added the correct include path and then it finds jni.h. And it can compile. However, I haven't tested yet whether the whole thing actually works.

The leJOS Tutorial

Anyone who wants to see what's possible with LeJOS can have it demonstrated in this tutorial. Since the LeJOS documentation itself is limited to the API, this tutorial is all the more important. After all, the demo robots supplied with LeJOS are also quite sparse ...

Here's the original article.

XS: Lisp on Lego MindStorms

Cool - a complete Lisp that runs directly on the RCX. Perfect for the holiday season.

Unfortunately no OS X version, only something for Windows or Linux - and the latter only for the serial tower. Let me see if I can get something working for OS X with the USB tower. I also stumbled upon TinySOAR, a complete AI Agent Runtime for the Mindstorms RCX brick. Also very interesting - and hopefully also runnable on OS X through its embedding in TCL. And also new to me is the Java VM for the RCX: LeJOS. I don't like Java much, but it's definitely interesting for the RCX. And the oldy-but-goldy: LegOS, the complete operating system for the RCX written in C. However, due to its rather hefty toolchain (a complete GCC configured as a cross-compiler), it's somewhat tricky to install. Besides, it's now called BrickOS and is incidentally also under the Lisp as runtime. Here's the original article.

GadflyB5: SQL Relational Database in Python - 100% pure Python SQL database

Barebones pure-Python PostgreSQL client - PostgreSQL client in pure Python - no C compiler required, therefore very portable, but also less feature-rich

REgurgitate - Example of how to tokenize Python code and rebuild it

StupidSheet - Another example for tokenize - a small pure-Python spreadsheet

gb - CIA

A fascinating project, the CIA Open Source Notification System. You stick a small script into your CVS and it diligently logs, saves, and distributes every commit. There are RSS feeds for every view and contrary to many other projects that aggregate some large amounts of data, this one is also blazingly fast. By the way, the title links to my user and shows my three projects being monitored there. So if you're curious what I'm currently breaking, you can subscribe to the appropriate RSS feed.

Here's the original article.

Languages for the Java VM

For those interested in what programming languages are available on the JVM - yes, there are far more than just Java. And many of them are far more interesting than Java. And many integrate very well with Java libraries. In any case, Robert Tolksdorf has started building such a list here. I have no idea if it's complete, but the selection is enough for me ...

(although of course I'm biased and would only take either a Lisp dialect or Jython anyway)

Here you can find the original article.

PyX - Python graphics package - Generate 2D and 3D graphics suitable for presentations in Python

Bill Clementson: LispWorks 4.4 released

Looking at how the LispWorks implementation — originally actually foreign to OS X — is gaining ground on OS X (the previous version already ran cleanly under OS X, but this one has made further progress), one can clearly see how the distributor of the originally and still macOS native MCL implementation is failing in the market. You can't really put it more positively — MCL is in my opinion to be regarded as a debacle these days. At least the biggest news on their websites for 2004 is from the summer — that they got their mailing list running again. Great. MCL was once the star in the Lisp sky. At Planet Lisp you can find the original article.

Durus - Compact object database for Python - fast, but designed for read-heavy systems

Statement coverage for Python - Primitive code coverage analysis for Python

IPython - An enhanced Interactive Python

I had already written something about this earlier, but I've only been using it more intensively now. I have to say, the whole thing has developed tremendously. With a few settings in the system and in IPython, the whole system behaves almost as comfortably as a Lisp system prompt.

The integration of display system (on OS X it's recommended to set LESS to '-R' so that color information is evaluated) and editor (of course using VIM is recommended, but it also works quite well with the bbedit command line tool) allows you to work very nicely with the Python shell. On one hand, you don't have to constantly step out to quickly look at files or change a file, and on the other hand, you really get useful information with exceptions (the automatic activation of the debugger helps here).

Automatic deep-reloading too — that is, reloading a modified module while updating the contained references — helps tremendously, since you can finally edit the files directly and test them immediately without having to exit Python every time. Existing references to objects from classes that are in the modified file of course have to be rebuilt as well, since they still reference the old class.

All in all: highly recommended.

Here you can find the original article.

Logix Home

A very interesting project: building a language with a far more Lisp-like structure on top of the normal Python runtime. Compiles to the same bytecode as Python. Can be mixed with Python and also supports IPython as a shell.

With Logix, for example, the boundary between statement and expression finally falls away: in Logix everything is expressions. Lambda expressions that execute multiple commands and conditional expressions without detours through boolean expressions become possible.

There are also macros. The definition looks somewhat wild, but all the mechanisms seem to be there as they are also common in Common Lisp. So not just syntactic sugar, but real code-generating macros.

Of course everything is still alpha at the moment, but it already sounds very interesting. I'll keep watching this, it could definitely be interesting for me. Especially because I can mix it with Python.

Here's the original article.

xmltramp: Make XML documents easily accessible. - small compact XML parser and generator library for Python - nicely integrated into the syntax

RDFLib 2.0.4 Readme - Library for working with RDF in Python

A Lisp Comic That Explains Macros

Nice Thing - an explanation of Lisp macros for beginners. In the form of a comic. Macros are called - fittingly for the topic - SPELs.

Here's the original article.

Once Something Against the XML Hype

YAML is a very interesting and compact markup language. But one that is not based on XML or SGML; rather, it is principally oriented toward the old RFC mail formats. The genius of it: the contents are much easier for humans to read than all those angle-bracket dialects. And for the computer, the whole thing is also quite simple to parse - and it's still powerful in its expressive capabilities. If you feel like processing YAML files with Python, Syck is an extremely fast library that also offers an interface for Python. In the Active Storage Framework for Python I use YAML for database backup and restore and as a native data format. Importing YAML data into the database is thus very easy - and since YAML is hierarchical data and the Active Storage Framework for Python is a hierarchical database, everything fits together wonderfully. And you don't have to be afraid of hurting yourself on all those angle brackets.

Here's the original article.

Language-Independent Types for YAML - type tags for YAML sources

ASPN : Python Cookbook : Spreadsheet - a few ideas for controlled eval in Python

Living Code

A weblog from someone who programs in Python, PyGame and PyObjc under OS X (with Renaissance as a GUI system). With complete example applications available for download. If you want to take a closer look at something like this, you might find one or another piece of information there.

Here you can find the original article.

Renaissance - GNUStep GUI description language and library also for OS X Cocoa

Pyco - Tiny Python Distributions - build small Windows EXEs from Python tools.

Lasso - Souk - Python module for integration of the Liberty Alliance Single Signon Protocol.

Module Pycaml

Interesting project: someone has written a reimplementation of the Python/C API for OCaml (of course the native-code compiler, not the bytecode interpreter). This makes it possible to do the following things:

  • Write Python extension libraries in OCaml
  • Use Python-C extension libraries in OCaml
  • Use Python modules in OCaml (generally use the Python interpreter in OCaml)
  • Use the Python toplevel for OCaml

It all sounds very exciting and could be very interesting for some applications - OCaml produces very fast code and can easily compete with C in this area. Especially for implementing the parts of code that are too slow in Python, OCaml is of course much more interesting than C because of its significantly better type safety.

Here's the original article.

Python 2.4

Now it's out.

Here you can find the original article.

Python Packages Index: pyDB2 0.996a - DB/2 API for Python - need that at work

Fangs: The Firefox Screen Reader Emulator Extension - Standards-schmandards

A screen reader emulator for Firefox. So you can see how your own pages would come across in a screen reader.

Here's the original article.

tsearch-v2-intro - Introduction to tsearch2 - a full-text index technique for PostgreSQL

Tsearch2 - full text extension for PostgreSQL - Further documentation on tsearch2

Yet another Project in Python

If you've taken a closer look at the Toolserver, you may have already suspected that I want to do more with it. A second project that I started a few days ago will serve the same purpose. Active Storage Framework for Python is a Python framework for putting data into databases. However, not one of the usual object-relational mappers, but its own database structure that simply misuses a SQL database underneath as a data storage — I didn't want to reinvent everything. The ideas of the Active Storage Framework for Python come from Userland Frontier and Mumps — so a hierarchical namespace in which all elements are automatically persistent and in which many object types are mapped as tables (similar to Frontier). The whole thing uses pretty much every introspection feature of Python that I know. Ok, there are some programs from me that use even nastier methods, but sometimes I'm ashamed of the particular hacks there — what I've done here is considerably cleaner. Mainly getattr and friends. Though taken to excess. As a starting point for the Active Storage Framework for Python, the README is a good choice. If you want to try it out: PostgreSQL and psycopg must be installed. Otherwise you just need a database and you can get started. The Active Storage Framework for Python creates the database schema automatically. At the moment it's only available in CVS, since I'm currently — it's still 0.1.0 — tinkering wildly with it. Interfaces and data structures can still change significantly.

Here you can find the original article.

Toolserver Framework for Python - Slides

Anyone interested in the project Toolserver Framework for Python - a server written in Python that makes creating web services simple and convenient - can take a look at the presentation I recently gave to colleagues about it. To view the presentation, you need a reasonably current browser that supports and has JavaScript and CSS enabled. Yes, even the devil's tool works with it.

If the slides seem too vague without my commentary, you can simply print the presentation in your browser. This pulls a different CSS stylesheet and the printout includes supplementary explanations. Basically what I talked about. The presentation system used is actually quite clever - it's S5 by Eric Meyer. Practically perfect for quickly putting together presentations with notes and publishing them on the web. And I still prefer vi to PowerPoint. Here's the original article.