html cleanup

widths and things
This commit is contained in:
Torsten Ruger 2015-11-23 14:45:01 +02:00
parent d4bb141084
commit d855f20d52
10 changed files with 79 additions and 294 deletions

View File

@ -2,26 +2,24 @@
layout: site
---
<div class="row vspace10">
<div class="span10">
<h2 class="center">{{page.title}}</h2>
<div>
<p class="center"><span> {{page.sub-title}} </span></p>
{{content}}
</div>
</div>
<div class="span2">
<h3 class="center">More Detail</h2>
<div>
<ul class="nav nav-list">
<li><a href="/arm/target.html"> Overview </a> </li>
<li><a href="/arm/big_spec.pdf"> Huge spec </a> </li>
<li><a href="/arm/overview.html"> Overview </a> </li>
<li><a href="/arm/target.html" target="sspec"> Small Spec(html) </a> </li>
<li><a href="/arm/arm_inst.pdf" target="pspec"> Small Spec(pdf) </a> </li>
<li><a href="/arm/big_spec.pdf" target="bspec"> Huge spec </a> </li>
<li><a href="/arm/qemu.html"> Virtual Pi </a> </li>
<li><a href="/arm/remote_pi.html"> Remote pi </a> </li>
</ul>
</div>
</div>
</div>
{{content}}

View File

@ -1,25 +0,0 @@
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css" />
<!-- Website CSS Theme Css -->
<link rel="stylesheet" href="/css/stylesheet.css" />
</head>
<body>
<div class="content" width=90%>
<div class="container theme">
{{content}}
</div>
</div>
</body>
</html>

View File

@ -2,9 +2,6 @@
layout: site
---
<div class="row vspace10">
<div class="span10">
<h2 class="center">{{page.title}}</h2>

View File

@ -44,7 +44,7 @@
<a href="/soml/soml.html">Soml(Language)</a>
</li>
<li class="link7">
<a href="/arm.html">Arm Resources</a>
<a href="/arm/overview.html">Arm Resources</a>
</li>
<li class="link6">
<a href="/project/motivation.html">About</a>
@ -70,7 +70,7 @@
<div class="row center">
<div class="span12">
<div class="vspace10">
<p>&copy; Copyright 2014.</p>
<p>&copy; Copyright Torsten Ruger 2013-5.</p>
</div>
</div>
</div>

View File

@ -2,17 +2,16 @@
layout: site
---
<div class="row vspace10">
<div class="span10">
<h2 class="center">{{page.title}}</h2>
<p class="center"><span> {{page.sub-title}} </span></p>
<div>
<p class="center"><span> {{page.sub-title}} </span></p>
{{content}}
</div>
</div>
<div class="span2">
<h3 class="center">More Detail</h2>
<div>
<ul class="nav nav-list">
<li><a href="/soml/soml.html"> Soml </a> </li>
@ -22,5 +21,3 @@ layout: site
</div>
</div>
</div>
{{content}}

View File

