On Mon, Sep 12, 2005 at 13:15:33 +0300, Yuval Kogman wrote:

The circularity issue was not made clear in the email or the
diagram. Here is what I meant:

The prelude operators are mutually recursive at some point, and
completely pure. An pathetic example:

        multi &infix:<-> (Int $x, Int $y) { $x + 1 - $y - 1 }
        multi &infix:<-> (Int $x, 0) { $x }

        multi &infix:<+> (Int $x, Int $y) { ($x + 1) + ($y - 1) }
        multi &infix:<+> (Int $x, 0) { $x }

        multi &infix:<+> (Int $x, 1) { ... } # really a stub, requires native 
increment
        multi &infix:<-> (Int $x, 1) { ... } # really a stub, requires native 
decrement

(I should note that once the language grows it becomes rather
circular especially when control flow and combinators get
involved...)

This allows runtime authors to provide a minimal root set of
operations to break the circularity of the prelude (and even this
can be done incrementally, i guess), and get a slow but functional
system in very little time.

This root set is dynamic, and can be chosen by the runtime
implementor based on how well this fits into the the target arch.

This opens a door to a variety of levels of target
implementations... The metamodel, for example, could be implemented
in the prelude. When it is not implemented natively it will be slow,
but will work. Serious runtime implementations can override the
parts of the metamodel that profiling has shown to be slow.

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me does not drink tibetian laxative tea: neeyah!

Attachment: pgpsTL94mNGSZ.pgp
Description: PGP signature

Reply via email to