I'd never heard of JNode. Having read the Wikipedia entry and scoured the official website, I understood what it was -- a bootable OS, with command line, filesystem(s), tcpip stack and optional 2D windowing, written entirely in Java except for a nano-kernel written in assembler -- but was left wondering why it was written. Beyond, because they can.

Eventually I discovered one possible reason. For virtualised web-server environments ("the cloud"), there is a certain utility in having VM that contains just enough facilities to support web applications. Especially if it is written (almost) entirely in the language of choice for those applications. (Assuming you like Java). VM instances can be lighter, and come with the required language support already loaded at start up.

Reading between the lines of your initial post elsewhere, your motivation seems to be that you like that idea, but you don't like Java. Hence, you'd like to do the same thing in Perl.

However, given that it took the JNode author 15 years and 3 major iterations to get to a working and suitably performant solution, if you are hoping to use this for real work any time soon, you will have your work cut out. And remember, in parallel to the original author and his team, Sun used hundreds of programmers and millions, if not billions of dollars developing the JVM, runtime libraries, JIT technology etc. that underpins the JNode environment. Perl has no such deep pocketed white knight. Even interpreted Java runs many times faster than interpreted Perl, and JNode uses on-the-fly compilation exclusively. There is no such technology available for Perl.

If you are really serious about having a bootable Perl VM -- and I can see how this might be desirable in a cloudy, webby, mobile appy developer environment -- then I'd suggest that your best bet would be to utilise as much of the existing technology and lessons learned from the JNode project as possible.

It would surely be a whole lot easier to write a Perl interpreter that compiled to Java bytecode, than to start from scratch. A "JPerl" project has already existed for a couple of years and seemed to make some good early progress. (Though finding more/current information on it defeated my quick efforts.)

It seems to me that starting with PPI and converting that to Java wouldn't be beyond the realms of realistic possibility. And, at least for Pure Perl code, having a perl.jar that can be loaded into a JNode VM that takes perl source and generates Java bytecode would be a fast path to achieving your goal. And once you have the ability to write Pure Perl on top of the JVM, converting/re-writing many of the core/important XS modules on CPAN to be thin wrappers over the huge codebase of Java libraries ought to be really quite easy.

Of course, to write it would require you to bite the bullet of writing Java code initially to get things up and running, and that is what you want to avoid in the first place. But in the long term, having a Perl interpreter that sat on top of the now very highly developed and blazingly fast JVM technology would be a darn good thing for Perl anyway.

From my perspective, having Perl syntax sitting on top of JVM technology seems like a fresh start made in heaven.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Anyone interested in coding a _real_ Perl OS? by BrowserUk
in thread Anyone interested in coding a _real_ Perl OS? by dosadi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.