Slashdot Mirror


Schemix - A Scheme In The Linux Kernel

Phs2501 writes "Schemix is a Scheme running in the Linux kernel. It presents /dev/schemix to send Scheme forms to, and has extensions to read and set (C) kernel variables, call kernel functions, and make devices. If you've wanted to prototype your drivers in a high-level language that's 100% in the kernel, here you go."

58 comments

  1. The Schemix home page by halfnerd · · Score: 0, Redundant

    Schemix

    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.

    Schemix is based on a stripped-down and modified version of TinyScheme. Currently the system can be successfully compiled into a 2.4.x kernel, which then reads and executes Scheme code from /dev/schemix. Any output is written to /dev/schemix.

    The following is a short example of a Schemix session (colour coded to make it easier to read):

    $ cat /dev/schemix

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

    $ dmesg | tail -n 1
    Blah, blah, blah
    $ echo "(make-device foo ((a 1) (b 2)))" > /dev/schemix
    $ ls -l /dev/foo
    crw------- 1 root root 10, 1 Mar 31 14:09 /dev/foo
    $ echo "(display a)" > /dev/foo
    $ cat /dev/foo
    1
    $ echo "(display a)" > /dev/schemix
    $ cat /dev/schemix
    Error: eval: unbound variable: a
    $ echo "(exit)" > /dev/foo
    $ ls -l /dev/foo
    ls: /dev/foo: No such file or directory
    $ # the following assumes there is an exported variable 'int blah' in the kernel source.
    $ echo "(define read-blah (kernel-getter (int) blah))" > /dev/schemix
    $ echo "(define write-blah (kernel-setter (int) blah))" > /dev/schemix
    $ echo "(display (read-blah))" > /dev/schemix
    $ cat /dev/schemix
    0
    $ echo "(write-blah 42)" > /dev/schemix
    $ echo "(display (read-blah))" > /dev/schemix
    $ cat /dev/schemix
    42

    The most frequently asked question about Schemix is 'why?'. This is good. People should always ask 'why?' when something gets pushed from user-space into kernel-space. There are things about the Scheme language though, that make it a Good Thing to have in the kernel:

    * Scheme is a very safe language. It doesn't allow you to create arbitrary pointers or over-run buffers. If you divide by zero, the universe will not end. This makes it a good language for prototyping, because prototyping is basically the act of making lots of mistakes until, eventually, you make the right mistake and call it a finished product.
    * Schemix is small. It adds very little overhead to a kernel but provides lots of power and flexibility.
    * Schemix can be very secure. If you are brave enough to use Schemix in a production system you can shut down the /dev/schemix REPL by doing 'echo "(exit)" > /dev/schemix'. Also, if you don't use any of the kernel-* functions provided by Schemix and just stick to R5RS Scheme, you should never be able to crash the kernel.
    * It's fun

    The current release of Schemix (2.4.20) can be downloaded from here

    Features that are planned but not yet implemented:

    * The special forms kernel-getter and kernel-setter will be extended to allow getting and setting of multi-dimensional variables, e.g.
    o (kernel-getter (char* 1024) foo) ; foo is a string with maximum length 1024
    o (kernel-setter (int** 50 50) bar) ; bar is a two-dimensional array of ints (50 x 5

    1. Re:The Schemix home page by sir99 · · Score: 4, Interesting

      Intriguing. I bet this could be useful for making a nice active firewall, instead of using iptables or a kernel module for the netfilter hooks. It should be interesting to see what ideas come of this.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
  2. Woot! Drivers in Scheme! by RevAaron · · Score: 4, Interesting

    Long have C people rallied behing it for all uses simply because it can (and usually should) be used for writing drivers or kernels, even when the application in question is a desktop GUI app.

    No longer does that argument apply- Schemix could be a great tool for those without a prejudice against Lispish languages who want to develop drivers or learn about the kernel. The value of an interactive environment cannot be understaed in the realm of learning, debugging, and development. I imagine this could be especially useful with kernel development, where debugging can be a bit harder than the usual user-space app.

    Naturally, for most drivers, you'll end up converting or compiling the code to C from Scheme, but I imagine there are some situations where straight-up Scheme would perform fine. From what I can tell, Schemix itself doesn't include an implementation of a Scheme->C compiler, but I bet some wrappers for one of the many Scheme compilers could be written to allow folks to write, develop and debug drivers/kmods in in Scheme, and when you're all ready to deploy, compile to C.

    Let's hope this sort of thing is the future of development- the lucky of us out there have been doing this for desktop development with Smalltalk and Lisp systems for quite a while.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    1. Re:Woot! Drivers in Scheme! by cpeterso · · Score: 3, Interesting


      If device drivers were written in Scheme, then the same device driver could (possibly) work on an other OS that supported the Schemix driver API. You could have one device driver that works on Linux, Windows, BSD, ...

    2. Re:Woot! Drivers in Scheme! by RevAaron · · Score: 1

      A side effect I didn't even think of! However, a Schemix driver for linux would have to be adapted quite a bit, unless there was a unified driver API. I've never done any driver programming, so I'm not sure how different the driver APIs are in Mac OS X, Linux, BSD, Windows, or other Unices. But as with all things, it could be a great thing to have!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    3. Re:Woot! Drivers in Scheme! by Atzanteol · · Score: 1

      C does not necessarily mean the driver is non-portable. One would only need to create a portable API. In fact, this has been suggested, but always rejected due to performance reasons.

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    4. Re:Woot! Drivers in Scheme! by Anonymous Coward · · Score: 0

      What we would really need to do is have a minimal kernel, and load the rest of the kernel functionality with the interpreter. If done right, we could upgrade kernels on a running system.

      Following that, I would like to see all of the base OS programs written in the interpreted language.

      My only problem with this is that it should be a forth kernel, not scheme.

    5. Re:Woot! Drivers in Scheme! by goga · · Score: 1

      I can see a couple of problems with that.
      First, Scheme requires GC. Kernel memory isn't GC'd.
      Second, compilers from Scheme to C produce unreadable code (Hobbit is an exception, but it was buggy beyond repair last time I looked). Thus you would need to teach Linus Scheme to get that code into the kernel.
      Debugging and prototyping -- yes, but read Scheme code in the kernel -- no.

    6. Re:Woot! Drivers in Scheme! by Horny+Smurf · · Score: 1

      It's called HURD. Look into it.

    7. Re:Woot! Drivers in Scheme! by Anonymous Coward · · Score: 0

      Oh goodie, drivers in an untyped language... What a grand idea.

    8. Re:Woot! Drivers in Scheme! by RevAaron · · Score: 1

      Linux wouldn't have to know Scheme for me to write various kernel mods or drivers available for download from my site. It doesn't have to be included with the kernel...

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    9. Re:Woot! Drivers in Scheme! by sxpert · · Score: 1

      however, there's a problem... how will people be able to write proprietary binary drivers ???

    10. Re:Woot! Drivers in Scheme! by voodoo1man · · Score: 1
      "First, Scheme requires GC. Kernel memory isn't GC'd."
      Well, the obvious thing to do would be to write non-consing Scheme code (possibly by restricting yourself to a subset of Scheme - see the reference to "pre-scheme" in this article on the history of the T Scheme compiler). The other thing would be to write a garbage collector for kernel memory (or at least those parts that Schemix uses - again, see the abovementioned article on T for a mention on how they built a GC for T in T). I think the former is doable, and the latter (just for Schemix; I don't like the idea of messing with Unix kernel memory allocators, and Unix people don't like the idea of generalizing their interfaces) can probably be done as well.
      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    11. Re:Woot! Drivers in Scheme! by voodoo1man · · Score: 1
      "Long have C people rallied behing it for all uses simply because it can (and usually should) be used for writing drivers or kernels"
      "The value of an interactive environment cannot be understaed in the realm of learning, debugging, and development. I imagine this could be especially useful with kernel development, where debugging can be a bit harder than the usual user-space app."
      I find this attitude that C is the only language with which to do systems programming really surprising. No one seems to remember that Forth was the preferred language for systems programming on the early micros. It was really well suited to interacting with hardware, it had fast I/O, good compilers (especially compared to the slow bloated mess that is a modern optimizing C compiler), and really fast execution speed - and it also had an interactive top-level, including interactive debuggers (with stepping, tracing, etc.), run-time definition and re-definition of words (functions), etc. Since the x86 doesn't have a lot of registers, Forth's stack-based computation model does make it a small amount slower than an optimizing C compiler, but on most RISC machines this isn't the case. It's a wonder it didn't catch on more. Maybe the curse of the pre/post-fix notation really is true?
      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

  3. /dev/schemix ? by termos · · Score: 0

    /dev/schemix?! I use /dev/urandom for these sort of things!

    --
    Note to self: get smarter troll to guard door.
  4. But I wanted... by cornice · · Score: 4, Interesting

    When will the python version be released or the perl version and don't forget ruby? This reminds me of Script-Fu for Gimp. Lots of people didn't want to work in Scheme so a number of other scripting languages were plugged in. Most didn't do very much but Gimp:Perl is now quite robust. I wonder if this will fire up a flame war over scripting languages for interfacing with the Linux kernel.

    1. Re:But I wanted... by RevAaron · · Score: 4, Interesting

      I doubt this will fire up any flame war because:

      a) not many people are registered to get this story, only people who specifically have an interest in the Developer section. It doesn't show up on the regular front page. Most of the idiots who would flame are weeded out that way.

      b) Anyone who thinks that the Schemix team should've implemented Perl, Ruby or Python kernel hooks should just quit crying and do the work themselves. There's a good chance that they'd find that in the course of the work that Perl/Ruby/Python would be more work to port into the kernel and use a huge amount of RAM, compared to TinyScheme, upon which Schemix is based. TinyScheme truly is tiny- less than 100k for the entire binary installation including a fair amount of library.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    2. Re:But I wanted... by JohnFluxx · · Score: 2, Insightful

      What's with the negative attitude, dude?

      "Anyone who thinks that the Schemix team should've implemented Perl, Ruby or Python kernel hooks should just quit crying and do the work themselves"

      I haven't seen anyone complaining. And the parent gave a perfect example of people who wanted other languages in gimp, and did write their own instead of "crying".

    3. Re:But I wanted... by RevAaron · · Score: 1

      It's not a negative attitude, so don't worry. Read the parent to which I replied. :) He said: I wonder if this will fire up a flame war over scripting languages for interfacing with the Linux kernel. My reply was to a question of his.

      I haven't seen anyone complaining. And the parent gave a perfect example of people who wanted other languages in gimp, and did write their own instead of "crying".

      Indeed, no one is complaining. And that's good. I didn't say anyone is. However, in the event someone did (like the parent mentioned), I would hope that they would just implement it rather than whine about the choice someone else made. That is, someone decided to use Scheme for any number of reasons and took the time and skill to create someone very cool, and anyone who just whines on a board about the choice that this programmer made to use Scheme over something else should either keep their trap shut or do some coding himself.

      That said, no one has whined on here, and that's good. I don't think that my attitude is negative. It is a helluva lot more negative when people complain or second-guess the decisions of people actually doing the programming. Maybe I seemed a little harsh, but I see a lot of that on Slashdot. Slashdot seems to be full of people who have done no coding work, but love to pretend to be experts in areas where they have no knowledge. Know it all pundits. :P

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    4. Re:But I wanted... by aminorex · · Score: 1

      I think it was a pre-emptive attack.

      --
      -I like my women like I like my tea: green-
    5. Re:But I wanted... by larry+bagina · · Score: 1
      scheme/lisp are easy to parse because valid input is already in a () list, and includes recursively embedded lists. That makes building the parse trees trivial (instead of the interpreters doing it, the user does it).

      gimp/script-fu used SIAD - Scheme In A Day -- a scheme interpreter (allegedly) written in 1 day. Could anyone write a perl or python interpreter in one day?

      Of course, most of the scrupt-fu scripts where more iterative than recursive. A procedural language like perl is better suited for that.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    6. Re:But I wanted... by steveheath · · Score: 1

      Actually this story is on the front page, so flame on! :)

      A very interesting development indeed, and I think that if anyone were to do work on a Perl/Ruby/Python kernel-plugin I think they'd probably start with a scheme interpreter. These interpreters tend to be good starting points for more complex languages.

    7. Re:But I wanted... by RevAaron · · Score: 1

      Or, one could use the existing Schemix system as-is, and write some code in Perubthon (heh) to wrap the API and generate scheme code. After all, it is just interfacing with /dev/schemix - you wouldn't even have to mess with sockets or some other RPC format.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  5. Good timing! by ctr2sprt · · Score: 1
    I was just thinking of something like this while taking a shower this morning. I was thinking more of a world where all the standard Unix programs were written in an interpreted language (and Scheme was my choice since I like it). I guess I thought of this as a result of that Unix-haters book. We really do have powerful enough computers nowadays that we shouldn't be using the speed of C to justify its use, and interpreted languages allow us to avoid some of the most dangerous types of bugs. Perhaps more importantly, true high-level languages let us achieve a much higher degree of portability, at least in theory. And interpreted languages let us do all sorts of nifty things (like closures) for when you really need the power.

    I expect that if this project ever takes off, what will happen is that someone will make it run Perl too. Then everyone will use that instead and duplicate 95% of the problems we already have. But then, I'm sure all the Perl advocates are complaining about how Schemix uses a language 95% of programmers have never used before.

    1. Re:Good timing! by Ed+Avis · · Score: 4, Funny

      Now all we need is for RMS to reimplement Emacs in Scheme, then we can put Emacs in the kernel, and then finally the UNIX-HATERS people might be happy!

      --
      -- Ed Avis ed@membled.com
    2. Re:Good timing! by JohnFluxx · · Score: 1

      "I was just thinking of something like this while taking a shower this morning."

      If you're going to lie, you should do so less obviously :P

      Just kidding..

    3. Re:Good timing! by IshanCaspian · · Score: 1
      We really do have powerful enough computers nowadays that we shouldn't be using the speed of C to justify its use


      God knows computers are way too fast already. . . I'm sure no one would notice if real-time hardware was run in an interpreter.
      --

      But there is another kind of evil that we must fear most... and that is the indifference of good men.
    4. Re:Good timing! by aminorex · · Score: 2, Informative

      ...reimplement Emacs in Scheme...

      Been done: Edwin.

      It came with TI PC-Scheme in the mid-80s.
      Google it, you might find a copy in the wild.

      --
      -I like my women like I like my tea: green-
    5. Re:Good timing! by voodoo1man · · Score: 1
      "Perhaps more importantly, true high-level languages let us achieve a much higher degree of portability, at least in theory. And interpreted languages let us do all sorts of nifty things (like closures) for when you really need the power."
      You should really stick to calling them "high-level" instead of "interpreted" languages. There's certainly no reason lexical closures can't be compiled (personally, I use CMUCL, so I get the benefit of an optimizing native-code compiler, but bytecode compilers also aren't really interpreters in the literal technical meaning of the word). Even though the Perl and Python projects haven't gotten around to making native code compilers (and now that it took Java to make byte-code VMs seem suddenly not so slow to most of the lemmings in the "programming" (I use the term loosely here) community, they may never need to get around to it), they still have some fairly decent bytecode systems right now.

      I like the idea of a dynamic language in the kernel, but looking at this project from a higher level, I think it would be nicer to have a microkernel with some standard set of interfaces for the servers/modules, so that there really could be the possibility of true language independence in writing system code. With Schemix, the fact that the rest of the kernel is written in C makes function loading/unloading and patching of that kernel section at run-time impossible - at least with a microkernel approach, this would be slightly more modularized.

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    6. Re:Good timing! by jtdubs · · Score: 1

      FYI, lexical closure have nothing to do with the fact that Lisps can are interpreted. They could work identically in a compiled language, such as a compiler-based implementation of Lisp.

      Lexical closures work because of lexical scoping (and vice-versa depending on how you approach it).

      To drive this point home, there are plenty of interpreted languages that don't have lexical closures. For example, python.

      Justin Dubs

  6. /dev/schemix creation question by Jon+Howard · · Score: 1

    I've contacted the mailing list, but on the off chance that someone on here knows the answer: How is /dev/schemix created? Moreover, what major/minor numbers are to be used?

    It's not in the dox, nor is it on the site.

    Thanks!

    1. Re:/dev/schemix creation question by Yokaze · · Score: 2, Insightful
      As far as I can see, automagically through the DevFS.
      [...] devfs_register( NULL, name, DEVFS_FL_AUTO_DEVNUM, [...])
      So, no major/minor numbers.
      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    2. Re:/dev/schemix creation question by GigsVT · · Score: 1

      Isn't devfs depricated?

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    3. Re:/dev/schemix creation question by Anonymous Coward · · Score: 0

      Misspellings are deprecated.

      Interesting note:

      A Google Search of the word deprecated returns w3.org and java.sun.com as the first two sites.

    4. Re:/dev/schemix creation question by Jon+Howard · · Score: 1

      Cool, thanks for pointing that out. I should probably switch over to devfs anyway, now's a dandy time for it.

  7. Evil plot revealed: by ianezz · · Score: 4, Funny
    First, people make an Emacs clone for MIT Scheme (Edwin).

    Then, some other people implement a shell and several command line utilities in Emacs Lisp (EShell).

    Then some other people implement a Scheme system inside the Linux kernel.

    Secret long-term goal: create a self-sufficient Emacs (codename Emax) that boots, thus obtaining the One True OS! :-)

  8. Evil plot revealed: The Counter-Movement by PM4RK5 · · Score: 2, Funny

    Yes, and to counter the Emax movement, we'll have VIMIX!

    Thus the inevitable debate continues...

    1. Re:Evil plot revealed: The Counter-Movement by Piquan · · Score: 1

      Excellent, a platform to power a robotic Vigor and take over the world! Bwahahaha!

    2. Re:Evil plot revealed: The Counter-Movement by ianezz · · Score: 1
      VIMIX?

      I'm pretty sure it would be called ViMS, and it would run mainly on old VAXen. :-)

    3. Re:Evil plot revealed: The Counter-Movement by standsolid · · Score: 1
      Thus the inevitable debate continues...

      but we all know ViMiX would so kick Emax's ass. There really isn't any room for debate.
      --
      WTPOUAWYHTTOTWPA
      What's the point of using acronyms when you have to type out the whole phrase anyways?
  9. I know you guys... by zogger · · Score: 2, Funny

    ..I know you guys think the developer section is secure, just wanted you to know you got at least one non coder lurker. I usually have NO IDEA whatsoever is being talked about, but after around a year now (didn't register for a long time)at least some of the jargon is comprehensible. Not much, but some.

    So this is a good idea, huh?

    OK, lamer question. If you had never coded anything before, what language would you start with, and why?

    1. Re:I know you guys... by Anonymous Coward · · Score: 0

      I started with perl. Well technically I started with Basic, but that really doesn't count.

      Dunno why I started with perl.... Took a look at C and decided I wasn't going to try it as my first language. Now that I know a goo bit of perl, I think I can tackle C.

      And PHP is a lot like perl. I dabbled in it a little too.

    2. Re:I know you guys... by gangien · · Score: 1

      Depends, I my self love to code in any language i've ever seen. So if it was me.. i dunno I might do LISP or Scheme to start because they are extremely powerful and knowing one of them well, could be a very beneficial thing. On the other hand since most of coding is not done in functinoal languages I might start with C. C is the most beautiful language I think. almost as low as machine language yet a high level language that is extremely powerful, I gotta love it. So i dunno, I'd say if you want to become a coder go with C/C++, if you want to become a computer scientist go with LISP or Scheme.

    3. Re:I know you guys... by Anonymous Coward · · Score: 0

      Python. It strikes a nice balance between conceptual purity and pragmatism. And it is one of the easier languages to learn and use. I think it would be friendly to beginner programmers.

    4. Re:I know you guys... by archeopterix · · Score: 1
      OK, lamer question. If you had never coded anything before, what language would you start with, and why?
      That depends on the reasons behind your interest in programming.

      Wan't to quickly create a Windows app? Visual Basic (the language is ugly, though - it didn't even have array constants last time I checked) or Delphi (Object Pascal isn't perfect either, but still much better).

      If you just want to learn basic programming techniques, I agree with previous poster that Python is very friendly and yet elegant, so it's probably good to start with. As far as I remember, there's even an article combining a Python tutorial with an introduction to programming.

      If you are perfectionist with a background in mathematics, you might want to check OCAML. It isn't actually easy to learn, but its syntax is small and semantics very formal - people who don't like constructs that "work, but you don't want to know why and how" might prefer this language.

    5. Re:I know you guys... by Anonymous Coward · · Score: 0

      I vote for Java.
      1. I found it easy to learn.
      2. It does not tie you to one OS like VB does.
      3. It is very useful and you can get lots of help for it.
      4. Not all that hard to move from Java to c++.

      I do not know Python but I have heard that is is a very good first programing language.
      All the Lispish languages out seem interesting I just have not had time to learn any of them.
      Good luck.

    6. Re:I know you guys... by dash2 · · Score: 1


      For ease of use and teaching you good principles, Python would be ideal. On the other hand, if you are thinking of making this a career, you might want to consider Java. It is also relatively straightforward, although a bit less "high-level" than Python, and it has very widespread acceptance in the commercial world.

      dave

    7. Re:I know you guys... by aug24 · · Score: 1

      Lamer answer: Depends what you want to do.

      I've studied about ten[1] and learnt something from each of them. ...but only Java and C++ rock.

      Justin.
      [1] Thinks... several Basics, C, C++, Pascal, Fortran (shudder), Lisp, Java, JavaScript, Oracle PL/SQL, Rexx. There's prolly more...

      --
      You're only jealous cos the little penguins are talking to me.
  10. java. by Anonymous Coward · · Score: 0

    its clean, freely available and good.

  11. Regarding schemes [Slightly Off Topic] by Anonymous Coward · · Score: 0

    On the subject of schemes, be sure to check out the Scheme Shell . You may be particuluarly interested if you are looking for a cleaner way to write shell scripts.

    Scsh has two main components: a process notation for running programs and setting up pipelines and redirections, and a complete syscall library for low-level access to the operating system, i.e. to POSIX, the least common denominator of more or less all Unices, plus widely supported extensions such as symbolic links and BSD sockets. Moreover, scsh provides an awk facility for pattern-directed computation over streams of records, a rich facility for matching regular-expression patterns in strings, event-based interrupt handling, user-level threads, a futuristic module system, and an interactive environment. Scsh comes with extensive documentation describing these and other features.

  12. RTLinux? by statusbar · · Score: 1

    This would be a very interesting thing to use in conjunction with the Real Time Linux extensions, so one could dynamically modify their real time tasks. It would probably make the writing of the real time tasks even simpler.

    --jeff++

    --
    ipv6 is my vpn
  13. Ok. by noselasd · · Score: 1

    Sounds ... useful.. Scheme is such a nice language. Particular useful in the kernel I can imagine. ...er wait a minute!

  14. Language to start with by brlewis · · Score: 1

    The How to Design Programs book and DrScheme environment make for a good start. DrScheme has settable "language levels" that turn off advanced features. This lets you get more intelligible error messages when you're just starting out. Without this feature, programmer newbies get strange error messages when a typo unintentionally invokes advanced language features.

  15. Cool, done alredy though by AxelTorvalds · · Score: 1
    Several people on the kernel list have always been against this stuff. I remember seeing some messages by a few people working on implementing Forth in kernel space. Sun uses forth for their firmware, it is a great step above assembly language that is tiny and easy to implement. I'm not sure how practical it is to expect scheme drivers but forth drivers are very realistic. http://www.dedasys.com/freesoftware/files/kpforth- 21.tgz>here is one link. I'm not sure if it's a good idea or not, there is a certain CS geek appeal that makes it feel more extensible or easier to patch or something, of course you've got the full code. With a good forth or scheme interpreter it might be possible to hot patch things in the kernel while it's live, that's cool in some environments; of course all of the places where that's cool for HA reasons, it's also bloody dangerous and the risk offsets the cool factor.

    Now with something like scheme, if it could perform well enough and get robust and polished enough (I looked at schemix, it's still very primitive, no way you'll see it in Alan or Linus's kernel any time soon) but if it matures I could almost see that being used for some scheduling and some other tasks where you want sophisticated logic that it's complex to do in C and not always safe. Of course, that's assuming that some folks in the kernel would ever acutally agree to it.

  16. API or ABI? by yerricde · · Score: 1

    C does not necessarily mean the driver is non-portable. One would only need to create a portable API.

    Because drivers published by device manufacturers contain proprietary trade secrets, one would need to create a portable ABI (application binary interface), which has had even worse performance problems than a portable API.

    --
    Will I retire or break 10K?
  17. Scheme is smaller than Perl by yerricde · · Score: 1

    people who wanted other languages in gimp, and did write their own

    There is a difference between kernel space and user space. Perl is OK in user space, but I find Scheme in the kernel less objectionable than Perl in the kernel because Scheme is so much smaller than Perl.

    --
    Will I retire or break 10K?
  18. and in late news... by alext · · Score: 1

    Indeed.

    I thought you were going to go on and suggest that a late-compile language like Scheme would overcome Linus's objection to microkernels.

    Idea being that glue code necessary for modularization disappears as a result of run-time optimization, as in Java.