1. Interpreter etc questions

Since I'm not in the least bit capable of logic or anything resembling it, I'll
have to ask You, the Euphorian community about this:

How would I go about programming an interpreter for a scripting
language/programming language? The only such thing I've done was, *shudder*,
XProL. Although it was fun to hack together, it wasn't really the epitome of
interpreters, or anything for that matter.
Since I seriously exhibit the same kind of lunacy as Donald R. Woods and James
M. Lyon and the people at Cat's Eye Technologies (Funges, Orthogonal, etc), I've
always wanted to write a programming language that is rather original and, if
nothing else, halfway Turing-complete. The problem is I'm not much of a
programmer and I have no sense of logic whatsoever :) (Kind of hinders my
chances, huh?)

And please don't tell me to look at X's example of an interpreter, I'd just get
compelled to slightly modify the code and steal it outright. Just give me some
guidelines, etc please.

I'm begging you!

If I fail miserably I'll flush Euphoria down the toilet and go back to Perl
again. At least the slightly messy regexps simplify my life, IF I'd remember to
comment my code ;)


--Tom A.K.A. The developer of several unpublished abominations and other
funnies, much like XProL and DEATHBUNNY (which was actually halfway finished by
me just a while ago, in Perl :).




----
Get your free email at http://www.gnwmail.com

new topic     » topic index » view message » categorize

2. Re: Interpreter etc questions

The first thing you have to do is set down and write an exact discription
of the mimimum requirements of your language. ( SYNTAX )
Keep it SMALL to start with you can't have every feature that was in
every language that you have ever used.
Once you have your language described completely then you have to decide
how the interpeter will operate. Will it immediately excute each line
( like some basic's did ), will it convert the langaguge to an
intermediate code and then run that intermediate code or convert the
language to assembler and compile it?
If you know pascal there is a document out on the WEB by crenshaw that
is a tutorial showing how to write an interepter in pascal ( which
could easily be converted into Euphoria ) that outputs assembler code.

When you have a definition of your langauge written place it on the
listserver and I sure some will help you to go on to the next step
of building the parser, etc.
Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: Interpreter etc questions

The first thing you have to do is set down and write an exact discription
of the mimimum requirements of your language. ( SYNTAX )
Keep it SMALL to start with you can't have every feature that was in
every language that you have ever used.
Once you have your language described completely then you have to decide
how the interpeter will operate. Will it immediately excute each line
( like some basic's did ), will it convert the langaguge to an
intermediate code and then run that intermediate code or convert the
language to assembler and compile it?
If you know pascal there is a document out on the WEB by crenshaw that
is a tutorial showing how to write an interepter in pascal ( which
could easily be converted into Euphoria ) that outputs assembler code.

When you have a definition of your langauge written place it on the
listserver and I am sure some will help you to go on to the next step
of building the parser, etc.
Bernie

new topic     » goto parent     » topic index » view message » categorize

4. Re: Interpreter etc questions

*** Warning: long post ahead ***

>>> Tom Ekl=F7f <eu-list at GNWMAIL.COM> 07/22/99 11:01AM >>>
How would I go about programming an interpreter for a scripting language/pr=
ogramming language?=20
Since I seriously exhibit the same kind of lunacy as Donald R. Woods and =
James M. Lyon and the people at Cat's Eye Technologies (Funges, Orthogonal,=
 etc), I've always wanted to write a programming language that is rather =
original and, if nothing else, halfway Turing-complete.
------------------------------

I'm actually in the middle of coding in Euphoria an interpreter for a new =
language that offers the capability of self-modification.  However, =
considering how much time I'm not putting into it, it probably won't be =
even close to usable this year. =20

As was stated before, the best place to start is writing out a skeleton of =
a user's manual.  By doing this first, you get an idea of what you want to =
do.  The how is actually the easy part.

Perhaps these steps might give an idea of how to proceed.
1) How am I going to get my program?  Read it all then parse, then =
execute?  Read and parse one line at a time, then execute when finished?  =
or read, parse and execute one line at a time, not reading the next line =
till the current one is finished?
2) How is my symbol table going to be defined?
3) When / where am I going to convert symbol names to values?
4) Is execution going to be event-based or top-down or some combination?=20=

5) How are errors going to be handled?

As these questions are answered and programmed, you then have the =
foundation for expanding the functionality of the language and adding =
optimizations. =20

The language I'm writing is going to use five symbol tables: atoms, =
sequences, functions, types, and procedures.  The program is read and =
executed one line at a time, but not allowing line numbers or gotos.  =
Variables are converted in the parser, and functions are called and =
evaluated after that.  Then the command is executed.  If you'd like any =
more specific help or examples, I'd be happy to help as much as I can.  =
I'm not releasing any code publicly until I have something I'm satisfied =
with.

Michael J. Sabal

new topic     » goto parent     » topic index » view message » categorize

5. Re: Interpreter etc questions

Thus spake Tom Ekl?f  on Thu, 22 Jul 1999:

>How would I go about programming an interpreter for a scripting language/
programming language? The only such thing I've done was, *shudder*, XProL.
Although it was fun to hack together, it wasn't really the epitome of
interpreters, or anything for that matter.

I shuddered when I saw XProL too.

>Since I seriously exhibit the same kind of lunacy as Donald R. Woods and James
M. Lyon and the people at Cat's Eye Technologies (Funges, Orthogonal, etc), I've
always wanted to write a programming language that is rather original and, if
nothing else, halfway Turing-complete. The problem is I'm not much of a
programmer and I have no sense of logic whatsoever :) (Kind of hinders my
chances, huh?)
>
>And please don't tell me to look at X's example of an interpreter, I'd just get
compelled to slightly modify the code and steal it outright. Just give me some
guidelines, etc please.

Seeing as this will go off-topic fairly quickly, email me direct and we can
start talking about this. I have written a number of interpreters for DOS and
lately for Mac. None will win me design awards. I have quite a number of ideas
up my sleeve but no time up there. If you can take the ideas and run with them,
go for it!

Bruce.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Interpreter etc questions

Let me axe you guys a question: What's the point in programming an
interpreter? What's the big idea? smile

Just curious.

At 03:21 PM 7/24/99 -0400, you wrote:
>start talking about this. I have written a number of interpreters for DOS and
>lately for Mac. None will win me design awards. I have quite a number of ideas
>up my sleeve but no time up there. If you can take the ideas and run with
them,
>go for it!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu