"If I were to implement a language now, I'd write a very minimal core suitable for bootstrapping. ... Think of a handful of ops. Think very low level. (Think something a little higher than the universal Turing machine and the lambda calculus and maybe a little bit more VMmy than a good Forth implementation, and you have it.) If you've come up with something that can replace XS, stop. You're there. Do not continue. That's what you need." (Chromatic, January 2013)

This is in Chromatic's response to Moe, which sounds -Ofun and seems like a good idea.

And now that I've crawled out from under my rock, I see microperl, an ancient tool included with 5.8. Alright, I don't recall ever hearing about microperl. It's not in my copy of the Programming Perl book, and that sucker is a thousand pages.

And lately, haven't I seen grumblings about the insularity and stubborn bikeshedding nature of the Perl community?

So how about this. Microperl isn't the "handful of ops" that Chromatic is suggesting, and it ain't XS, but it's tiny and, well, it's Perl. Therefore, what are the issues around forking and modifying microperl (oh so gently) to bootstrap a variant of Perl5? I mean, it's already written, and it's tiny -- minimal, if Simon is to be believed. I mean, the thing built in a 300k footprint when compiled with a proper optimizer. So what's not to like?

So I re-ask my question. Doesn't microperl seem to be at least halfway to a bootstrap up to a useful and somewhat regularized, normalized, unpackable, what-have-you-able variant of Perl5?

Just for reference, here's a sample microperl script written in zentara's discussion. It seems pretty handily powerful for being a tiny subset of perl. Is there documentation for microperl?

#!microperl #to substitute for a readdir or glob #I needed to ls then grep my @files = `ls`; @files = grep($_ =~ /.tar.gz$/,@files); foreach(@files){print "\ngunzipping->$_\n"; system("gunzip $_")} my @files = `ls`; @files = grep($_ =~ /.tar$/,@files); (@bases) = map{$_ =~ m/^(.*)-\d+.tar$/ }@files; print "@bases\n"; my %hash; $hash{$_}++ foreach (@bases); print "$_: $hash{$_}\n " foreach (sort {$hash{$a} <=> $hash{$b}} keys +%hash); foreach $basename (keys %hash){ #initialize first file if (-e "$basename-1.tar"){ $old= "$basename-1.tar"; $new= "$basename.tar"; rename $old,$new or warn $!; } #the restore-rotate.pl script just swaps files like they were tapes system ('tar','-x','-M',"-F ./restore-rotate.pl $basename","-f$basenam +e.tar"); unlink "$basename.tar"; #cleanup print "----------------------------------\n"; } system("mkdir proc"); system("mkdir tmp"); system("mkdir home"); exit;

In reply to Forking Perl5 with Microperl++? by rje

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.