programmierung - 1.4.2005 - 8.7.2005

larger Haskell sources

Who like me prefers to dig through sources to learn languages, here are a few larger Haskell projects to choose from:

  • [Haskell User-Submitted Libraries][0] is a collection of partially older but still interesting Haskell projects. Downloadable is an IRC bot and in the CVS there is also a web server with a plugin interface.
  • [Pugs][1] is a Perl 6 implementation in Haskell. [I've already mentioned it][2], it's still cool |:-)|
  • [darcs][3] is a distributed source control system. [I've also mentioned it][4], but it's still cool.

Helium - Haskell Learning System

Helium is a Haskell subset compiler specifically developed for teaching. It provides more detailed error messages and further analyzes sources to make these messages possible. However, it is really only a subset of Haskell - and since type classes are missing, a quite important part is missing. But to get a taste of functional programming, it is quite useful.

As textbooks, The Craft of Functional Programming and The Haskell School of Expression are recommended. I ordered both - my Haskell knowledge is more than primitive and hopelessly outdated (if that is even possible with a relatively young language like Haskell).

One of the more complex topics in Haskell are the Monads - a way to simulate things like side effects and sequentiality in a purely functional language with lazy evaluation - simply because you sometimes want the output before the input, for example when querying data from the user, or when you want to save a state that is called again later. The tutorial helps to understand the concept of Monads.

PHP-Serialize for Python

Hurring.com : Code Vault : Python : PHP-Python Serialize : v0.3b is an implementation of the PHP serialize() stuff in Python. Very practical for WordPress: often serialized structures are stored in the options that you can resolve this way - you can write tools that work directly on the database, but are written in Python. The author has done the same for Perl - you can thus push simple data structures back and forth between Python, Perl and PHP.

Whiners and Open Source

IT decision-makers demand in an open letter more focus on the areas important to them:

In an open letter to "the" Open Source Community, IT decision-makers from various fields have urged to orient themselves more towards the actual needs of users from the corporate sector.

I always find it fascinating with what audacity some people make demands on voluntary work, only to then use it for their own purposes. Some demand the abolition of the GPL because the conditions don't suit them, the next demand focus on the desktop because they want an alternative to Microsoft, others demand more focus on high-performance servers because SUN machines with Solaris or IBM servers with AIX are too expensive for them.

Strangely enough, I only ever hear demands in open letters - but it would be much more sensible to simply support the corresponding project financially and with manpower. But that would be one's own effort, which one wants to avoid precisely. Demands for better support and better documentation also fit in here - both things that companies could easily set up themselves. But one is too good for that.

Sorry, but to me, such open letters to Open Source developers always sound like whiny little children who absolutely want an ice cream.

Sorry, folks, but that's not how it works. A large part of the Open Source Community still consists of hackers and enthusiastic amateurs and tinkerers. This often produces great crap and occasionally brilliant solutions. And it produces only what people feel like doing - if writing documentation is boring and annoying for someone, they will not spend their free time on it.

You have an itch? Scratch it. Yourself.

Objects and Functions with JavaScript

Since the OO aspect of JavaScript is often overlooked, here's a text about Object Hierarchy and Inheritance in JavaScript.

I myself have been a fan of this approach to OO since my first encounters with prototype-based OO languages like Self and NewtonScript - the pigeonhole thinking of class-based OO approaches is often restrictive, especially when modeling real-world objects.

By the way, JavaScript also has a whole lot of other nice features that are often overlooked - first and foremost the nice anonymous functions, through which Closures in JavaScript are realized. And higher-order programming can also be implemented with it.

If you now combine Prototype-OO and Higher-Order-Programming, something like Prototype might come out - a library for JavaScript with a lot of interesting extensions such as elegant Ajax bindings, simpler callback construction and many other toys. Another possibility could arise from Bob Ippollitos MochiKit, if it is ever published (and lives up to the hype).

Prototype, by the way, requires a lot of imagination as to what can be done with it - there is no documentation after all.

Open-Source Blabbermouth

Eric Raymond claims the GPL could harm the success of Open Source:

Eric S. Raymond told Federico Biancuzzi of the Italian Linux magazine Linux&C during the international forum for free software in Brazil that the General Public License could hinder the progress of Open Source.

What lies behind this is of course only his boundless stupidity and craving for attention and the constant inferiority complex towards Richard Stallman - because unlike Eric, Richard has a concept and a consistent idea. Regardless of how one stands on what Richard Stallman says - one must acknowledge that he has a line and pursues it clearly.

Eric Raymond, on the other hand, falls for cheers that he is a millionaire and other stupid remarks - and thereby threatens other open source people like Bruce Perens. And otherwise talks a lot of nonsense.

Abolishing the GPL would be a very stupid idea, because in many areas it is precisely the GPL that protects open source projects - just look at the current GPL violations. If the corresponding sources were under the BSD license, no one would care and the topic would be done - companies would simply help themselves cheaply and that would be it.

But Eric Raymond has never understood the difference between free software and free beer ...

vcXMLRPC is an XML-RPC implementation in JavaScript. Very practical for integrating JavaScript code and server code when you don't want to manually piece together every encoding/decoding. However, the project apparently stopped being developed in 2001.

PEP 342 -- Coroutines via Enhanced Generators

PEP 342 describes simple coroutines for Python. Coroutines are essentially mini-threads with manual control - you can freeze code in the middle and restart it with a new defined value. Thus, coroutines provide the first step towards primitive continuations - the only thing missing would be the ability to copy a coroutine.

Philip J. Eby writes about the implementation of this PEP - which, by the way, is based on Python's generators and iterators.

Come on, folks, finally ensure that generators are copyable and it's done.

LiveSearch with WordPress works

I just took a look at LiveSearch and played around with it a bit. It can be integrated into WordPress with some hacking. If you now enter a term in the search form on the right, a list of search results will appear after a short delay - specifically the titles of the posts. This uses the normal WordPress search, so these are the same results you would get if you simply pressed Enter - just faster thanks to Ajax and as a direct inline list. Fun stuff. Should work with current IEs, Mozilla derivatives, and current Safaris.

However, strangely enough, the cursor keys for moving through the search results don't work for me, even though the code seems identical to the BitFlux page. Somehow it doesn't find the first line or something - very strange. But that part doesn't really interest me, so it doesn't bother me if it doesn't work.

Hmm. Safari works flawlessly, but my Firefox under OS X doesn't seem to work. Very strange. To be precise, it works with Firefox only after I delete a character with Backspace or press Space once. After that, it runs smoothly. Can someone explain this to me? Strangely enough, the cursor key navigation in the search results works with Firefox - if you have a list of results...

Update: strangely enough, the cursor key navigation now works in Safari. Something here is very strange ...

Microsoft and RSS

Well, Microsoft is jumping on the RSS bandwagon and what do they do? Of course, they create an extension that will likely cause problems with many parsers: Simple List Extensions Specification.

Where the problems might lie? Well, Phil Ringnalda has described it quite well. And when I look at the above format description from Microsoft, I'm not really clear why they need this extension at all ...

WebObjects 5.3 and Linux?

Apple releases WebObjects 5.3 Update:

Deploys to virtually any J2EE server or the WebObjects J2SE application server

Who hosted the first WebObjects application under Linux on an OpenSource J2EE server?

The Hitch Hiker's Guide to the Smalltalk Compiler is an older but still good description of the compiler classes in Smalltalk-80 derivatives like VisualWorks Smalltalk and Squeak.

del.icio.us mal Wiki = Code Snippets

Code Snippets is a system where you can insert small code snippets and assign tags to them. So really something like a wiki for source code with tags. You can quickly group by tag combinations and then see all the snippets for this topic. And of course, you can easily add your own snippets. Could be very interesting with a bit more content - so to speak, living cookbook books.

WebKit, WebCore and JavaScriptCore - Open Source

Surfin' Safari reports that WebKit (the Objective-C API for the Safari renderer), WebCore (the base code) and JavaScriptCore (the base code for the JavaScript implementation) are now open source. With CVS repository and public bug tracking system.

Ultimately, this is of course a fork of khtml and kjs, but by disclosing the sources, everyone can now freely use each other's code and thus the problems between the projects should be off the table for now. Contributions are also to be accepted.

WebObjects Part of XCode 2.1

In the WebObjects 5.3 Release Notes I saw and immediately checked: WebObjects is now part of the XCode 2.1 (available for ADC members) distribution. I downloaded the over 700 MB and checked: yes, there is a WebObjects.mpkg in it. Quite strange, because so far WebObjects was not a cheap package - is now the whole deployment free, or do you still need some kind of runtime for the generated applications that then costs money again?

Emacs on the metal

From the Movitz mailing list: Emacs on the metal. Someone wrote an Emacs clone in Common Lisp and then created a bootable Movitz kernel image from it. Movitz is a system for programming embedded applications in Common Lisp - and thus the Emacs clone is the first truly bootable Emacs. Sick

The CHICKEN Scheme Compiler

A frequently overlooked (also by me) Scheme implementation is the CHICKEN Scheme Compiler. What's special about this implementation: in addition to the interactive interpreter, there is a compiler that produces portable C and compiles it into loadable modules using a C compiler. This makes this compiler particularly good for integrating C libraries. In principle, this is still quite similar to Gambit-C, another Scheme implementation that uses C as an intermediate language.

But Chicken goes beyond Gambit-C in terms of generated C code - the system is explicitly designed to be mixed with C, while Gambit-C simply uses C as a portable assembler. In Chicken, the FFIs (Foreign Function Interfaces) are much simpler. This is evident in finished interfaces to various databases such as metakit (used in the Python Desktop Server), PostgreSQL, and sqlite.

In addition, Chicken has gained a nice infrastructure of network-installable extensions with the Eggs - with web server, database, and many other delicacies. This of course helps immensely in programming - I have come to love such an infrastructure of ready-made code with MZScheme, Python, and Perl.

Chicken also compiles under Mac OS X. At the moment, the compiler is running in the background for me.

Algol 68 Genie - An Algol 68 interpreter. Obercool. Algol 68 is indeed a vintage language, but a fascinating one: the only one where a metalanguage was defined for the definition of the language itself, in which the definition of the language itself is written. The Algol68 Report is still one of the most fascinating programming language standards I know.

LispWorks Personal 4.4.5

LispWorks Personal - the free (free beer-free) LispWorks version is available in the new 4.4 release and also runs with Tiger. LispWorks is currently the most interesting Lisp environment for the Mac, as it integrates relatively well into the system. And the Personal version is quite sufficient for playing around.

TBNL - A Toolkit for Dynamic Lisp Websites enables generating dynamic content with Common Lisp. Essentially, it's something like a FastCGI solution for Common Lisp.

Dive Into Greasemonkey is a free online book by Mark Pilgrim about programming userscripts for Greasemonkey. With these userscripts, you can change websites when they are displayed using JavaScript - for example, cut out firmly integrated advertising blocks, rewrite links with affiliate IDs so that your own is used, simply repair strange HTML so that you can actually do something with the website, or all kinds of other fun things.

FramerD is an object database (ok, a Framestore - but it's something similar) with an integrated DB server, CGI interface, and Scheme scripting language. Ideal for building knowledge databases, as FramerD is optimized for the pointer-heavy structures involved. But also very exciting, as you get a Scheme with server and ODB. I definitely have to play with it, especially since it should also compile on OS X (though it doesn't work for me right now). And it is licensed under GPL. And for the snake charmers among the monkey programmers, there is also an experimental Python library for accessing FramerD...

CamlServ is a web server in OCaml. I haven't looked at it in detail yet, but it could be interesting - OCaml is a language of the ML family (or the ML-like languages) with various very interesting extensions (e.g. a powerful object system). Unfortunately, the project does not seem to be very active anymore - last release from 2003 ...

Quartus Forth 2.0.0 is the new version of native-code Forth for the Palm platform. I've played around with it (and its predecessor PilotForth) for a long time - I'm just an old Forth fan.

yadis: yet another distributed identity system is a specification for a distributed identity system. Let's take a closer look.

Free Pascal 2.0 is out

Free Pascal is a Turbo Pascal and Delphi compatible Pascal compiler. The new version supports significantly more CPUs and platforms - including Mac OS X. And for Panther there is also an XCode integration. Finally, a Pascal that works for the Mac. Not that I would do much with it today - but somehow Pascal was a part of my programming history (after all, I took care of the Gateway software Erwinsgate for the MausNet, which was written in Turbo Pascal, for a long time).

May seems to be the month of vintage languages for me.

OpenCOBOL - a COBOL compiler

OpenCOBOL is a Cobol compiler that compiles Cobol to C and then lets gcc loose on it. Yes, I confess, 10 years of my professional career were wasted on Cobol.

XDS Modula-2 / Oberon-2 Compiler

The XDS Compiler is a whole family of extremely good compilers for Modula-2 and Oberon-2. I know them from my DOS days, I worked a lot with them - they used to be purely commercial, now they are freeware (but not Free Software or Open Source - Free as in Free Beer, not Free Speech). There are native compilers for Windows and Linux 86 and - my personal favorite - XDS/C Compiler, which compiles Modula-2 and Oberon-2 into surprisingly readable C. Unfortunately, the XDS/C Compiler is only available for Windows and Linux 86 - an OS X version would be nice, but is unfortunately not available.

Sparkline PHP Graphing Library provides small, compact graphics that fit well into text - ideal for example to better visualize trend data.

KDE developers annoyed with Apple - because they once again don't understand how to work in a team and send patches to an upstream project. Collaboration between companies and open source projects is still problematic - companies simply have a completely different agenda than the OS project.

The .emacs File by Bill Clementson. Shows very nicely why one should actually consider using Emacs. Particularly interesting for Common Lisp users is his customizing for Slime for integrating various Common Lisps.

Those who only occasionally work with PostgreSQL, so to speak, want to use it as a desktop database: PostgreSQLX is a compilation of the PostgreSQL server that can be easily started and stopped as a Mac application. Ideal for developers. Then also the PGAccess interface and you can do without something like Microsoft Access. Of course, all of this only from 10.3 (it's about time 10.4 comes out and I'm up to date at home again).

Borland open sources JBuilder - wow. I didn't see that coming - it's basically a surrender. Can Borland stay afloat without JBuilder?

Striped Calendar for WordPress

First plugin from my picture blog (now out) is the Strip Calendar. Basically a normal WordPress calendar - only not as a block for the sidebar, but as a strip to place it over the content. Since you usually have more space to waste in the length of a page than in the width and since someone might want to break with the rather worn-out format where the calendar is in a sidebar, you can now simply install the strip calendar. The code for installation is trivial:


< ?php get_strip_calendar(); ?> ```

Just put this in the header.php or wherever you want the calendar. Done (of course first unpack the plugin to wp-content/plugins/ and activate it in the administration!).

Practical Common Lisp is a new book about Common Lisp with many practical examples. Finally, a Common Lisp book that doesn't just delve into rather theoretical examples but addresses practical topics such as spam filters, web servers, HTML generation, ID3 tags, and other stuff. The book content is available to read online.

Bistro Intro is a Smalltalk variant that runs on the Java VM. I didn't know that before.

'Cool it, Linus' - Bruce Perens - a bit more information about the BitKeeper story. And I agree with Bruce - Linus should never have started this silly BitKeeper business in the first place. Andrew Tridgell is just doing what he does best - cracking proprietary protocols. It's silly to attack him for that.

Homemade system as BitKeeper replacement - sometimes the arrogance of OSS programmers bothers me, who always think they can do everything better than others. How much more synergy effects would come into play if these programmers would concentrate their - undoubtedly present - programming qualities on a few projects? A good source management system with fast patch handling we could all use - but no one is served with two dozen half-baked solutions ...

/IE7/ is a project that teaches IE6 CSS properly using a JavaScript library. This should also make :before and :after work in combination with content: - not entirely unimportant for HTML-free rounded corners or HTML-free link identification through symbols ...

Simulation of :before with content: in IE6

The IE6 just can't handle :before when you want to insert content into the page via content: in the CSS. Quite annoying if you use it. The IE7 project that I wrote about in the previous article doesn't work reliably for me either - for example, under a Citrix server it won't execute it, probably because some security settings are missing there. Strange. Anyway, I looked at the problem myself and found a fairly compact solution, at least for my specific version of the problem: I just want to place icons before a link.

For this, links have one of three classes or no class: class="zu" defines a collapsed navigation element, class="auf" an expanded one, class="ohne" a link that should not be specially beautified, and all other links get a standard icon.

For this, I simply attach the following code at the bottom of the file just before the /body:


var links = document.getElementsByTagName("a");
for (var i=0; i

I then wrap the whole thing in a conditional comment for IE so that it is only executed by this. That's it. Simple and effective. Disabled JavaScript is not critical in my case, as without JavaScript on the system (it's a business solution with high interactivity) nothing will run anyway in the future - Ajax needs JavaScript as a component ...

SISC - Second Interpreter of Scheme Code

SISC Scheme is a very complete Scheme interpreter and compiler written in Java. Particularly interesting: there is a continuation-based web framework for it.

Other interesting features include good integration into the Java world through the Java-Scheme interface. In principle, all libraries from the Java world are also available in Scheme.

SISC Scheme also supports SLIB (an extension library for Scheme with many useful modules) and various SRFIs (Scheme Requests for Implementation - the formal way to extend the Scheme language with standard modules).

The Studs MVC Framework is a port and extension of the Java Struts Framework to PHP. In doing so, frameworks initially map a J2EE-like basic structure for servlets in PHP. To me, that naturally sounds like fighting the devil with Beelzebub.

Tags from Terms

Jonathan Luster has released his Y! Terms Extraction Plugin for WordPress. It uses the Yahoo services to extract relevant keywords from a posting text and presents them as Technorati tags in the post. If anyone tries this out: I would be interested to know how well it works with German texts.

By the way, I would also be interested to know when blogg.de offers an API. I mean, it's about time to catch up with the features of Technorati and Yahoo, right?

FeedWordPress is a plugin that turns a WordPress installation into a planet site: essentially a public aggregator, except that the entries go into a WordPress database.

Source management system BitKeeper now commercial only - for me, the choice of BitKeeper was a stupid idea anyway. And the argument that the other alternatives were not far enough at that time does not hold - then one would have simply continued working with CVS and waited until SVN or other alternatives were far enough.

TheMonadReader is intended to become a regular publication about Haskell. The first issue is linked. The whole thing is supposed to be less formal than classic scientific journals, so it could definitely become interesting. There is also an article about Pugs (Perl6 in Haskell) in the first issue.

Pugs - pugscode is a Perl6 implementation in Haskell. Even crazier: the entire project is primarily coordinated in an IRC chat and the collaborative work is done with SubEthaEdit. Is this already Nirvana?

Javascript Windows simulate a desktop within a webpage. You have a launch bar and small applications that must be HTML-based, which then appear in windows that the user can move, minimize, maximize, and close - basically a desktop, but within a webpage. Crazy idea.

Html Validator for Firefox and Mozilla - wow. Great extension: it directly validates the displayed webpage and integrates into the source view for debugging errors. Very nice - and has been featured in several weblogs in recent days (I don't remember where I first saw it).