rubyx/lib/slot_machine
Torsten 4bae5c418b fix register use in putstring
was off by one, the syscall is write 
and the first arg is file_descriptor
ie 1 == stdout
2020-03-26 11:24:56 +02:00
..
instructions do not copy name of method 2020-03-25 12:43:57 +02:00
macro fix register use in putstring 2020-03-26 11:24:56 +02:00
basic_values.rb Starting to rework slot instructions that create risc 2020-03-22 14:31:43 +02:00
block_compiler.rb Add number of registers to platform 2020-02-26 19:01:01 +02:00
callable_compiler.rb Fix comparison macro 2020-03-22 14:31:43 +02:00
macro_maker.rb SlotLanguage reborn in the Machine 2020-02-19 02:19:14 +07:00
method_compiler.rb Add number of registers to platform 2020-02-26 19:01:01 +02:00
README.md Rename Vool to Sol 2019-10-04 00:38:47 +03:00
slot_collection.rb misc 2019-12-01 12:17:54 +02:00
slot_compiler.rb SlotLanguage reborn in the Machine 2020-02-19 02:19:14 +07:00
slot_machine.rb Unify instruction namings also dirs 2020-03-22 14:31:43 +02:00
slot.rb Makes slots linked list 2020-02-17 14:29:45 +07:00
slotted_constant.rb SA for Slotted derivations 2020-03-22 14:31:43 +02:00
slotted_message.rb fix allocate in builder 2020-03-22 14:31:43 +02:00
slotted_object.rb Starting to rework slot instructions that create risc 2020-03-22 14:31:43 +02:00
slotted.rb SlotLanguage reborn in the Machine 2020-02-19 02:19:14 +07:00

SlotMachine

This layer sits between the language layer (sol) and the risc machine layer. It is meant to make the transition (between sol 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 that everything in computing can be fixed by another layer :-)

Recap

A little recap of why the transition was too steep will naturally reveal the design of SlotMachine.

Structure

Sol has a tree structure. Risc is a linked list, so essentially flat.

Memory model

Sol 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

Sol's implicit execution model would be interpretation, ie tree traversal. Sol 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 sol 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, SlotMachine will be:

Linked list

But, very much like Risc, just higher level so it's easier to understand

Use object memory

object to object transfer

no registers (one could see the current message as the only register)

Instruction based

So SlotMachine is a machine layer, rather than a language. No control structures, but compare and jump instructions.

No send or call, just objects and jump.

Again in two steps, see below

Machine capabilities (instructions) for basic operations. Use of macros for higher level.