start architecture menu
This commit is contained in:
parent
599583c8f4
commit
b1614dc353
@ -1,20 +0,0 @@
|
|||||||
\---
|
|
||||||
layout: site
|
|
||||||
\---
|
|
||||||
.row
|
|
||||||
%div
|
|
||||||
%h1.center
|
|
||||||
{{page.title}}
|
|
||||||
%p.center
|
|
||||||
%span {{page.sub-title}}
|
|
||||||
%ul.nav
|
|
||||||
%li
|
|
||||||
%a{:href => "/project/motivation.html"} Motivation
|
|
||||||
%li
|
|
||||||
%a{:href => "/project/ideas.html"} Ideas
|
|
||||||
%li
|
|
||||||
%a{:href => "/project/history.html"} History
|
|
||||||
%li
|
|
||||||
%a{:href => "/project/contribute.html"} Contribute
|
|
||||||
%div
|
|
||||||
{{content}}
|
|
@ -1,20 +0,0 @@
|
|||||||
\---
|
|
||||||
layout: site
|
|
||||||
\---
|
|
||||||
.row
|
|
||||||
%div
|
|
||||||
%h1.center
|
|
||||||
{{page.title}}
|
|
||||||
%p.center
|
|
||||||
%span {{page.sub-title}}
|
|
||||||
%ul.nav
|
|
||||||
%li
|
|
||||||
%a{:href => "/rubyx/layers.html"} Layers of RubyX
|
|
||||||
%li
|
|
||||||
%a{:href => "/rubyx/memory.html"} Memory
|
|
||||||
%li
|
|
||||||
%a{:href => "/rubyx/threads.html"} Threads
|
|
||||||
%li
|
|
||||||
%a{:href => "/rubyx/optimisations.html"} Optimisation ideas
|
|
||||||
%div
|
|
||||||
{{content}}
|
|
@ -1,41 +0,0 @@
|
|||||||
!!!
|
|
||||||
/[if IE 8] <html class="no-js lt-ie9" lang="en">
|
|
||||||
/ [if gt IE 8]><!
|
|
||||||
%html.no-js{:lang => "en"}
|
|
||||||
/ <![endif]
|
|
||||||
%body
|
|
||||||
%p
|
|
||||||
{% include head.html %}
|
|
||||||
%header
|
|
||||||
.container
|
|
||||||
%a{:href => "https://github.com/ruby-x"}
|
|
||||||
%img{:alt => "Fork me on GitHub", "data-canonical-src" => "https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png", :src => "https://camo.githubusercontent.com/8b6b8ccc6da3aa5722903da7b58eb5ab1081adee/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6f72616e67655f6666373630302e706e67", :style => "position: absolute; top: 0; left: 0; border: 0;"}/
|
|
||||||
%ul.nav
|
|
||||||
%li
|
|
||||||
%a{:href => "/"} Home
|
|
||||||
%li
|
|
||||||
%a{:href => "/rubyx/layers.html"} Architecture
|
|
||||||
%li
|
|
||||||
%a{:href => "/typed/typed.html"} Typed layer
|
|
||||||
%li
|
|
||||||
%a{:href => "/arm/overview.html"} Arm Resources
|
|
||||||
%li
|
|
||||||
%a{:href => "/project/motivation.html"} About
|
|
||||||
%li
|
|
||||||
%a{:href => "{{site.posts.first.url}}"} News
|
|
||||||
%a{:href => "https://github.com/ruby-x"}
|
|
||||||
%img{:alt => "Logo", :src => "/assets/images/x-small.png", :style => "position: absolute; top: 15px; right: 15px; border: 0; width: 70px"}/
|
|
||||||
.container
|
|
||||||
{{ content }}
|
|
||||||
%footer
|
|
||||||
.container
|
|
||||||
.row.center
|
|
||||||
%p © Copyright Torsten Ruger 2013-7
|
|
||||||
:javascript
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
var the_id = 'UA-61481839-1';
|
|
||||||
ga('create', the_id.replace("-1" , "-2") , 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
@ -6,4 +6,17 @@ module ApplicationHelper
|
|||||||
link += link_to( post.title , blog_post_url(post.slug))
|
link += link_to( post.title , blog_post_url(post.slug))
|
||||||
link.html_safe
|
link.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def ext_link(name = nil, options = nil, html_options = nil, &block)
|
||||||
|
target_blank = {target: "_blank"}
|
||||||
|
if block_given?
|
||||||
|
options ||= {}
|
||||||
|
options = options.merge(target_blank)
|
||||||
|
else
|
||||||
|
html_options ||= {}
|
||||||
|
html_options = html_options.merge(target_blank)
|
||||||
|
end
|
||||||
|
link_to(name, options, html_options, &block)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
10
app/views/pages/project/_menu.html.haml
Normal file
10
app/views/pages/project/_menu.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.row
|
||||||
|
%ul.nav
|
||||||
|
%li
|
||||||
|
%a{:href => "/project/motivation.html"} Motivation
|
||||||
|
%li
|
||||||
|
%a{:href => "/project/ideas.html"} Ideas
|
||||||
|
%li
|
||||||
|
%a{:href => "/project/history.html"} History
|
||||||
|
%li
|
||||||
|
%a{:href => "/project/contribute.html"} Contribute
|
10
app/views/pages/rubyx/_menu.haml
Normal file
10
app/views/pages/rubyx/_menu.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.row
|
||||||
|
%ul.nav
|
||||||
|
%li
|
||||||
|
%a{:href => "/rubyx/layers.html"} Layers of RubyX
|
||||||
|
%li
|
||||||
|
%a{:href => "/rubyx/memory.html"} Memory
|
||||||
|
%li
|
||||||
|
%a{:href => "/rubyx/threads.html"} Threads
|
||||||
|
%li
|
||||||
|
%a{:href => "/rubyx/optimisations.html"} Optimisation ideas
|
@ -1,5 +1,7 @@
|
|||||||
- title = "RubyX architectural layers"
|
- title = "RubyX architectural layers"
|
||||||
|
|
||||||
|
= render "pages/rubyx/menu"
|
||||||
|
|
||||||
%h1#main-layers Main Layers
|
%h1#main-layers Main Layers
|
||||||
%p
|
%p
|
||||||
To implement an object system to execute object oriented languages takes a large system.
|
To implement an object system to execute object oriented languages takes a large system.
|
||||||
@ -13,18 +15,20 @@
|
|||||||
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
|
||||||
compiling to binaries that gives static languages their speed. This is the reason
|
compiling to binaries that gives static languages their speed. This is the reason
|
||||||
to compile ruby.
|
to compile ruby.
|
||||||
%p
|
%p.center
|
||||||
%img{:alt => "Architectural layers", :src => "/assets/layers.jpg"}/
|
= image_tag "layers.jpg" , alt: "Architectural layers"
|
||||||
|
|
||||||
%h3#ruby Ruby
|
%h3#ruby Ruby
|
||||||
%p
|
%p
|
||||||
To compile and run ruby, we first need to parse ruby. While parsing ruby is quite
|
To compile and run ruby, we first need to parse ruby. While parsing ruby is quite
|
||||||
a difficult task, it has already been implemented in pure ruby
|
a difficult task, it has already been implemented in pure ruby
|
||||||
%a{:href => "https://github.com/whitequark/parser"}> here
|
= succeed "." do
|
||||||
\. The output of the parser is
|
=ext_link "here" ,"https://github.com/whitequark/parser"
|
||||||
|
The output of the parser is
|
||||||
an ast, which holds information about the code in instances of a single
|
an ast, which holds information about the code in instances of a single
|
||||||
%em Node
|
%em Node
|
||||||
class.
|
class.
|
||||||
Nodes have a type (which you sometimes see in s-expressions) and a list of children.
|
Nodes have a type attribute (which you sometimes see in s-expressions) and a list of children.
|
||||||
%p There are two basic problems when working with ruby ast: one is the a in ast, the other is ruby.
|
%p There are two basic problems when working with ruby ast: one is the a in ast, the other is ruby.
|
||||||
%p
|
%p
|
||||||
Since an abstract syntax tree only has one base class, one needs to employ the visitor
|
Since an abstract syntax tree only has one base class, one needs to employ the visitor
|
||||||
@ -34,12 +38,13 @@
|
|||||||
The second, possibly bigger problem, is ruby itself: Ruby is full of programmer happiness,
|
The second, possibly bigger problem, is ruby itself: Ruby is full of programmer happiness,
|
||||||
three ways to do this, five to do that. To simplify that, remove the duplication and
|
three ways to do this, five to do that. To simplify that, remove the duplication and
|
||||||
make analyis easier, Vool was created.
|
make analyis easier, Vool was created.
|
||||||
|
|
||||||
%h3#virtual-object-oriented-language Virtual Object Oriented Language
|
%h3#virtual-object-oriented-language Virtual Object Oriented Language
|
||||||
%p
|
%p
|
||||||
Virtual, in this context, means that there is no syntax for this language; it is an
|
Virtual, in this context, means that there is no syntax for this language; it is an
|
||||||
intermediate representation which
|
intermediate representation which
|
||||||
%em could
|
%em could
|
||||||
be targeted by several languages.
|
be targeted by several real languages.
|
||||||
%p
|
%p
|
||||||
The main purpose is to simplify existing oo languages down to it’s core components: mostly
|
The main purpose is to simplify existing oo languages down to it’s core components: mostly
|
||||||
calling, assignment, continuations and exceptions. Typed classes for each language construct
|
calling, assignment, continuations and exceptions. Typed classes for each language construct
|
||||||
@ -47,8 +52,14 @@
|
|||||||
%p
|
%p
|
||||||
Examples for things that exist in ruby but are broken down in Vool are
|
Examples for things that exist in ruby but are broken down in Vool are
|
||||||
%em unless
|
%em unless
|
||||||
, ternary operator,
|
,
|
||||||
do while or for loops and other similar syntactic sugar.
|
%em ternary operator
|
||||||
|
,
|
||||||
|
%em do while
|
||||||
|
or
|
||||||
|
%em for
|
||||||
|
loops and other similar syntactic sugar.
|
||||||
|
|
||||||
%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
|
||||||
@ -61,19 +72,18 @@
|
|||||||
functionality is expressed through instructions. Methods are in fact defined (as vool) on classes
|
functionality is expressed through instructions. Methods are in fact defined (as vool) on classes
|
||||||
and then compiled to Mom/Risc/Arm and the results stored in the method object.
|
and then compiled to Mom/Risc/Arm and the results stored in the method object.
|
||||||
%p
|
%p
|
||||||
Compilation to Mom happens in two stages:
|
The Mom level exists to make the transition to Risc easier. It has a very abstract,
|
||||||
1. The linear statements/code is translated to Mom instructions.
|
high level instruction set, where each single instruction may resolve to many tens
|
||||||
2. Control statements are translated to jumps and labels.
|
of lower level instructions. But it breaks down Vool's tree into an instruction
|
||||||
%p
|
list, which is conceptually a much easier input for the next layer.
|
||||||
The second step leaves a linked list of machine instructions as the input for the next stage.
|
|
||||||
In the future a more elaborate system of optimisations is envisioned between these stages.
|
|
||||||
%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, but without the
|
||||||
quirks.
|
quirks.
|
||||||
%p
|
%p
|
||||||
The Risc machine has registers, indexed addressing, operators, branches and everything
|
The Risc machine has registers, indexed addressing, operators, branches and everything
|
||||||
needed for the next layer. 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
|
||||||
the Mom layer, the next layer up.
|
the Mom layer, the next layer up.
|
||||||
%p
|
%p
|
||||||
@ -93,6 +103,7 @@
|
|||||||
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#binary--arm-and-elf Binary , Arm and Elf
|
||||||
%p
|
%p
|
||||||
A physical machine will run binaries containing instructions that the cpu understands, in a
|
A physical machine will run binaries containing instructions that the cpu understands, in a
|
||||||
@ -100,9 +111,11 @@
|
|||||||
these layers.
|
these layers.
|
||||||
%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 in arm. Or there is no 32bit
|
For example any instruction may be executed conditionally, ie
|
||||||
register load instruction. It is possible to create very dense code using all the arm
|
%em every
|
||||||
special features, but this is not implemented yet.
|
instruction carries bits to make it check the status register. Or the fact that there
|
||||||
|
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.
|
||||||
%p
|
%p
|
||||||
All Arm instructions are (ie derive from) Register instruction and there is an ArmTranslator
|
The Arm::Translator translates that translates RegisterInstructions to ArmInstructions,
|
||||||
that translates RegisterInstructions to ArmInstructions.
|
and the Elf::ObjectWriter creates Linux binaries.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user