Language design/VM design

"Floris 'Tamama' van Gog" <floris@vangog.net>
27 Feb 2000 02:37:47 -0500

          From comp.compilers

Related articles
Language design/VM design floris@vangog.net (Floris 'Tamama' van Gog) (2000-02-27)
Re: Language design/VM design joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-03-06)
Re: Language design/VM design jeremy@jboden.demon.co.uk (Jeremy Boden) (2000-03-06)
Re: Language design/VM design floris@vangog.net (Floris 'Tamama' van Gog) (2000-03-11)
Re: Language design/VM design jeremy@jboden.demon.co.uk (Jeremy Boden) (2000-03-23)
Re: Language design/VM design alanf@ns.net (Alan Fargusson) (2000-03-23)
Re: Language design/VM design joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-03-23)
[2 later articles]
| List of all articles for this month |

From: "Floris 'Tamama' van Gog" <floris@vangog.net>
Newsgroups: comp.compilers
Date: 27 Feb 2000 02:37:47 -0500
Organization: XS4ALL Internet BV
Keywords: design, question

hello,


I'm still working on my little C-hybrid for a little VM im making. The
language is extended in that it can use 'external' variables. These
are actually handles, but are in the language accessed through a
pointer of some sort. for example:


extern char *foo=function_that_returns_external_char_pointer();


'extern' is part of the type and specifies that no pointer arithmic or
anything is allowed on it. The way it works is that the foo pointer is
actually a VM-host REAL pointer, instead of a VM-address space pointer
kind of thing. The language does not allow type-casting at all, so you
can't change them in that way to let the VM crash.


Now, the way I pictured this still allows some unsafe constructs, as
in that one can use a local pointer (VM space) and change that to
point to the external pointer, then change it, and chrash the VM. I
could disallow pointer-changing for all pointers, but they are so
handy :-)


Another way would be to use a 'handle' but even then it would be able
to change the handle to a different one that points to different data,
and so this also has some probs.


Does anyone have some nice ideas on how to 'fix' this design? The
'extern' types are needed for what i want the VM to allow
(host-function / script variables interaction ).


  Floris


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.