I was wandering around Freshmeat.net, and I stumbled upon the most interesting thing. I found a Linux distro built from perl. I'm not sure how good it works, I would download it, but somebody jammed a floppy in the drive and it will not eject. I never quite knew how powerful perl actually is. I guess it gives a new meaning to open source software ;). It says it has a copy of the Linux Kernel written completely in perl, and all of the programs are in perl. Do you suppose this adds a level to where perl can go, or somebody just messing around with code (which either way is really neat, I am not able to write Linux in Perl :))?

Replies are listed 'Best First'.
Re: Perl/Linux
by ambrus (Abbot) on Oct 08, 2004 at 16:30 UTC

    Perlinux does not have linux itself written in perl, only many unix applications. The kernel and a small libc (and perl of course) is still written in C, but all other programs are in perl.

      I just thought it seemed interesting at the time :). That clicked after I wrote it, the whole idea of "wait, then what's interpreting the code, definately not perl." But, it still seemed pretty neat to have certain tools written in perl, which I guess could be found in many other places, and I could write for myself. But, I think the bigger picture is, if I am using Windows with ActivePerl, and I want to play around with UNIX tools and programs, it is a nice alternative to Cygwin, which I used, and loved, before I chose to switch to Linux.
Re: Perl/Linux
by hardburn (Abbot) on Oct 08, 2004 at 16:36 UTC

    Umm, the kernel there is not written in Perl. In fact, I don't think you could call a kernel written in Perl to be "Linux". Other than the Perl interpreter itself, the other non-Perl code is a small version of the Unix standard library (uClib). I haven't actually tried it, but I'm wondering if they have init as a compiled program, too?

    Most of it looks like it came from Perl Power Tools, which has been around for a while.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      Don't think you need a c compiled init:
      lilo: linux init="/usr/bin/perl /usr/local/sbin/init.pl"
      Now this is totally untested, but I have run a shell in place of init many times. Anyone know if the linux kernel or lilo take multiword environment variables?

      Jon

        You don't need to. If /sbin/init is mode (at least) 555 and starts with the line "#!/bin/perl" (without quotes of course) and perl is really in /bin (no link) then this script will start as init. /usr/bin/perl doesn't work every time because /usr could be umounted.
Re: Perl/Linux
by jonnybe (Scribe) on Oct 08, 2004 at 17:17 UTC
    Had another thought...why stop there? How about embedding a perl interpreter in the kernel? Wow, device drivers on the fly and reduced overhead for perl scripts, lol.

    Jon

      I've got an funny idea here, hear me out .. maybe we take that Perl idea and we could have EVERYTHING, and I mean EVERYTHING be a file and we could we could have a collection of servers running on a mini mach kernels implementing things like filesystems and network access!

      I'll call it "HURD OF 9 LLAMAS"! BA DOOM BOOM </rimshot>

      (I predict this will be massively downvoted by those who don't know about HURD and Plan 9...)

      A perl interpreter in the kernel? People already complain about bloated Linux kernels. Though I think these people haven't been happy since 2.2 was released.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

        Ok, we can put it in a kernel module. :D
      I'm too lazy to check, but I seem to remember a system for writing virtual file-systems in Perl for Linux. I don't know if that involved embedding Perl in the kernel, but it seems like it might have!

      -sam

        I wrote RFC: Fuse::DBI - mount database as filesystem about such virtual file-system (which mounts part of database). It uses Fuse perl bindings, so it embeds fuse into kernel and then just calls it from perl. It's very powerfull, but in strange file-system way.

        2share!2flame...

        I think you mean PerlFS, of course it is entirely crack induced - but it does actually work and I have heard of some people actually finding a use for it.

        /J\