Schemix is a Scheme system, implemented as a patch to the Linux kernel. It aims to attain R5RS compliance while remaining small, fast and easy to understand.

The intended use of Schemix is for exploration of the Linux kernel and for rapid, interactive prototyping of Linux drivers and other new kernel features. To achieve this, Schemix will attempt to make a large subset of the kernel functionality available to Scheme programs. Interactivity is via a character device, /dev/schemix which presents a REPL (Read, Eval, Print Loop) to anyone having access to the device.

    $ echo "(display (+ 1 2 3))" > /dev/schemix
    $ cat /dev/schemix
    $ cat > /dev/schemix
    (define foo (kernel-lambda (char*) printk))
    (foo "Blah, blah, blah")
    $ dmesg | tail -n 1
    Blah, blah, blah

Tags: ,

7 Responses:

  1. brad says:

    I'm surprised I haven't seen that on sweetcode. Definitely worthy.

  2. icis_machine says:

    i guess the part i get lost at is the word 'rapid'.

    • justinjs says:

      How so?

      Having a REPL with access to the kernel structures is a really huge win for testing and debugging, even if the language you're really writing in isn't the one you're testing with. Every time I switch back from developing in a language/implementation that has a useful REPL to a system that doesn't, I notice that development (especially initial prototyping) slows down significantly. Having this is a big win in nearly any development situation.

      If you were referring to the speed of stuff actually written in it... I haven't looked at the internals of Schemix yet, but Scheme in general is one of the most optimization-friendly languages around. A number of Scheme implementations out there are Very Fast.

      So, what part of 'rapid' lost you?