On Fri, 17 Oct 2003, Melvin Smith wrote: > At 12:53 PM 10/17/2003 +0200, Juergen Boemmels wrote: > >Robert Spier <[EMAIL PROTECTED]> writes: > > > > > > The goals are to assign permanent numbers to the opcodes. What the > > > > numbers are is generally irrelevant, but they must be constant across > > > > all systems for the lifetime of parrot. > > > > > > At first glance, gut reaction, that seems "really hard"(tm) and > > > "really limiting"(tm)... > > Why is it hard? If we have a native interface and a well designed set of > basic opcodes, what else do we need? > > My opinion on this has not changed in 2 years of Parrot. > I see no benefit to writing a VM if we are going to allow > all these "added" opcodes.
There are three reasons, two technical and one political. The first, and perhaps least important (though we'll see with that) is to allow very low-overhead subs. The current calling conventions are fine, but there are going to be some time-critical cases that can't be rolled into a single sub invocation. Making it an op function cuts out a lot of the overhead. The second reason is the political one -- it gives language designers an out to modify the machine if they really need to do so. The third is a variant of sorts on the second--there are languages that are radically different from our core set that will likely be best served by having a different set of ops handy. Prolog and Haskell spring to mind and, while I don't know that they'll need a new set I can certainly see the possibility. Yes, it does mean that if library code written in ML (or whatever) uses the ML ops that you'll need the ML op pack, but that's fine. It's a bit more extreme than requiring an installed bytecode library, since hopefully we'll be able to avoid that for standalone executables, but its no more extreme than requiring a C library of one sort or another to be installed for a program to run. (While Parrot is going to reduce the need for C it won't eliminate it, and I don't see much difference between needing the PDL C extension and the ML op library for a program to run) Dan