Domain: assurdo.com
Stories and comments across the archive that link to assurdo.com.
Comments · 7
-
Re:Perl in the Linux kernel?
Wasn't someone working on embedding a Perl interpreter in the Linux kernel a while ago? And/or rewriting all of
/bin as Perl scripts using the kernel-based interpreter?I haven't ever heard about it, until I read your comment. After a quick Google searching I found some info about it.
In the Summer 2000 issue of The Perl Journal, Simon Cozens wrote Perlix, The Perl Operating System article:
It started, as so many of these things do, with one of those interminable debates between programmers. You know what I mean. They usually end up with one party shouting something like "Well, fine, I don't care if it's impossible, I'm going to do it anyway!"
This time around, it was me, and the topic in question was an operating system user-space comprised of non-GNU components. An operating system consists of two components: the kernel, like Windows or Linux, which talks to the hardware and directs the action, and the user-space, which is all the programs that you see and use: a shell, Explorer, programs to list directories, move files, read your mail, play games, and so on.
On "free" operating systems, a sizeable proportion of the essential user-space - not the really high-level things like web browsers, but the basic stuff that gets the system up and running - comes from the GNU project, and it was these programs that I wanted to replace.
Don't get me wrong. This wasn't an anti-GNU jihad. But someone had told me it wasn't possible, which was precisely the incentive I needed to get stuck into an idea I'd had a while ago.
Any sensible person would use BSD code here -- the BSD project derived their utilities from de-commercialized sources of Unix, and evolved independently of GNU. But that would be easy. And it wouldn't be fun. If you're going to prove a point, do it with style. So I was going to do it with Perl. [...]
Very interesting text, he mentions Tom Christiansen's Perl Power Tools: The Unix Reconstruction Project - "Our goal is quite simply to reimplement the classic Unix command set in pure Perl, and to have as much fun as we can doing so." I like the simple version of cat:
#!/usr/bin/perl -w
print while <>;Simon Cozens also writes about Gregor Purdy's Perl Shell (psh) - "The Perl Shell is a shell that combines the interactive nature of a Unix shell with the power of Perl. The goal is to eventually have a full featured shell that behaves as expected for normal shell activity. But, the Perl Shell will use Perl syntax and functionality for control-flow statements and other things." - and about Claudio Calvelli's Linux filesystem written in Perl (PerlFS), but the link is dead and I couldn't find the new PerlFS home page (anyone knows it?).
On 2000-09-26 the SF Project: Perlix Kernel was registered by Bill Dahab. The Perlix.sf.net homepage is empty, the Development Status is Planning. The stats show more activity a year ago. Here's the summary:
Perlix is to be an POSIX compliant operating system based on the more graceful language of Perl, in stead of the uglier C. This specific project is to make a kernel written in Perl, and other core components for this operating system
Let me also quote the latest news about Perlix:
Posted By: rydor
Date: 2001-08-05 14:19
Summary: Ok, the deal with perlixFor one thing, work has not yet really begun on the perlix kernel, at most it's been in speculation. The main thing, is that this project really needs Perl6 to go ahead. Also, is needed (i don't really know if Perl6 will allow it) is direct memory writing via perl. If anyone wants to hack it into Perl 5, that would be great. One thing that may be very helpful, is to load Perl into system memory. From there Perl should run fast enough on a more high end computer to support a kernel. Another thing that has been thought about is since a Perl kernel would be relatively dynamic, have on the fly kernel upgrades, via a special script to be written. So if you want to swap in a new network driver that works better, you use this script, and the script would somehow through that driver in quickly. Anyway, If anyone is interested in joining for planning this out, either email me at Rydor@dahab.com or post to the board here, but posting to that board will probably take me a lot longer to figure out that you've done so. Anyway, hopefully we can get this figured out enough to get off the ground, and I hope the project will be lots of fun.
I also found Greg McLearn's Perl Operating System: Initial Planning Stage from 2001-11-23:
The first order of business is to make a bootable Perl kernel. Basically, this will consist of the Perl 4 core components being hacked into a state whereby it can be loaded into memory after booting and executed. In the initial stages, any Perl code to be executed will be stored as a string and handed to the interpreter module. In later stages, the Perl code will be executed from an arbitrary memory buffer.
Making the Perl 4 core components bootable is easier said than done. A memory-management system will have to be created to replace that found in a standard Unix system. As well, any dependency on the I/O subsystem will have to be removed or replaced.
I am basing the initial design on Perl 4 because the source code is far easier to understand and modify. Perl 4 does not contain many oddities currently found in the Perl 5 runtime (such as OOP and macro-hell). [...]
It sounds very interesting and I'm going to find out more about the current stage of Perlix/PerlOS development (if any). If anyone knows something interesting, please let us know.
-
Re:Tell it ain't so
This isn't the first time this sort of thing has been done. Check out the Perl Filesystem.
-
You do mean...
dd/sh don't you?
---
Despite rumors to the contrary, I am not a turnip. -
somebody knowledgableThe HURD is very good at this, with all its translators. I believe it already has an FTP filesystem.
If you're actually going to do this, I think you should look at perlfs, which would enable you to play around with it quickly and easily. It's not a perfect protocol, but it's better than NFS (remember, NFS requires all actions to be stateless and idempotent, so you can't do appends and a few other things).
-
Don't forget the PerlFSPerlFS is a linux kernel module that embeds perl so you can build file systems in Perl. Very cool technology, as you can actually build an ftp filesystem or a http filesystem, or all manner of cool things. Just don't add in any XS modules or your kernel might go kaboom... Ah well.
-
dd/sh
Some years ago, somebody set out to implement various things using only dd and sh. Their accomplishments included a text editor, a web server and -- to prove a point -- a Turing machine. The things could be found on the now non-existant http://dd.sh/ (fantastic, eh?
:) but are now located on http://www.assurdo.com/dd.sh/. These things warm my heart. *happy sigh* -
Re:What would be the next step by ORILY?
Mastering Perl Device Drivers?
:-) Check out http://www.assurdo.com/PerlFS/ for a system which allows you to write filesystems in Perl. Perl is a great language, that I use all the time, but I still question whether or not it fits the definition of a "real" language -- nobody has yet written a really solid Perl compiler in Perl.