[offtopic] marshalling

Tyson Dowd trd@cs.mu.OZ.AU
Fri, 5 Jan 2001 11:41:29 +1100


On 04-Jan-2001, linas@linas.org <linas@linas.org> wrote:
> > However, there are languages with very different data models - Prolog, for
> > example.
> 
> but I was thinking of something more mundane, like perl.  In perl,
> which is untyped, you have to treat any value as if it were a
> string, float, or int, all at the same time.  If the user wants
> to multiply by two, and then concatenate it to a string, and then
> call it, you have to convert types on the fly.  That means in the VM, 
> your basic datatype has to be all three, and a flag value saying 
> with of the three is the current 'right' value.   But for java, 
> this would be stupid.  So the java vm guy would be 'what's all 
> this crud in the VM'? and the perl guy is 'we can't live without 
> it, its fundamental'.

Well, you can design a machine to handle it OK, but of course it's going
to look a bit crappy when you interface with it.

But what else do people expect when they are interfacing to crappy
untyped languages? ;-)

The perl guy can get what he wants -- Smalltalk VMs handle this kind of
thing really well (and have done for about a decade). 

You can't do it very well with the Java VM, but that's ok,
multi-language interoperation in general is very hard in the JVM.  The J
in JVM is there for a reason.

Other people interoperating with the perl code might wonder why all the
methods seem to take Objects as parameters, but that just makes the code
harder to use, not any less functional.

Whether it will be "usable enough" to convince people to use it is
a much more complex issue.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd@cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #