diff --git a/README.md b/README.md index 00d947a..a90beef 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/_layouts/main.html b/_layouts/main.html new file mode 100644 index 0000000..f01b302 --- /dev/null +++ b/_layouts/main.html @@ -0,0 +1,22 @@ +--- +layout: site +--- + +
{{page.sub-title}}
+
Parsing is relatively straightforward too. We all know ruby, so it's just a matter of getting the rules right.
- 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.
+ 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.
+
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.
@@ -53,7 +57,32 @@ title: Crystal, a simple and minimal oo machine
- 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.
+
+ 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.
+
+ 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.
+
+ 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.
+
+ 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.
+
+ The von Neumann machine layer is a relatively close abstraction of hardware.
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.
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
diff --git a/future_CNAME b/future_CNAME
index a3fda4e..9622c69 100644
--- a/future_CNAME
+++ b/future_CNAME
@@ -1 +1 @@
-ruby-in-ruby.org
+crystal-vm.org
diff --git a/ideas.html b/ideas.html
new file mode 100755
index 0000000..c80c8d2
--- /dev/null
+++ b/ideas.html
@@ -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, empower you
+---
+
+
+ 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. +
++ Why it has taken this long to even seriously attempt a ruby implementation in ruby is due to the overwhelming + influence of C (folks). +
++ Just a short and subjective list of why ruby is the better tool: +
+ Rails has evolved tremendously from what was already a good start. All the development around it has nurtured + ruby developement in all areas. Rails and all those parts make up the most mature and advanced software system + i know. +
+The "rails effect" is due to the accessibility of the system, imho. Ie it is written in ruby.
+Ruby itself has not enjoyed this rails effect, and that is because it is written in C (or c++)
+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 +
++ 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. +
++ 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. +
++ 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 static code is fast. +
++ 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. +
++ So now, are we ready to generate some bytes? even if they are Machine Code. And go to the Source? I say we are! +
+"Hey crystal, what do you want to be when you grow up". I like pink, i wanna be a ruby.
-Ruby in ruby hopes make the the mysterious more accessible, shed light in the farthest (ruby) corners, and above all, empower you
-Three ideas are behind it
-- 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.
- 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.
- Just a short and subjective list of why ruby is the better tool: -
+ 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. +
++ 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. +
++ 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. +
++ 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. +
++ 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. +
++ 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. +
++ 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.
- Rails has evolved tremendously from what was already a good start. All the development around it has nurtured - ruby developement in all areas. Rails and all those parts make up the most mature and advanced software system - i know. -
-The "rails effect" is due to the accessibility of the system, imho. Ie it is written in ruby.
-Ruby itself has not enjoyed this rails effect, and that is because it is written in C (or c++)
-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 -
-- 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 + into words well.
- 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.
- 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 static code is fast. + And so what we consider good programmers, are people who are good at playing computer in their head.
- 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.
- 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 +
++ 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.
+The heart of the ruby-in-ruby project is crystal, the virtual machine
The heart of the crystal-vm project is crystal, the virtual machine
Crystal is written in 100% ruby
Crystal uses an existing ruby to bootstrap itself
Crystal generates native code, and ( with 1+2) creates a native ruby virtual machine.