Parrot "standard libraries"

Patrick R. Michaud pmichaud at pobox.com
Fri Aug 14 18:05:16 UTC 2009


On Fri, Aug 07, 2009 at 04:40:52PM -0700, Allison Randal wrote:
> Patrick R. Michaud wrote:
>> Allison Randal wrote:
>>> Some libraries can be precompiled to PBC and shipped as Parrot 
>>> modules  that way. This is substantially preferable to reimplementing 
>>> the whole  library.
>>
>> [...]In the  
>> general case this is likely to be false, since most HLL libraries will 
>> need to make use of HLL-specific library functions, methods, and 
>> dynamic PMC types that are typically available only by having the  
>> entire compiler present.  
>
> For embedded environments, we need a way to bundle up a compiled HLL  
> module so it doesn't depend on the entire parser and runtime environment  
> of the HLL. Including some part of the HLL runtime is workable, but it  
> needs to be the smallest set possible. 

Is the plan that Parrot will provide some tools to simplify the creation
of "minimal runtime modules" from a larger set?  Or is this something 
each HLL will need to integrate and plan into its development from the
start?

I've done some thinking about this topic for Rakudo and Perl 6, and thus 
far I've found it very difficult to draw a nice boundary around a notion of
"minimal runtime" that doesn't encompass the entire Perl 6 core (which is
intended to be somewhat "minimal" already).  

It's pretty clear that we'd need all of the base classes/roles and their 
methods (List, Str, Int, Num, Hash, Array, Object, Junction, Whatever, 
Associative, Positional, Callable, IO, Iterator, Sub, Block, Method, Regex,
etc.).  We'd also need the dynops and dynpmcs.  We _might_ be able to exclude 
some of the less common classes (Complex?) and operators, but deciding 
which are included or excluded sounds more empirical than analytical.

Perhaps we can come up with some analysis tools that (1) identifies for
a given module the core HLL features required and (2) extracts that
subset out into a "minimal runtime .pbc" that can be safely loaded,
but that sounds somewhat tricky.  Outside of Parrot I guess there's
some prior art in the notion of dynamically linked libraries, but
I haven't see anything in the context of doing something similar
with Parrot pbcs.

Anyway, I find the notion of "minimal runtime" to be nice in theory,
but in the context of Perl 6 I don't have a good roadmap for applying
it in practice.

Pm


More information about the parrot-dev mailing list