New , simpler architecture picture
and misc
This commit is contained in:
parent
f58cc40735
commit
6e8864b238
BIN
app/assets/images/architecture.png
Normal file
BIN
app/assets/images/architecture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
@ -58,6 +58,9 @@ main , header , footer
|
|||||||
.full_width
|
.full_width
|
||||||
img
|
img
|
||||||
width: 100%
|
width: 100%
|
||||||
|
.three_width
|
||||||
|
img
|
||||||
|
width: 67%
|
||||||
.debug_pic
|
.debug_pic
|
||||||
border-color: white
|
border-color: white
|
||||||
border-width: 8px
|
border-width: 8px
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
= render "pages/project/menu"
|
= render "pages/project/menu"
|
||||||
|
|
||||||
%h1= title "Ruby in Ruby"
|
%h1.center= title "Ruby in Ruby"
|
||||||
%p
|
%p.center
|
||||||
%span
|
%span
|
||||||
RubyX hopes make the the mysterious more accessible, shed light in the farthest (ruby) corners, and above all,
|
RubyX hopes to make the the mysterious more accessible, shed light in the farthest (ruby) corners, and above all,
|
||||||
%em empower you
|
%em empower
|
||||||
|
you.
|
||||||
.row
|
.row
|
||||||
.tripple
|
.tripple
|
||||||
%h2.center A better tool, a better job
|
%h2.center A better tool, a better job
|
||||||
@ -14,8 +15,8 @@
|
|||||||
better in almost every way.
|
better in almost every way.
|
||||||
The only downside is speed and we argue that with cheap resources.
|
The only downside is speed and we argue that with cheap resources.
|
||||||
%p
|
%p
|
||||||
Why it has taken this long to even seriously attempt a ruby implementation in ruby is due to the overwhelming
|
Why it has taken this long to even seriously attempt a ruby implementation in ruby is
|
||||||
influence of C (folks), especially at the time.
|
due to the overwhelming influence of C (folks), especially at the time.
|
||||||
%p
|
%p
|
||||||
Just a short and subjective list of why ruby is the better tool:
|
Just a short and subjective list of why ruby is the better tool:
|
||||||
%ul
|
%ul
|
||||||
@ -30,50 +31,53 @@
|
|||||||
Rails has evolved tremendously from what was already a good start. All the development
|
Rails has evolved tremendously from what was already a good start. All the development
|
||||||
%em around
|
%em around
|
||||||
it has nurtured
|
it has nurtured
|
||||||
ruby developement in all areas. Rails and all those parts make up a most mature and advanced software system.
|
ruby developement in all areas. Rails and all those parts make up a most mature and
|
||||||
%p The "rails effect" is due to the accessibility of the system, imho. Ie it is written in ruby.
|
advanced software system.
|
||||||
%p
|
%p
|
||||||
Ruby itself has not enjoyed this rails effect, and that is because it is written in C
|
The "rails effect" is due to the accessibility of the system, imho.
|
||||||
Crystal, Rust, Go Julia etc, have, for the exact same reason.
|
Ie it is open source, and written in ruby.
|
||||||
%p
|
%p
|
||||||
It is my firm belief that given a vm in ruby, ruby development will "take off" too. In other words, given an
|
Ruby itself has not enjoyed this rails effect, and that is because it is written in C.
|
||||||
easy way to improve his tools, a developer will do so. Easy means understandable and that means ruby for a
|
Crystal, Rust, Go, Julia etc, have, for the exact same reason.
|
||||||
ruby developer
|
%p
|
||||||
|
It is my firm belief that given a vm in ruby, ruby development will "take off" too.
|
||||||
|
In other words, given an easy way to improve his tools, a developer will do so.
|
||||||
|
Easy means understandable and that means ruby for a ruby developer.
|
||||||
.tripple
|
.tripple
|
||||||
%h2.center Step to Indepencance
|
%h2.center Step to Indepencance
|
||||||
%p
|
%p
|
||||||
The first thing any decent compiler does, is compile itself. It is the maturity test of a language to implement
|
The first thing any decent compiler does, is compile itself.
|
||||||
itself in itself, and the time has come for ruby. The mark of growing up is being independant, in ruby's case of C.
|
It is the maturity test of a language to implement itself in itself,
|
||||||
|
and the time has come for ruby.
|
||||||
|
The mark of growing up is being independant, in ruby's case of C.
|
||||||
%p
|
%p
|
||||||
Having just learned Assembler, i can attest what a great improvement C is over Assembler.
|
Having just learned Assembler, i can attest what a great improvement C is over Assembler.
|
||||||
But that was then and it is not just chance that developemnt has been slow in the last 50 years.
|
But that was then and it is not just chance that developemnt has been slow in the last 50 years.
|
||||||
%p
|
%p
|
||||||
There is this attitude C believers elude and since they are the gatekeepers of the os,
|
There is this attitude C believers elude and since they are the gatekeepers of the os,
|
||||||
everyone is fooled into believing only c is fast. Whereas what is true is that
|
everyone is fooled into believing only c is fast. Whereas what is true is that
|
||||||
= succeed "is" do
|
%em complied (binary) code
|
||||||
%em complied (binary) code
|
is.
|
||||||
%p
|
%p
|
||||||
On a very similar note we are lead to believe that os features must be used from c. Whereas system calls
|
On a very similar note we are lead to believe that os features must be used from c.
|
||||||
are software interrupts, not really
|
Whereas system calls are software interrupts, not really
|
||||||
%em
|
%em
|
||||||
calls
|
calls
|
||||||
%em
|
at all.
|
||||||
at all.
|
Only the c std library makes them look like c functions, but they are not.
|
||||||
Only the c std library makes them look like c functions, but they are not.
|
|
||||||
.row
|
.row
|
||||||
%p.center
|
%h3.center So what does empowerment mean.
|
||||||
%span
|
|
||||||
%b So what does empowerment mean.
|
|
||||||
%p
|
%p
|
||||||
For me it is means owning your tools.
|
For me it is means owning your tools.
|
||||||
For everyone to really be able to unfold their ideas and potential.
|
For everyone to really be able to unfold their ideas and potential.
|
||||||
Not to be stuck, rather to be able to change anything one wishes.
|
Not to be stuck, rather to be able to change anything one wishes.
|
||||||
We usually own the code we write, and we have seen amazing progress in opening up new ideas.
|
We usually own the code we write, and we have seen amazing progress in opening up new ideas.
|
||||||
%p
|
%p
|
||||||
So it is hard to even think of ruby holding us back, and it isn't off course, only current implementations of it are.
|
So it is hard to even think of ruby holding us back, and it isn't off course,
|
||||||
|
only the current implementations of it are.
|
||||||
%p
|
%p
|
||||||
Concretely what does this mean: Well i don't know do i! That's the whole point, that anyone can improve it beyond
|
Concretely what does this mean: Well i don't know do i!
|
||||||
the original creators horizon.
|
That's the whole point, that anyone can improve it beyond the original creators horizon.
|
||||||
%p
|
%p
|
||||||
But to mention a few things that have crossed my mind (and that i will most certainly not implement)
|
But to mention a few things that have crossed my mind (and that i will most certainly not implement)
|
||||||
%ul
|
%ul
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
just push more functionality into the “virtual machine” and it is in fact only the
|
just push more functionality into the “virtual machine” and it is in fact only the
|
||||||
compilation to binaries that gives static languages their speed. This is the reason
|
compilation to binaries that gives static languages their speed. This is the reason
|
||||||
to compile ruby.
|
to compile ruby.
|
||||||
%p.center.full_width
|
%p.center.three_width
|
||||||
= image_tag "layers.jpg" , alt: "Architectural layers"
|
= image_tag "architecture.png" , alt: "Architectural layers"
|
||||||
|
|
||||||
%h3#ruby Ast + Ruby
|
%h3#ruby Ast + Ruby
|
||||||
%p
|
%p
|
||||||
@ -61,26 +61,30 @@
|
|||||||
%h3#minimal-object-machine Minimal Object machine
|
%h3#minimal-object-machine Minimal Object machine
|
||||||
%p
|
%p
|
||||||
We compile Vool statements into Mom instructions. Mom is a machine, which means it has
|
We compile Vool statements into Mom instructions. Mom is a machine, which means it has
|
||||||
instructions. But unlike a cpu (or the risc layer below) it does not have memory, only objects.
|
instructions. But unlike a cpu (or the risc layer below) it does not have memory, only
|
||||||
It also has no registers, and together these two things mean that all information is stored in
|
objects.
|
||||||
objects. Also the calling convention is object based and uses Frame and Message instances to
|
It also has no registers, and together these two things mean that all information is
|
||||||
save state.
|
stored in objects. Also the calling convention is object based and uses Frame and
|
||||||
|
Message instances to save state.
|
||||||
%p
|
%p
|
||||||
Objects are typed, and are in fact the same objects the language operates on. Just the
|
Objects are typed, and are in fact the same objects the language operates on. Just the
|
||||||
functionality is expressed through instructions. While source methods are in defined on
|
functionality is expressed through instructions. While source methods are defined on
|
||||||
classes as Vool, when they are compiled to binary, they are made type specific. These
|
classes as Vool, when they are compiled to binary, they are made type specific. These
|
||||||
TypedMethods hold the binary and are stored in the Type.
|
TypedMethods hold the binary and are stored in the Type.
|
||||||
%p
|
%p
|
||||||
The Mom level exists to make the transition to Risc easier. It has a very abstract,
|
The Mom level exists to make the transition to Risc easier. It has a very abstract,
|
||||||
high level instruction set, where each single instruction may resolve to many (even tens of)
|
high level instruction set, where each single instruction may resolve to many (even
|
||||||
lower level instructions. But it breaks down Vool's tree into an instruction
|
tens of) lower level instructions. But it breaks down Vool's tree into an instruction
|
||||||
list, which is conceptually a much easier input for the next layer.
|
list, which is conceptually a much easier input for the next layer.
|
||||||
|
%p
|
||||||
|
Mom instruction may also be used to extend the systm functionality. This feature is used
|
||||||
|
in the Builtin layer of functions. These functions are coded at the Mom level, as they
|
||||||
|
can not be expressed in ruby. Examples include instance variable access, integer ops...
|
||||||
|
|
||||||
%h3#risc Risc
|
%h3#risc Risc
|
||||||
%p
|
%p
|
||||||
The Register machine layer is a relatively close abstraction of risc hardware, but without the
|
The Register machine layer is a relatively close abstraction of risc hardware,
|
||||||
quirks.
|
but without the quirks that for example arm has.
|
||||||
%p
|
|
||||||
The Risc machine has registers, indexed addressing, operators, branches and everything
|
The Risc machine has registers, indexed addressing, operators, branches and everything
|
||||||
needed to implement Mom. It does not try to abstract every possible machine feature
|
needed to implement Mom. It does not try to abstract every possible machine feature
|
||||||
(like llvm), but rather “objectifies” the general risc view to provide what is needed for
|
(like llvm), but rather “objectifies” the general risc view to provide what is needed for
|
||||||
@ -91,23 +95,25 @@
|
|||||||
instructions may be defined and used later, as long as translation is provided for them too.
|
instructions may be defined and used later, as long as translation is provided for them too.
|
||||||
In other words the instruction set is extensible (unlike cpu instruction sets).
|
In other words the instruction set is extensible (unlike cpu instruction sets).
|
||||||
%p
|
%p
|
||||||
Basic object oriented concepts are needed already at this level, to be able to generate a whole
|
Basic object oriented concepts are needed already at this level, to be able to generate
|
||||||
self contained system. Ie what an object is, a class, a method etc. This minimal runtime is called
|
a whole self contained system. Ie what an object is, a class, a method etc.
|
||||||
parfait, and the same objects will be used at runtime and compile time.
|
This minimal runtime is called parfait, and the same objects will be used at runtime
|
||||||
|
and compile time.
|
||||||
%p
|
%p
|
||||||
Since working with at this low machine level (essentially assembler) is not easy to follow for
|
Since working with at this low machine level (essentially assembler) is not easy to
|
||||||
everyone (me :-), an interpreter was created (by me:-). Later a graphical interface, a kind of
|
follow for everyone (me :-), an interpreter was created (by me:-). Later a graphical
|
||||||
|
interface, a kind of
|
||||||
%a{:href => "https://github.com/ruby-x/rubyx-debugger"} visual debugger
|
%a{:href => "https://github.com/ruby-x/rubyx-debugger"} visual debugger
|
||||||
was added.
|
was added.
|
||||||
Visualizing the control flow and being able to see values updated immediately helped
|
Visualizing the control flow and being able to see values updated immediately helped
|
||||||
tremendously in creating this layer. And the interpreter helps in testing, ie keeping it
|
tremendously in creating this layer. And the interpreter helps in testing, ie keeping it
|
||||||
working in the face of developer change.
|
working in the face of developer change.
|
||||||
|
|
||||||
%h3#binary--arm-and-elf Binary , Arm and Elf
|
%h3 Target assembler
|
||||||
%p
|
%p
|
||||||
A physical machine will run binaries containing instructions that the cpu understands, in a
|
Risc is the last abstract layer, it is then translated into machine dependent code.
|
||||||
format the operating system understands (elf). Arm and elf subdirectories hold the code for
|
This is not binary yet, more an oo version of assembler, where each instruction
|
||||||
these layers.
|
is represented by an object.
|
||||||
%p
|
%p
|
||||||
Arm is a risc architecture, but anyone who knows it will attest, with it’s own quirks.
|
Arm is a risc architecture, but anyone who knows it will attest, with it’s own quirks.
|
||||||
For example any instruction may be executed conditionally, ie
|
For example any instruction may be executed conditionally, ie
|
||||||
@ -116,5 +122,14 @@
|
|||||||
is no 32bit register load instruction. It is possible to create very dense code using
|
is no 32bit register load instruction. It is possible to create very dense code using
|
||||||
all the arm special features, but this is not implemented yet.
|
all the arm special features, but this is not implemented yet.
|
||||||
%p
|
%p
|
||||||
The Arm::Translator translates that translates RegisterInstructions to ArmInstructions,
|
The Arm::Translator translates RegisterInstructions to ArmInstructions.
|
||||||
|
|
||||||
|
%h3#binary-and-elf Elf and Binary
|
||||||
|
%p
|
||||||
|
A physical machine will run binaries containing instructions that the cpu understands,
|
||||||
|
in a format the operating system understands (elf).
|
||||||
|
%p
|
||||||
|
The previously generated objects must be able to convert themselves to binary.
|
||||||
|
These binary codes are wrapped and stored into binary files of elf format.
|
||||||
|
Arm and elf subdirectories hold the code for these layers.
|
||||||
and the Elf::ObjectWriter creates Linux binaries.
|
and the Elf::ObjectWriter creates Linux binaries.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user