Schemix - A Scheme In The Linux Kernel 58
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."
Re:The Schemix home page (Score:4, Interesting)
Woot! Drivers in Scheme! (Score:5, Interesting)
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.
Re:Woot! Drivers in Scheme! (Score:4, 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,
Re:Woot! Drivers in Scheme! (Score:2)
Re:Woot! Drivers in Scheme! (Score:2)
API or ABI? (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.
Re:Woot! Drivers in Scheme! (Score:1)
Re:Woot! Drivers in Scheme! (Score:1)
Re:Woot! Drivers in Scheme! (Score:1)
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.
Re:Woot! Drivers in Scheme! (Score:2)
Re:Woot! Drivers in Scheme! (Score:2)
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 [paulgraham.com] 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 do
Re:Woot! Drivers in Scheme! (Score:2)
I find this attitude that C is the only language with which to do systems programming really surprising. No one seems to reme
/dev/schemix ? (Score:1)
But I wanted... (Score:5, Interesting)
Re:But I wanted... (Score:5, Interesting)
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.
Re:But I wanted... (Score:3, Insightful)
"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".
Re:But I wanted... (Score:2)
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 di
Re:But I wanted... (Score:2)
Scheme is smaller than Perl (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.
Re:But I wanted... (Score:1)
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.
Re:But I wanted... (Score:2)
Re:But I wanted... (Score:1)
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 t
Good timing! (Score:2)
Re:Good timing! (Score:5, Funny)
Re:Good timing! (Score:3, Informative)
Been done: Edwin.
It came with TI PC-Scheme in the mid-80s.
Google it, you might find a copy in the wild.
Re:Good timing! (Score:2)
If you're going to lie, you should do so less obviously
Just kidding..
Re:Good timing! (Score:2)
God knows computers are way too fast already. . . I'm sure no one would notice if real-time hardware was run in an interpreter.
Re:Good timing! (Score:2)
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'
and in late news... (Score:2)
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.
Re:Good timing! (Score:2)
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
/dev/schemix creation question (Score:2)
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!
Re:/dev/schemix creation question (Score:3, Insightful)
Re:/dev/schemix creation question (Score:1)
Re:/dev/schemix creation question (Score:1)
Cool, thanks for pointing that out. I should probably switch over to devfs anyway, now's a dandy time for it.
Evil plot revealed: (Score:5, Funny)
Then, some other people implement a shell and several command line utilities in Emacs Lisp (EShell [emacswiki.org]).
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! :-)
Evil plot revealed: The Counter-Movement (Score:3, Funny)
Thus the inevitable debate continues...
Re:Evil plot revealed: The Counter-Movement (Score:2)
Excellent, a platform to power a robotic Vigor [sf.net] and take over the world! Bwahahaha!
Re:Evil plot revealed: The Counter-Movement (Score:2)
I'm pretty sure it would be called ViMS, and it would run mainly on old VAXen. :-)
Re:Evil plot revealed: The Counter-Movement (Score:1)
but we all know ViMiX would so kick Emax's ass. There really isn't any room for debate.
I know you guys... (Score:2, Funny)
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?
Re:I know you guys... (Score:1)
Re:I know you guys... (Score:2)
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 elega
Language to start with (Score:2)
Re:I know you guys... (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
Re:I know you guys... (Score:1)
I've studied about ten[1] and learnt something from each of them.
Justin.
[1] Thinks... several Basics, C, C++, Pascal, Fortran (shudder), Lisp, Java, JavaScript, Oracle PL/SQL, Rexx. There's prolly more...
RTLinux? (Score:2)
--jeff++
Ok. (Score:1)
Cool, done alredy though (Score:2)