Listing languages

Patrick R. Michaud pmichaud at pobox.com
Tue Jan 6 15:22:06 UTC 2009


On Tue, Jan 06, 2009 at 08:41:06AM -0500, Andrew Whitworth wrote:
> I'm updating some stuff about compreg in docs/book/, and it raised a
> few questions:
> 
> 1) Where does compreg look for language compiler packages? Does it
> always look in languages/* for the list of packages, or can it be
> configured to look elsewhere?

AFAIK, the compreg opcode doesn't look at the filesystem at all --
it just returns whatever compiler is associated with the name.

Perhaps it should go ahead and attempt to load a language -- if so,
then that language is (currently) expected to be in 
runtime/parrot/languages/ (see discussion at [1]).

> 2) Is there a way to list from inside Parrot all the language packages
> that are currently installed?

There's not one currently, but it also depends on what you mean by
"installed".  If "installed" means "in the appropriate .../languages/
directory", then that definitely doesn't exist yet.  If "installed"
means "loaded in the current interpreter", then HLLCompiler will soon
be providing that, at least for the languages that are built using
HLLCompiler.

> 3) The compreg documentation says that it could either return an
> object with a "compile" method, or else it returns a sub PMC that can
> be invoked as a compiler. Is there any good way to tell when one is
> used and when the other is? Is there any interest in standardizing
> this behavior?

The standard is to return an object with a "compile" method;
but there are still a few compilers that aren't easily converted
(most notable is 'PIR'; 'PGE::Perl6Regex still uses the sub PMC 
interface but this should change soon).  

They should all eventually end up with a 'compile' method.

Pm


More information about the parrot-dev mailing list