These are unedited blog posts from another era. Things were called by
different names, more things changed than not, some said plop.
Really just for the sentimental, or historians.
Me and ruby are moving on . . .
And the fruits are finally showing. You don't need benchmarks to know that ruby is getting faster and faster, it shows easily in app startup and anything you do really. So kudos to the team, i see the shopify people and Aaron are putting a lot of work in.
Sooooo, we bought an old hospital. Word of advice: don't buy an old hospital if you can avoid it (obviously we tried and failed). It is understandably taking all our energy to get the old into the shape of the new (ie a non-profit art center).
I had put off proper register allocation until now, and somehow the 100 commits it took verfies that i wasn't completely wrong. I think there are quite a few differences to the normal problem and solution, to warrant an explanation, so here it goes: How RubyX does Static Single Assignment and Register Allocation in a ruby compiler.
As rubyx will eventually need to parse and compile itself, i am very happy to report success on the first steps towards that goal. Also better design, benchmarks, and another conference are on the list.
As a recap, Parfait is that part of the core library that we need already during compilation. Ie the compil . . . .Read whole post
In short, class methods are working. Plus is some meta stuff that and gotchas that i will explain below. Also i was at presenting rubyx at the first international conference, and there are a couple of misc improvements.
Class methods came up when parsing Parfait. To create objects we usually use n . . . .Read whole post
Basic enumerator style blocks were not as bad as i though. Admittedly i thought they would be close to impossible, so compared to that a few hundred commits are really quite little.
To start with let me lay the ground. In ruby code, i see blocks used in basically two kind of ways. I call the first one . . . .Read whole post
Off course the architecture gives a good overview of the system as it is. But it does not explain how we got there. And sometimes knowing the journey makes it easier to understand where one is. So i shall try to highlight the four or five main
It was almost going to be working binaries and over 1000 tests. But i am coming more and more to the point where software is measured in number of tests, not lines of code.
It was shortly after t
. . . .Read whole post
After finishing the code, i updated all the docs too!
Doing anything for the first time is not so easy. I have taught enough by now to see
how central
guidance,
the experience of another, is to the process of learning.
I was so much thinking about Vm's in the
. . . .Read whole post
Now that i have had time to write some more code (250 commits last month), here is the good news:
A dynamic language like ruby really has at it’s heart the dynamic method resolution. Without that we’d be writing C++. Not much can be done in ruby without looking up methods.
Since i currently have no time to do actual work, i’ve been doing some research.
Reading about other implementations, especially transpiling ones. Opal, ruby to javascript, and jruby, ruby to java, or jvm instructions.
One needs to keep an open mind off course. “R . . . .Read whole post
While work on Mom (Minimal object machine) continues, i can see the futures a little clearer. Alas, for now the shortest route is best, so the future will have to wait. But here is what i’m thinking.
The architecture document outlines this in more detail, but in sho . . . .Read whole post
Method caching can be done at language level. Wow. But first some boring news:
The Virtual Object Oriented Language
Vool will not reflect some of ruby’s more advanced features, like splats or . . . .Read whole post
Going on holiday without a computer was great. Forcing me to recap and write things down on paper.
One of the main results was that the current layers are a bit mixed up and that will have to be fixed. But first, some of the properties in which i think of the different layers.
As i said in the last post, a step back and forward, possibly two, was taken and understanding grows again. Especially when i think that some way is the way, it always changes and i turn out to be at least partially wrong. The way of life, of imperfect intelligence, to strive for that perfection that is forever out of reach. Here’s the next ins . . . .Read whole post
I just read mri 2.4 “unifies” Fixnum and Integer. This, it turns out, is something quite different from what i though, mostly about which class names are returned. And that it is ok to have two implementations for the same class, Integer.
But even it wasn’t what i thought, it did spark an idea, and i hope a solution to a problem that i . . . .Read whole post
The previous name was from a time in ancient history, three years ago, in internet time over a decade (X years!). From when i thought i was going to build a virtual machine. It has been clear for a while that what i am really doing is building a compiler. A new thing need . . . .Read whole post
So, the plan, in short:
Writing Soml helped a lot to separate the levels, or phases of the ruby compilation process. Helped me that is, to plan the ruby compiler.
But off course i had not written the ruby compiler, i have only planned how the dynamic nature . . . .Read whole post
Ok, that was surprising: I just wrote a language in two months. Parser, compiler, working binaries and all.
Then i documented it , detailed the syntax and even did some benchmarking.
So, the good news: it it works. . . .Read whole post
It is the one thing i said i wasn’t going to do: Write a language. There are too many languages out there already, and just because i want to write a vm, doesn’t mean i want to add to the language jungle. But …
As it happens in life, which is why they say never to say neve . . . .Read whole post
It really is like Bret Victor says in his video: good programmers are the ones who play computer in their head well.
Why? Because you have to, to program. And off course that’s what i’m doing.
But when it got to debugging, it got a bit much. Using gdb for non C code, i . . . .Read whole post
After almost a year of rewrite: Hello World is back.
Working executables again
So much has changed in the last year it is almost impossible to recap. Still a little summary:
The whole layer of the . . . .Read whole post
Quite long ago i had already determined that return addresses and exceptional return addresses should be explicitly stored in the message.
It was also clear that Message would have to be a linked list. Just managing that list at run-time in Register Instructions (ie almost assembly) . . . .Read whole post
Since i got the ideas of Slots and the associated instruction Set, i have been wondering how that fits in with the code generation.
I moved the patched AST compiler methods to a Compiler, ok. But still what do all those compile methods return.
In ruby, everything is an expression. To recap “ . . . .Read whole post
As before the original start of the project, i was 6 weeks on holiday. The distance and lack of computer really helps.
So i printed most of the code and the book and went over it. And apart from abismal spelling i found especially one mistake.
I had been going at the thing from the angle of producing bin . . . .Read whole post
The register machine abstraction has been somewhat thin, and it is time to change that
When i started, i started from the assembler side, getting arm binaries working and off course learning the arm cpu instruction set in assembler memnonics.
Not having any experienc . . . .Read whole post
The time of introspection is coming to an end and i am finally producing executables again. (hurrah)
Even neither ruby blocks or exceptions are implemented i have figured out how to do it, which is sort of good news. I’ll see off course when the day comes, but a plan is made and it is . . . .Read whole post
While trying to figure out what i am coding i had to attack this storage format before i wanted to. The immediate need is for code dumps, that are concise but readable. I started with yaml but that just takes too many lines, so it’s too difficult to see what is going on.
I just finished it, it’s a sort of condensed yaml i call sof (sal . . . .Read whole post
It has been a bit of a journey, but now we have arrived: Salama is officially named.
Salama is a real word.
It is a word of my home-country Finland, a finnish word (double plus).
Salama means lightning (or flash), and that is fast (double dou . . . .Read whole post
In a picture, or when taking a picture, the frame is very important. It sets whatever is in the picture into context.
So it is a bit strange that having a frame had the same sort of effect for me in programming. I made the frame explicit, as an object, with functions and data, and immediately the whole message sending be . . . .Read whole post
I am not stuck. I know i’m not. Just because there is little visible progress doesn’t mean i’m stuck. It may just feel like it though.
But like little cogwheels in the clock, i can hear the background process ticking away and sometimes there is a gong.
What i wasn’t stuck with, is where to draw the layer for the vm.
I was just reading my ruby book, wondering about functions and blocks and the like, as one does when implementing a vm. Actually the topic i was struggling with was receivers, the pesty self, when i got the exception.
And while they say two steps forward, one step back, this goes the other way around.
It’s such a nice name, crystal. My first association is clarity, and that is exactly what i am trying to achieve.
But i’ve been struggling a bit to achieve any clarity on the topic of system boundary: where does OO stop. I mean i can’t very well define method lookup in ruby syntax, as that involves method lookups. But tail recursion is so . . . .Read whole post
Both “ends”, parsing and machine code, were relatively clear cut. Now it is into unknown territory.
I had ported the Kaleidoscope llvm tutorial language to ruby-llvm last year, so there were some ideas floating.
The idea of basic blocks, as the smallest unit of code without branches was pretty clear. Using those as jump targets wa . . . .Read whole post
Parsing is a difficult, the theory incomprehensible and older tools cryptic. At least for me.
And then i heard recursive is easy and used by even llvm. Formalised as peg parsing libraries exists, and in ruby they have dsl’s and are suddenly quite understandable.
Off the candidates i had first very positive experiences with treet . . . .Read whole post
Part of the reason why i even thought this was possible was because i had bumped into Metasm.
Metasm creates native code in 100% ruby. Either from Assembler or even C (partially). And for many cpu’s too. It also creates many binary formats, elf among them.
Still, i wanted something small that i could understand easily as it was . . . .Read whole post
Software engineers have clean brains, scrubbed into full c alignment through decades. A few rebels (klingons?) remain on embedded systems, but of those most strive towards posix compliancy too.
In other words, since all programming ultimately boils down to c, libc makes the bridge to the kernel/ma . . . .Read whole post
Well, it has been a good holiday, two months in Indonesia, Bali and diving Komodo. It brought clarity, and so i have to start a daunting task.
When i learned programming at University, they were still teaching Pascal. So when I got to choose c++ in my first bigger project that was a real step up. But even as i wrestled templates, it w . . . .Read whole post