With the recent realization of the beginnings of a PIL->Javascript
emitter, it appears that my Perl6 program can run in a bizarre mix of
execution environments.

Forgive me if I missed this while trying to skim through the unearthly
number of perl6 messages so far, but...

It'd be nice if there was one central object that represented "the
execution platform", with various methods based on the capabilities.

For example, this object, call it $*OS, could be queried to see
if we can get a native Javascript class (true only when running on
a JSplatform):

  if $*OS.can("get_javascript_class") { # I'm running on a js platform
    my $main_window = $*OS.get_javascript_class("Window").main;
    ...
  }

The point would be to have one object that would "understand" the
platform dependent parts, and have a consistent naming for the methods
that are used by that object as the execution platform varies.

This is similar to the OS-9's "gestalt" tables, which got smarter as
the operating system had more features, but was a consistent way to
ask "do we have a color monitor here?".

Is something like this already planned?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to