MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Properties of computer languages
Caliban Tiresias Darklock writes:
>
> I'm in the process of redesigning the macro language of my game, and I
> recall seeing at one time a list... a very short list... of things that a
> computer language absolutely required. Sort of a bare-bones "what you need
> to do everything you need to do in any given program". Two of the things on
> the list were conditionals (if/then/else) and iteration (for/next and
> do/while). There were either two or three other things listed, but I don't
> remember what they were. Does anyone here have a memory spark going off as
> to what list I'm talking about and where I can find it? I think one of the
> other things was something along the lines of subroutine/function
> declaration.
>
I don't have the document you refer to, but I can take a swing at answering
your question.
In theoretical (rather than practical) terms, you need conditionals,
branching (or iteration), and arbitrarily large state. An example of the
last is an array--- just allowing multiple variables isn't sufficient,
unless your values can be arbitrarily large. (In which case you can
play number-theoretical games and implement an array using a single
variable.)
These can even be combined--- for example, Hennessy & Patterson give an
example of a one-instruction computer in their architecture textbook.
The presence of these features can be very subtle, too: "pure" untyped lambda
calculus has only one rule, substitution, but you can implement
conditionals and recursion by being sufficiently clever.
The question to ask is "can I implement any given Turing machine in my
language?" If you can, your language is strong enough to implement any
other programming language.
Practically speaking, though, you probably want to implement more than
the minimum, for efficiency. So, rather than just getting by with
"increment" and "decrement" instructions (or "set to 0" and "set to 1"),
most languages offer addition and subtraction, less-than and greater-than,
etc.
Adding arrays or lists is generally the easiest way to make a language
complete, although note that you have to implement dynamic arrays
to truly do so. Staticly-sized arrays are no more powerful than some
proportional number of variables--- but in practice, you're limited
by the machine's memory anyway.
Mark Gritter
mark#erdos,stanford.edu
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] i got's a question for yall on the best way to do something.., (continued)
- [MUD-Dev] 3D Anarchy,
Adam Wiggins adam#angel,com, Thu 17 Jun 1999, 15:37 GMT
- [MUD-Dev] Properties of computer languages,
Caliban Tiresias Darklock caliban#darklock,com, Thu 17 Jun 1999, 08:19 GMT
- Re: [MUD-Dev] Properties of computer languages,
Jon Leonard jleonard#frost,slimy.com, Thu 17 Jun 1999, 15:38 GMT
- Re: [MUD-Dev] Properties of computer languages,
Mark Gritter mark#erdos,Stanford.EDU, Thu 17 Jun 1999, 15:39 GMT
- Re: [MUD-Dev] Properties of computer languages,
Travis S. Casey efindel#io,com, Thu 17 Jun 1999, 16:24 GMT
- Re: [MUD-Dev] Properties of computer languages,
Hans-Henrik Staerfeldt hhs#cbs,dtu.dk, Thu 17 Jun 1999, 21:48 GMT
[ Other Periods
| Other mailing lists
| Search
]