@ -4,8 +4,7 @@ title: Salama architectural layers
---
<div class="row">
<div class="span10">
<div class="row span10">
<h4>Main Layers</h4>
<p>
To implement an object system to execute object oriented languages takes a large system.
@ -32,11 +31,9 @@ title: Salama architectural layers
bootstraping code</li>
</ul>
</p>
</div>
</div>
<div class="row">
<div class="span10">
<div class="row span10">
<h5>Binary , Arm and Elf</h5>
<p>
A physical machine will run binaries containing intructions that the cpu understands. With arm
@ -49,11 +46,9 @@ title: Salama architectural layers
register load instruction. It is possible to create very dense code using all the arm
special features, but this is not implemented yet.
</p>
</div>
</div>
<div class="row">
<div class="span10">
<div class="row span10">
<h5>Register Machine</h5>
<p>
The Register machine layer is a relatively close abstraction of risc hardware, but without the
@ -84,11 +79,9 @@ title: Salama architectural layers
tremendously in creating this layer. And the interpreter helps in testing, ie keeping it
working in the face of developer change.
</p>
</div>
</div>
<div class="row">
<div class="span10">
<div class="row span10">
<h5>Soml, Salama object machine language</h5>
<p>
Soml is probably the larest single part of the system and much more information can be found
@ -121,11 +114,9 @@ title: Salama architectural layers
implementations for different types of the arguments (statically matched)</li>
</ul>
</p>
</div>
</div>
<div class="row">
<div class="span10">
<div class="row span10">
<h5>Salama</h5>
<p>
To compile and run ruby, we need to parse and compile ruby code. To compile ruby to soml a clear
@ -156,7 +147,6 @@ title: Salama architectural layers
compile a single ruby method into several soml methods. Each such method is typed, ie all
arguments and variables are of known type. According to these types we can call methods according
to their signatures. Also we can autognerate error methods for unhandled types, and predict
that only a fraction of the possible combinations will actually be needed.
that only a fraction of the possible combinations will actually be needed.
</p>
</div>
</div>

View File

@ -1,154 +0,0 @@
---
layout: salama
title: Salama architectural layers
---
<div class="row">
<div class="span10">
<h4>Main Layers</h4>
<p>
To implement an object system to execute object oriented languages takes a large system.
The parts or abstraction layers are detailed below.</br>
It is important to undrstand the approach first though, as it differs from the normal
interpretation. The idea is to compile (eg) ruby. It may be easiest to compare to a static
object oriented language like c++. When c++ was created c++ code was translated into c, which
then gets translated into assembler, which gets translated to binary code, which is linked
and executed. Compiling to binaries is what gives these languages speed, and is one reason
to compile ruby. </br>
In a similar way to the c++ example, we need language between ruby and assembler, as it is too
big a mental step from ruby to assembler. Off course course one could try to compile to c, but
since c is not object oriented that would mean dealing with all off c's non oo heritance, like
linking model, memory model, calling convention etc. (more on this in the book) <br/>
The layers are:
<ul>
<li> <b> Binary and cpu specific assembler.</b> This includes arm assembly and elf support
to produce a binary that can then read in ruby programs</li>
<li> <b> Risc register machine abstraction </b> provides a level of machine abstraction, but
as the name says, quite a simle one.</li>
<li> <b> Soml, Salama object machine language, </b> which is like our object c. Statically
typed object oriented with object oriented call sematics. </li>
<li> <b> Salama </b> , which is the layer compiling ruby code into soml and includes
bootstraping code</li>
</ul>
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Binary , Arm and Elf</h5>
<p>
A physical machine will run binaries containing intructions that the cpu understands. With arm
being our main target, this means we need code to produce binary, which is contained in a
seperate module <a href="https://github.com/salama/salama-arm"> salama-arm </a>. <br/>
To be able to run code on a unix based operating system, binaries need to be packaged in a
way that the os understands, so minimal elf support is included in the package. <br/>
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
register load instruction. It is possible to create very dense code using all the arm
special features, but this is not implemented yet.
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Register Machine</h5>
<p>
The Register machine layer is a relatively close abstraction of risc hardware, but without the
quirks.
<br/>
The register machine has registers, indexed addressing, operators, branches and everything
needed for the next layer. It doesn not try to abstract every possible machine leature
(like llvm), but rather "objectifies" the risc view to provide what is needed for soml, the
next layer up.
<br/>
The machine has it's own (abstract) instruction set, and the mapping to arm is quite
straightforward. Since the instruction set is implemented as derived classes, additional
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).
</p>
<p>
Basic object oriented concepts are needed already at this level, to be able to generate a whole
self contained system. Ie what an object is, a class, a method etc. This minimal runtime is called
parfait and will be coded in soml eventually. But since it is the same objects at runtime and
compile time, it will then be translated back to ruby for use at compile time. Currenty there
are two versions of the code, in ruby and soml, being hand synchronized. More about parfait below.
</p>
<p>
Since working with at this low machine level (essentially assembler) is not easy to follow for
everyone, an interpreter was created. Later a graphical interface, a kind of
<a href="https://github.com/salama/salama-debugger"> visual debugger </a> was added.
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
working in the face of developer change.
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Soml, Salama object machine language</h5>
<p>
Soml is probably the larest single part of the system and much more information can be found
<a href="/soml/soml.html"> here </a>.
<br/>
Before soml, a more traditional virtual machine approach was taken and abandoned. The language
is easy to understand and provides a good abstraction, both in terms of object orienteation,
and in terms of how this is expressed in the register model. <br/>
It is like ruby with out the dynamic aspects, but typed. <br/>
In broad strokes it consists off:
<ul>
<li> <b> Parser:</b> Currently a peg parser, though a hand coded one is planned.
The result of which is an AST</li>
<li> <b> Compiler:</b> compiles the ast into a sequence of Register instructions.
and runtime objects (classes, methods etc)</li>
<li> <b> Parfait: </b> Is the runtime, ie the minimal set of objects needed to
create a binary with the required information to be dynamic</li>
<li> <b> Builtin: </b> A very small set of primitives that are impossible to express
in soml (remembering that parfait will be expressed in soml eventually)</li>
</ul>
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Salama</h5>
<p>
</p>
</p>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<h5>Parfait</h5>
<p>
Ruby is very dynamic, and so it has a relatively large run-time. Parfait is that Run-time.
<br/>
Parfait includes all the functionality a ruby program could not do without, Array, Hash, Object, Class, etc.
<br/>
Parfait does not include any stdlib or indeed core functionality if it doesn't have too.
<br/>
Parfait is coded in ruby, but not all functionality can be coded in ruby, so there is Builtin
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h5>Builtin</h5>
<p>
Builtin is the part of the vm that can not be coded in ruby. It is not, as may be imagined, a set of instructions,
but rather a set of modules.
<br/>
Modules of Builtin have functions that implement functionality that can not be coded in ruby. Ie array access.
The functions take a VM::Method and provide the code as a set of instructions. This may be seen as the assembler
layer if the vm.
</p>
</div>
</div>

