Rename Vool to Sol
Simple is really the descriptive name for the layer Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified) Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else Just cause i was renaming anyway
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
# SlotMachine
|
||||
|
||||
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.
|
||||
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
|
||||
@ -13,17 +13,17 @@ A little recap of why the transition was too steep will naturally reveal the des
|
||||
|
||||
### Structure
|
||||
|
||||
Vool has a tree structure. Risc is a linked list, so essentially flat.
|
||||
Sol 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
|
||||
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
|
||||
|
||||
Vool's implicit execution model would be interpretation, ie tree traversal. Vool has high level
|
||||
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
|
||||
@ -32,7 +32,7 @@ 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
|
||||
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:
|
||||
|
||||
|
@ -3,7 +3,7 @@ module SlotMachine
|
||||
# Base class for SlotMachine instructions
|
||||
# At the base class level instructions are a linked list.
|
||||
#
|
||||
# SlotMachine::Instructions are created by the Vool level as an intermediate step
|
||||
# SlotMachine::Instructions are created by the Sol level as an intermediate step
|
||||
# towards the next level down, the Risc level.
|
||||
# SlotMachine and Risc are both abstract machines (ie have instructions), so both
|
||||
# share the linked list functionality (In Util::List)
|
||||
@ -18,7 +18,7 @@ module SlotMachine
|
||||
@next = nekst
|
||||
return unless source
|
||||
unless source.is_a?(String) or
|
||||
source.is_a?(Vool::Statement)
|
||||
source.is_a?(Sol::Statement)
|
||||
raise "Source must be string or Instruction, not #{source.class}"
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
module SlotMachine
|
||||
# just name scoping the same stuff to slot
|
||||
# so we know we are on the way down, keeping our layers seperated
|
||||
# and we can put constant adding into the to_risc methods (instead of on vool classes)
|
||||
# and we can put constant adding into the to_risc methods (instead of on sol classes)
|
||||
class Constant
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ module SlotMachine
|
||||
class BlockYield < Instruction
|
||||
attr :arg_index
|
||||
|
||||
# pass in the source (vool statement) and the index.
|
||||
# pass in the source (sol statement) and the index.
|
||||
# The index is the argument index of the block that we call
|
||||
def initialize(source , index)
|
||||
super(source)
|
||||
|
@ -9,7 +9,7 @@ module SlotMachine
|
||||
#
|
||||
# Setting up the method is not part of this instructions scope. That setup
|
||||
# includes the type check and any necccessay method resolution.
|
||||
# See vool send statement
|
||||
# See sol send statement
|
||||
#
|
||||
class DynamicCall < Instruction
|
||||
attr :cache_entry
|
||||
|
@ -15,7 +15,7 @@ module SlotMachine
|
||||
class ResolveMethod < Instruction
|
||||
attr :cache_entry , :name
|
||||
|
||||
# pass in source (VoolStatement)
|
||||
# pass in source (SolStatement)
|
||||
# name of the method (don't knwow the actaual method)
|
||||
# and the cache_entry
|
||||
def initialize(source , name , cache_entry)
|
||||
|
@ -9,7 +9,7 @@ module SlotMachine
|
||||
|
||||
attr_reader :return_label
|
||||
|
||||
# pass in the source_name (string/vool_instruction) for accounting purposes
|
||||
# pass in the source_name (string/sol_instruction) for accounting purposes
|
||||
# and the return_label, where we actually jump to. This is set up by the
|
||||
# method_compiler, so it is easy to find (see return_label in compiler)
|
||||
def initialize( source , label )
|
||||
|
@ -4,7 +4,7 @@ module SlotMachine
|
||||
|
||||
def initialize( source , name )
|
||||
super(source)
|
||||
name = name.value if name.is_a?(Vool::SymbolConstant)
|
||||
name = name.value if name.is_a?(Sol::SymbolConstant)
|
||||
raise "No reg #{name.class}" unless name.class == Symbol
|
||||
@name = name
|
||||
end
|
||||
|
@ -2,8 +2,8 @@ module SlotMachine
|
||||
# The Compiler/Collection for the SlotMachine level is a collection of SlotMachine level Method
|
||||
# compilers These will transform to Risc MethodCompilers on the way down.
|
||||
#
|
||||
# As RubyCompiler pools source at the vool level, when several classes are compiled
|
||||
# from vool to slot, several SlotMachineCompilers get instantiated. They must be merged before
|
||||
# As RubyCompiler pools source at the sol level, when several classes are compiled
|
||||
# from sol to slot, several SlotMachineCompilers get instantiated. They must be merged before
|
||||
# proceeding with translate. Thus we have a append method.
|
||||
#
|
||||
class SlotCollection
|
||||
|
@ -1,5 +1,5 @@
|
||||
# The *essential* step from vool to risc, is the one from a language to a machine.
|
||||
# From vools statements that hang in the air, to an instruction set.
|
||||
# The *essential* step from sol to risc, is the one from a language to a machine.
|
||||
# From sols statements that hang in the air, to an instruction set.
|
||||
#
|
||||
# ### List based: Bit like Risc, just no registers
|
||||
#
|
||||
|
Reference in New Issue
Block a user