renamed main section
This commit is contained in:
parent
281100e41f
commit
0f0d54e51f
@ -1,7 +1,7 @@
|
||||
# ruby-in-ruby.github.io
|
||||
# crystal-vm.github.io
|
||||
|
||||
|
||||
Crystal webpage is done with github pages: https://help.github.com/categories/20/articles
|
||||
Crystals webpage is done with github pages: https://help.github.com/categories/20/articles
|
||||
|
||||
###Contribute
|
||||
|
||||
|
22
_layouts/main.html
Normal file
22
_layouts/main.html
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
layout: site
|
||||
---
|
||||
|
||||
<div class="row vspace10">
|
||||
<div class="span10">
|
||||
<h2 class="center">{{page.title}}</h2>
|
||||
<div>
|
||||
<p><span> {{page.sub-title}} </span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span2">
|
||||
<div>
|
||||
<ul class="nav nav-list">
|
||||
<li><a href="/index.html"> Effective programming </a> </li>
|
||||
<li><a href="/ideas.html"> Ideas whence it started </a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{content}}
|
@ -24,7 +24,7 @@
|
||||
<div class="navbar effect navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a href="https://github.com/ruby-in-ruby/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
|
||||
<a href="https://github.com/crystal-vm/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>
|
||||
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse" href="#">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
@ -35,9 +35,6 @@
|
||||
<li class="link1">
|
||||
<a href="/index.html">Home</a>
|
||||
</li>
|
||||
<li class="link2">
|
||||
<a href="/what_is.html">What is</a>
|
||||
</li>
|
||||
<li class="link3">
|
||||
<a href="/crystal/layers.html">Crystal</a>
|
||||
</li>
|
||||
|
@ -36,9 +36,13 @@ title: Crystal, a simple and minimal oo machine
|
||||
<p>
|
||||
Parsing is relatively straightforward too. We all know ruby, so it's just a matter of getting the rules right.
|
||||
<br/>
|
||||
If only. Ruby is full of niceties that actually make parsing it quite difficult. But at the moment that story hasn't
|
||||
If only! Ruby is full of niceties that actually make parsing it quite difficult. But at the moment that story hasn't
|
||||
even started.
|
||||
<br/>
|
||||
Traditionally, yacc or bison or talk of lr or ll would come in here and all but a few would zone out. But llvm has
|
||||
proven that recursive descent parsing is a viable alternative, also for big projects. And Parslet puts that into a nice
|
||||
ruby framework for us.
|
||||
<br/>
|
||||
Parslet lets us use modules for parts of the parser, so those files are pretty self-explanitory. Not all is done, but
|
||||
a good start.
|
||||
<br/>
|
||||
@ -53,7 +57,32 @@ title: Crystal, a simple and minimal oo machine
|
||||
<div class="span12">
|
||||
<h5>Virtual Machine</h5>
|
||||
<p>
|
||||
The Virtual machine layer (vm) is where it gets interesting, but also more fuzzy.
|
||||
The Virtual machine layer is where it gets interesting, but also a little fuzzy.
|
||||
<br/>
|
||||
After some trying around the virtual machine layer has become a completely self contained layer to describe and
|
||||
implement an oo machine. In other words it has no reference to any physical machine, that is the next layer down.
|
||||
<br/>
|
||||
One can get headaches quite easily while thinking about implementing an oo machine in oo, it's just so difficult to
|
||||
find the boundaries. To determine those, i like to talk of types (not classes) for the objects (values) in which the
|
||||
vm is implemented. Also it is neccessary to remove ambiguity about what message sending means.
|
||||
<br/>
|
||||
One way to think of this (helps to keep sane) is to think of the types of the system known at compile time. In the
|
||||
simplest case this could be object reference and integer. The whole vm functionality can be made to work with only
|
||||
those two types, and it is not specified how the type information is stored. but off course there needs to be a
|
||||
way to check it at run-time.
|
||||
<br/>
|
||||
The vm has an instruction set that, apart from basic integer manipulation, only alows for memory access into an
|
||||
object. Instead of an implicit stack, we use activation frames and store all variables explicitly.
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<h5>Neumann Machine</h5>
|
||||
<p>
|
||||
The von Neumann machine layer is a relatively close abstraction of hardware.
|
||||
<br/>
|
||||
Currently still quite simple, we have Classes for things we know, like program and function. Also things we need
|
||||
to create the code, like Blocks and Instructions.
|
||||
@ -61,7 +90,7 @@ title: Crystal, a simple and minimal oo machine
|
||||
The most interesting thing is maybe the idea of a Value. If you think of Variables, Values are what a variable may
|
||||
be assigned, but it may carry a storage place (register). Values are constant, and so to
|
||||
change a value, we have to create a new Value (of possibly different basic type). Thus
|
||||
all machine instructions are the trasformation of values into new ones.
|
||||
all machine instructions are the transformation of values into new ones.
|
||||
<br/>
|
||||
Also interesting is the slightly unripe Basic Type system. We have a set of machine-word size types and do not
|
||||
tag them (like mri or BB), but keep type info seperate. These types include integer (signed/unsigned) object reference
|
||||
|
@ -1 +1 @@
|
||||
ruby-in-ruby.org
|
||||
crystal-vm.org
|
||||
|
72
ideas.html
Executable file
72
ideas.html
Executable file
@ -0,0 +1,72 @@
|
||||
---
|
||||
layout: main
|
||||
title: Ruby in Ruby
|
||||
sub-title: To implement ruby in ruby hopes make the the mysterious more accessible, shed light in the farthest (ruby) corners, and above all, <b>empower you</b>
|
||||
---
|
||||
|
||||
<div class="row vspace20">
|
||||
<div class="span4">
|
||||
<h2 class="center"> A better tool, a better job</h2>
|
||||
<p>
|
||||
Ruby is the better tool to do the job. Any software job that is. We who use ruby daily do so because it is
|
||||
more productive, better in almost every way. 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
|
||||
influence of C (folks).
|
||||
</p>
|
||||
<p>
|
||||
Just a short and subjective list of why ruby is the better tool:
|
||||
<ul>
|
||||
<li>More fun. Ask anyone :-) </li>
|
||||
<li>Lets you focuss on the task</li>
|
||||
<li>Elegant, both in syntax and solution</li>
|
||||
<li>Understandable</li>
|
||||
<li>Much faster to code</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2 class="center">Boys and toys</h2>
|
||||
<p>
|
||||
Rails has evolved tremendously from what was already a good start. All the development <em>around</em> it has nurtured
|
||||
ruby developement in all areas. Rails and all those parts make up the most mature and advanced software system
|
||||
i know.
|
||||
</p>
|
||||
<p> The "rails effect" is due to the accessibility of the system, imho. Ie it is written in ruby.</p>
|
||||
<p> Ruby itself has not enjoyed this rails effect, and that is because it is written in C (or c++) </p>
|
||||
<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
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2 class="center">Step to Indepencance</h2>
|
||||
<p>
|
||||
The first thing any decent compiler does, is compile itself. 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.
|
||||
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,
|
||||
everyone is fooled into believing only c is fast. Whereas what is true is that <em>static</em> code is fast.
|
||||
</p>
|
||||
<p>
|
||||
On a very similar note we are lead to believe that os features must be used from c. Whereas system calls
|
||||
are software interrupts and only the c std library makes them look like c functions. But they are not.
|
||||
</p>
|
||||
<p>
|
||||
So now, are we ready to generate some bytes? even if they are Machine Code. And go to the Source? I say we are!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
111
index.html
111
index.html
@ -1,82 +1,81 @@
|
||||
---
|
||||
layout: site
|
||||
title: Ruby in Ruby is 100% ruby
|
||||
layout: main
|
||||
title: Effectiveness, not efficiency
|
||||
sub-title: By way of a new look at programming.
|
||||
---
|
||||
|
||||
<div class="row center vspace10">
|
||||
<div class="span12">
|
||||
<h1><span>Ruby in Ruby. With more ruby and nothing but ruby.</span></h1>
|
||||
<p>"Hey crystal, what do you want to be when you grow up". I like pink, i wanna be a ruby.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row center vspace10">
|
||||
<div class="span12">
|
||||
<p><span>Ruby in ruby hopes make the the mysterious more accessible, shed light in the farthest (ruby) corners, and above all, <b>empower you</b> </span></p>
|
||||
</div>
|
||||
<div class="span12">
|
||||
<p><span>Three ideas are behind it</span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row vspace20">
|
||||
<div class="span4">
|
||||
<h2 class="center"> A better tool, a better job</h2>
|
||||
<h2 class="center"> Where to go</h2>
|
||||
<p>
|
||||
Ruby is the better tool to do the job. Any software job that is. We who use ruby daily do so because it is
|
||||
more productive, better in almost every way. The only downside is speed and we argue that with cheap resources.
|
||||
When making the distinction between effectiveness and efficiency i like to think of transport.
|
||||
</p>
|
||||
<p>
|
||||
Why it has taken this long to even seriously attempt a ruby implementation in ruby is due to the overwhelming
|
||||
influence of C (folks).
|
||||
Efficiency is going fast, like an airplane is much more efficient than a car and that is more so than walking.
|
||||
</p>
|
||||
<p>
|
||||
Just a short and subjective list of why ruby is the better tool:
|
||||
<ul>
|
||||
<li>More fun. Ask anyone :-) </li>
|
||||
<li>Lets you focuss on the task</li>
|
||||
<li>Elegant, both in syntax and solution</li>
|
||||
<li>Understandable</li>
|
||||
<li>Much faster to code</li>
|
||||
</ul>
|
||||
Effectiveness on the other hand is how straight your route is. Say your in Hamburg and want to go to Berlin, then
|
||||
it is not effective to go to Rome first.
|
||||
</p>
|
||||
<p>
|
||||
Ruby, like python and mother smalltalk, let us be more effective at programming. We accept that they are not efficient,
|
||||
but i think that can be changed.
|
||||
</p>
|
||||
<p>
|
||||
But even while ruby has blossomed we have seen noticeable increase in effectiveness with so called dsl's and
|
||||
what is generally called meta-programming.
|
||||
</p>
|
||||
<p>
|
||||
But meta-programming is just a way to say that we manipulate the program just as we manipulate data. Off course! But
|
||||
to do that effectively we need a better model of what an object oriented program actually is.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2 class="center">Understandability</h2>
|
||||
<p>
|
||||
The way i see it is that it is the understandibility that makes ruby or python more effective. As we read much more
|
||||
code than write (even it's our own), focusing on descriptive programs helps.
|
||||
</p>
|
||||
<p>
|
||||
But you only have to look at even rubies basic blocks, to see that we have a way to go. We use Strings to represent
|
||||
words and text, while we store data in Arrays or Hashes. If you look these up you may find a thread used for tying,
|
||||
a military force, or a dish of diced meat and vegetables. So we have a way to go there.
|
||||
</p>
|
||||
<p>
|
||||
But even more disconcerting is that we have no model of how an object oriented system actually works. We know what it
|
||||
does off course, as we programm using it all the time. But how it does it is not clear.
|
||||
</p>
|
||||
<p>
|
||||
At least not clear in the sense that i could go and read it's code. Ruby like python are written in c and that just
|
||||
is not easily understandable code.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2 class="center">Boys and toys</h2>
|
||||
<h2 class="center">Playing computer</h2>
|
||||
<p>
|
||||
Rails has evolved tremendously from what was already a good start. All the development <em>around</em> it has nurtured
|
||||
ruby developement in all areas. Rails and all those parts make up the most mature and advanced software system
|
||||
i know.
|
||||
</p>
|
||||
<p> The "rails effect" is due to the accessibility of the system, imho. Ie it is written in ruby.</p>
|
||||
<p> Ruby itself has not enjoyed this rails effect, and that is because it is written in C (or c++) </p>
|
||||
<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
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2 class="center">Step to Indepencance</h2>
|
||||
<p>
|
||||
The first thing any decent compiler does, is compile itself. 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.
|
||||
When programming, we fly blind. We have no visual idea of what the system that we write will do and the only way
|
||||
to get feedback is to have the final version run. Bret Victor has put this
|
||||
<a href="http://vimeo.com/36579366"> into words well</a>.
|
||||
</p>
|
||||
<p>
|
||||
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.
|
||||
So when we program, it's actually mostly in our head. By playing computer, ie simulating in the head what the computer
|
||||
will do when it runs the programm.
|
||||
</p>
|
||||
<p>
|
||||
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 <em>static</em> code is fast.
|
||||
And so what we consider good programmers, are people who are good at playing computer in their head.
|
||||
</p>
|
||||
<p>
|
||||
On a very similar note we are lead to believe that os features must be used from c. Whereas system calls
|
||||
are software interrupts and only the c std library makes them look like c functions. But they are not.
|
||||
But off course we have the computer right there before us. So it should do it rather than us having to simulate it.
|
||||
</p>
|
||||
<p>
|
||||
So now, are we ready to generate some bytes? even if they are Machine Code. And go to the Source? I say we are!
|
||||
What will come out of that line when we actually manage to put it into practise is unclear, though it is certain it
|
||||
will be easier to do and result in huegely more powerful programs
|
||||
</p>
|
||||
<p>
|
||||
Yet to get there we need better tools. Better tools that let us understand what we are doing better. Better models of
|
||||
what we call programming, and by better i mean easier to understand by people.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@ title: Crystal and Ruby, Ruby and Crystal
|
||||
<div class="span4">
|
||||
<h4>Vm</h4>
|
||||
<h5>Crystal</h5>
|
||||
<blockquote><p> The heart of the ruby-in-ruby project is crystal, the virtual machine <br /></p></blockquote>
|
||||
<blockquote><p> The heart of the crystal-vm project is crystal, the virtual machine <br /></p></blockquote>
|
||||
<p>Crystal is written in 100% ruby</p>
|
||||
<p>Crystal uses an existing ruby to bootstrap itself</p>
|
||||
<p>Crystal generates native code, and ( with 1+2) creates a native ruby virtual machine. </p>
|
||||
|
Loading…
Reference in New Issue
Block a user