View File

@ -1,80 +0,0 @@
---
layout: soml
title: Salama object machine language
---
<div class="row">
<div class="span10">
<h4>Top down designed language</h4>
<p>
Soml is a language that is designed to be compiled into, rather than written, like
other languages. It is the base for a higher system,
designed for the needs to compile ruby. It is not an endeavour to abstract from a
lower level, like other system languages, namely off course c.<br/>
Still it is a system language, or an object machine language, so almost as low level a
language as possible. Only assembler is really lower, and it could be argued that assembler
is not really a language, rather a data format for expressing binary code. <br/>
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Object oriented to the core, including calling convention</h5>
<p>
Soml is completely object oriented and strongly typed. For types, the classes are used, but
the main distinction is between object (references) and integers. This is off course
essential as dereferencing integers is what we want to avoid.
</p>
<p>
The object model, ie the basic properties of objects that the system relies on, is quite simple
and explained below. It involves a single reference per object. <br/> Also the object memory
model is kept quite simple in that objects are always small multiples of the cache size of the
hardware machine. We use object encapsulation to build up larger looking objects from these
basic blocks.
</p>
<p>
The calling convention is also object oriented, not stack based*. Message objects used to
define the data needed for invocation. They carry arguments, a frame and return addresses.
In Soml return addresses are pre-calculated and determined by the caller, and yes, there
are several. In fact there is one return address per masic type, plus one for exception.
A method invocation may thus be made to return to an entirely different location than the
caller.
*(A stack, as used in c, is not typed and as such a source of problems)
</p>
<p>
There is no non- object based memory in soml. The only global constants are instances of
classes that can be accessed by writing the class name in soml source.
</p>
</div>
</div>
<div class="row">
<div class="span10">
<h5>Syntax and runtime</h5>
<p>
Soml syntax is a mix between ruby and c. I is like ruby in the sense that semicolons and even
newlines are not neccessary unless they are. It still uses braces, but that will probably
be changed. <br/>
But off course it is typed, so in argument or variable definitions the type must be specified
like in c. Types are classes, but int may be used for brevity instead of Integer. Return
types are also declared, though more for statci analysis. As mentioned any function may return
to differernt addresses according to type. The compiler automatically inserts erros for
return typesa that are not handled by the caller. <br/>
The complete syntax and their translation is discussed <a href="syntax.html"> here </a>
</p>
<p>
As soml is the base for dynamic languages, all compile information is recorded in the runtime.
All inforamtion is off course object oriented, ie in the form off objects. This means a class
hierachy and this itself is off course part of the runtime. The runtime, Parfait, is kept
to a minnimum, currently around 15 classes, described in detail <a href="parfait.html">
here </a>. <br/>
Historically Parfait has been coded in ruby, as it was first needed in the compiler.
This had the additional benefit of providing solid test cases for the functionality.
Currently the process is to recode the same functionality in soml, and by the end of that
a converter will be written. This will convert the soml code into ruby code, thus removing the
duplication.
</p>
</div>
</div>

