2017-04-10 10:47:18 +02:00
|
|
|
# MOM , Minimal Object Machine
|
|
|
|
|
|
|
|
This layer sits between the language layer (vool) and the risc machine layer.
|
|
|
|
It is meant to make the transition (between vool and risc) easier to understand.
|
|
|
|
|
|
|
|
Previous efforts were doing the transition without an intermediate layer. But while
|
|
|
|
this was possible, it was more difficult than need be, and so we go to the old saying
|
2017-08-29 17:38:51 +02:00
|
|
|
that everything in computing can be fixed by another layer :-)
|
2017-04-10 10:47:18 +02:00
|
|
|
|
|
|
|
## Recap
|
|
|
|
|
|
|
|
A little recap of why the transition was too steep will naturally reveal the design of MOM.
|
|
|
|
|
|
|
|
### Structure
|
|
|
|
|
|
|
|
Vool has a tree structure. Risc is a linked list, so essentially flat.
|
|
|
|
|
|
|
|
### Memory model
|
|
|
|
|
|
|
|
Vool has no memory, it has objects and they just are. Risc on the other hand has only registers
|
|
|
|
and memory. Data can only move to/from/between registers, ie not from memory to memory.
|
|
|
|
While Risc knows about objects, it deals in machine words.
|
|
|
|
|
|
|
|
### Execution model
|
|
|
|
|
|
|
|
Vool's implicit execution model would be interpretation, ie tree traversal. Vool has high level
|
|
|
|
control structures, including send, and no goto, it is a language after all.
|
|
|
|
|
|
|
|
Risc is close to a cpu, it has a current instruction (pc), registers (8) and a register based
|
|
|
|
instruction set. Risc has word comparisons and a jump. Call is not used as the stack is not
|
|
|
|
used (stacks are messy, not oo)
|
|
|
|
|
|
|
|
## Design
|
|
|
|
|
|
|
|
The *essential* step from vool to risc, is the one from a language to a machine. From statements
|
|
|
|
that hang in the air, to an instruction set.
|
|
|
|
So to put a layer in the middle of those two, MOM will be:
|
|
|
|
|
2017-09-04 19:58:57 +02:00
|
|
|
### Linked list
|
2017-04-10 10:47:18 +02:00
|
|
|
|
2018-03-15 16:03:38 +01:00
|
|
|
But, very much like Risc, just higher level so it's easier to understand
|
2017-04-10 10:47:18 +02:00
|
|
|
|
|
|
|
### Use object memory
|
|
|
|
|
|
|
|
object to object transfer
|
|
|
|
|
2018-03-15 16:03:38 +01:00
|
|
|
no registers (one could see the current message as the only register)
|
2017-04-10 10:47:18 +02:00
|
|
|
|
|
|
|
### Instruction based
|
|
|
|
|
2018-03-15 16:03:38 +01:00
|
|
|
So mom is a machine layer, rather than a language.
|
|
|
|
No control structures, but compare and jump instructions.
|
2017-04-10 10:47:18 +02:00
|
|
|
|
|
|
|
No send or call, just objects and jump.
|
|
|
|
|
2017-09-04 19:58:57 +02:00
|
|
|
Again in two steps, see below
|
|
|
|
|
2017-04-10 10:47:18 +02:00
|
|
|
Machine capabilities (instructions) for basic operations. Use of macros for higher level.
|