Fair enough.
What about the spec for ECMA Script (what used to be called Java script)
which uses an interpreter
I guess what I was suggesting was since you mentioned you had preparsed the
script into a byte code style format that something along the lines of how
Java's VM interprets the byte codes would be appropriate from a style (but
not implementation) point of view.
They do similar styles of things in which operators are assigned a
particular byte code, and given that you know what the parameters and their
parsings are.
Heck, Excel does this for its cell expressions but these are a lot simpler
than a full blown interpreter.
> From: Chris Dillman <chrisd at plaidworld dot com>
> Reply-To: "REALbasic Network Users
> Group"<realbasic-nug at lists dot realsoftware dot com>
> Date: Tue, 29 May 2001 08:03:06 -0500
> To: "REALbasic Network Users Group" <realbasic-nug at lists dot realsoftware
> dot com>
> Subject: Re: More On BASIC interpreter
>
>> well ... take a look at something like the spec for the java virtual
>> machines which has a lot of the byte code design you are thinking of ... and
>> there's no reason you couldn't do something similar ...
>
> I have and and I have made similar things. Example I have a
> Java Script Byte code compiler and virtual stack machine done in C++
> using ANTLR among other things.
>
> Thats not what im looking for.
> I wrote and interpreter this time cause I thought it would be easier.
>
> Java style byte code needs a compiler
> Then a stack machine etc to run it on.
>
> That would be a total rewrite of what I have now.
>
>
>>
>>> From: Chris Dillman <chrisd at plaidworld dot com>
>>> Reply-To: "REALbasic Network Users
>>> Group"<realbasic-nug at lists dot realsoftware dot com>
>>> Date: Tue, 29 May 2001 00:21:35 -0500
>>> To: "REALbasic Network Users Group" <realbasic-nug at lists dot
>>> realsoftware dot com>
>>> Subject: More On BASIC interpreter
>>>
>>>
>>> Ok thanks everyone.
>>>
>>> I looked over theo's notes.
>>> That helped a bit.
>>>
>>> I don't think the string plug in will help at all.
>>>
>>> I started speed testing the interpreter today.
>>> It is really not to slow for a lot of uses.
>>>
>>> It is just that I am using it for scripting behaviors for games.
>>>
>>> For a few sprites on screen at a times it is great.
>>> For 300 sprites all calling a behavior at 30 FPS
>>> making 9000 script calls it is slow.
>>>
>>> Adding MidB instead of Mid helped a bit.
>>>
>>> The interpreter currently preprocess the scripts into tokens (strings).
>>>
>>> Im thinking of doing more preprocessing and or possibly
>>> turning the tokens into a kind of byte code of numbers....
>>>
>>> aka IF would equal 1 etc.
>>>
>>> I could modify the interpreter to use only numbers
>>> this would cut out all the string comparisions...
>>>
>>> Trade off the code would get kind of ugly fast
>>> with out a lot of comments.
>>>
>>> It would probably be worth it.
>>>
>>> Any other thoughts?
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> ===========================================================
>>> Technical Editor for http://www.idevgames.com
>>> Support Programmer for http://www.desoftware.com
>>> Owner, Plaid World Studios, http://www.plaidworld.com
>>> Software Engineer for http://www.riskwise.com, Part of LexisNexis
>>>
>>> A one-question geek test. If you get the joke, you're a geek:
>>> Seen on a California license plate on a VW Beetle: "FEATURE"
>>>
>>> ============================================================
>>>
>>> ---
>>
>> ---
>
> --
>
> ===========================================================
> Technical Editor for http://www.idevgames.com
> Support Programmer for http://www.desoftware.com
> Owner, Plaid World Studios, http://www.plaidworld.com
> Software Engineer for http://www.riskwise.com, Part of LexisNexis
>
> A one-question geek test. If you get the joke, you're a geek:
> Seen on a California license plate on a VW Beetle: "FEATURE"
>
> ============================================================
>
> ---
|