Following some responses I've seen, I'll try to clarify my proposal. Basically its like this.

A significant subset of Perl 6 native features, eg types and operators, native meaning they are declared and described in the Perl 6 Synopsis documents, have been implemented under Pugs by being written in plain Perl 6 in terms of other Perl 6 features, rather than being written in Haskell or C or Perl 5.

See for example the modules Math::Basic and Set, which live in the ext/ directory of Pugs and are defined like any user-defined module.

Then recall that different languages have varying concepts of what constitutes a core language feature and what is an optional or third-party extension feature. For example, some languages have native types and operators for temporal artifacts like dates and times and durations, and others don't. Some languages have "big" numbers as a fundamental and others only have machine-size numbers.

Now I anticipate that for any given native / Synopsis-described types and operators of Perl 6, some Perl 6 implementations will define those as plain Perl 6 code in terms of other Perl 6 features, and other implementations will instead have them directly wrap features of the host language.

My main point here is that the demarcation line between what is written in Perl 6 and what is written in the host language can vary wildly and can pay little to no attention to the conceptual boundaries in the Perl 6 Synopsis between what is more fundamental and what is more of an extension.

Therefore, it does not hurt to increase as much as possible the fraction of the Perl 6 language that has a reference implementation defined just in terms of Perl 6.

Especially if this reference Perl 6 code is written in a more declarative fashion, it increases the likelihood that more starter code is available to help bootstrap any given Perl 6 implementation, where writing some parts of the language are more optional for them to do themselves than otherwise.

Note that I just referred to this body as the Prelude because I was replying to a particular p6c comment naming that, and also Pugs had something by that name with a similar purpose which is what was referred to in the original post.

So I'm not so much talking about the existing Prelude file as the concept it represents, which is making it easier to share code between Perl 6 implementations, where each implementation wants to use it. Or just to take advantage of the fact that Perl 6 itself should be easier to write some kinds of code in than other languages, including itself. We can go further than the minimal bit we have now.

-- Darren Duncan

Reply via email to