martymart has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I was trying to find some windows specific perl information, and after googling found a link to this perlos webpage. This was back in 2001, the webpage doesn't say if it got completed or not. It looks like this guy was trying to write an operating system with perl. I found the whole idea fascinating and intriguing... he also links to some older projects that tried to do the same thing (one called Perlix - what a great name!!) Have any monks heard of similar projects that are currently underway, or have links to the same. Plus I'd like to know if my learned brother monks believe that perl could be actually used to make a viable operating system?


Replies are listed 'Best First'.
Re: Perl Operating System
by Corion (Patriarch) on Mar 25, 2004 at 15:12 UTC

    There also are the Perl Power Tools, a port of many Unix tools.

    Personally, I think that a PerlOS won't be viable because it will never get enough brainshare to keep the development rolling. Using a high level language with decent memory management to implement a kernel or the API layer upon the kernel is an interesting concept and a well proven implementation like Perls makes the start faster. But the problem is, that Perl already is present on many platforms and thus there are no features that Perl could provide in addition. People will not use PerlOS because they already have an OS and Perl works on that already, in the same way that JavaOS never took off.

    If you want a PerlOS, consider looking at Apache together with mod_perl 2, or at the PerlFS modules that allow userspace Perl code to emulate file systems.

    Update: Updated link to PPT

Re: Perl Operating System
by Abigail-II (Bishop) on Mar 25, 2004 at 15:31 UTC
    Simon Cozens once made a Linux distribution with only utilities written in Perl.

    Plus I'd like to know if my learned brother monks believe that perl could be actually used to make a viable operating system?
    No. Performance would be horrible. C might be a horrible language for a lot of Perl programmers, but if your program needs to be lean and mean (and we do want our kernels, drivers, shells, compilers, etc, to be as lean and mean as possible), there's no real alternative to C.


      C might be a horrible language......there's no real alternative to C

      MOV AH,02 MOV DL,"A" INT 21h MOV DL,"S" INT 21h MOV DL,"M" INT 21h MOV DL,"?" INT 21h MOV AH,04Ch MOV AL,00 INT 21h

      When you look at the alternative C starts to look pretty damn good! The only advantage of ASM is that the binaries tent to be tiny ie 24 bytes for that example as opposed to 36K for the same thing compiled in C using cl.exe:

      perl -e "print pack'H*','b402b241cd21b253cd21b24dcd21b23fcd21b44cb000c +d21'" >



        Though it would look less awful if you had used a string output function instead of one-character-at-a-time I/O. And been smaller, too. (Also: eww, DOS.)

        Makeshifts last the longest.

      Performance-wise, I think some of the functional languages with good compilers could actually be used to accomplish such a feat. It's just that it would be much harder than it is in C (and much more awkward) because when you're dealing with bare-metal type of programming, you're better off using a bare-metal type of programming language.

      It's not like there wouldn't be some university types who'd try nonetheless...


      Ada, Oberon, Modula3? :-)
Re: Perl Operating System
by jaco (Pilgrim) on Mar 27, 2004 at 05:46 UTC
    It's not possible to have a real perlOS. Perl is not a compiled language, and therefore needs and interpretor to be understood. And the only way i know to have a running interpretor is to have an established OS to run it on.

    sure, in C you have

    OS written on otherOS in C -> compiled binary -> compiled binary runs as OS alone

    but on perl it can't work the same.

    os written in perl on otherOS -> interp on existing OS -> executable machine code -> can't stand alone as OS

    You could have a layer2OS, for lack of a better term, that would have to sit infront of a shadow OS.

    but, then again didn't larry wall say real programmers can write assembly in any language
      "didn't larry wall say real programmers can write assembly in any language" Did he? :)