62
soml/soml.md Normal file
View File

@ -0,0 +1,62 @@
---
layout: soml
title: Salama object machine language
---
#### Top down designed language
Soml is a language that is designed to be compiled into, rather than written, like
other languages. It is the base for a higher system,
designed for the needs to compile ruby. It is not an endeavour to abstract from a
lower level, like other system languages, namely off course c.<br/>
Still it is a system language, or an object machine language, so almost as low level a
language as possible. Only assembler is really lower, and it could be argued that assembler
is not really a language, rather a data format for expressing binary code. <br/>
##### Object oriented to the core, including calling convention
Soml is completely object oriented and strongly typed. For types, the classes are used, but
the main distinction is between object (references) and integers. This is off course
essential as dereferencing integers is what we want to avoid.
The object model, ie the basic properties of objects that the system relies on, is quite simple
and explained in the runtime section. It involves a single reference per object. <br/>
Also the object memory
model is kept quite simple in that objects are always small multiples of the cache size of the
hardware machine. We use object encapsulation to build up larger looking objects from these
basic blocks.
The calling convention is also object oriented, not stack based*. Message objects used to
define the data needed for invocation. They carry arguments, a frame and return addresses.
In Soml return addresses are pre-calculated and determined by the caller, and yes, there
are several. In fact there is one return address per masic type, plus one for exception.
A method invocation may thus be made to return to an entirely different location than the
caller.
\*(A stack, as used in c, is not typed and as such a source of problems)
There is no non- object based memory in soml. The only global constants are instances of
classes that can be accessed by writing the class name in soml source.
##### Syntax and runtime
Soml syntax is a mix between ruby and c. I is like ruby in the sense that semicolons and even
newlines are not neccessary unless they are. It still uses braces, but that will probably
be changed. <br/>
But off course it is typed, so in argument or variable definitions the type must be specified
like in c. Types are classes, but int may be used for brevity instead of Integer. Return
types are also declared, though more for statci analysis. As mentioned any function may return
to differernt addresses according to type. The compiler automatically inserts erros for
return typesa that are not handled by the caller. <br/>
The complete syntax and their translation is discussed <a href="syntax.html"> here </a>
As soml is the base for dynamic languages, all compile information is recorded in the runtime.
All inforamtion is off course object oriented, ie in the form off objects. This means a class
hierachy and this itself is off course part of the runtime. The runtime, Parfait, is kept
to a minnimum, currently around 15 classes, described in detail <a href="parfait.html">
here </a>. <br/>
Historically Parfait has been coded in ruby, as it was first needed in the compiler.
This had the additional benefit of providing solid test cases for the functionality.
Currently the process is to recode the same functionality in soml, and by the end of that
a converter will be written. This will convert the soml code into ruby code, thus removing the
duplication.