
Sol — a sunny little homemade virtual machine - whalesalad
http://rsms.me/2012/10/14/sol-a-sunny-little-virtual-machine.html
======
simplekoala
I didn't realize the author is a designer till I went to his about me page.
Pretty awesome that he can write some serious code. Respect.

<edits to correct grammar>

~~~
skrebbel
Wtf? Sure, making a decent VM that can actually do something is no empty feat,
but that just means that he's not only a designer but also a programmer. It's
not like you're stamped "designer" on your forehead at birth and that's it,
you know.

I have a friend who can code and bake excellent pie. _Amazing!!_

~~~
Raphael_Amiard
Being good at two things is more impressive than being good at one thing.
Making a full featured VM is something that even lot of professionnal
programmers can't do. The implication that you are "stamped" something at your
birth was totally absent of GP's post.

~~~
makomk
Yeah. Also, I reckon there are some actual production VMs less well designed
than this one (for instance, the one Second Life uses for scripting).

------
ojiikun
Serious (non-snarky) question: are projects like this no longer standard fare
for undergraduate CS majors? This example is rather comprehensive and well-
documented, but is almost spot on what all 50-75 of us had to do for a Junior-
level class at Georgia Tech back in 2003 or so.

~~~
rasmusfabbe
(Not taken as snarky) I would believe so. I never went to school, but started
working when I was in 8th grade. Didn't even learn algebra or any advanced
math beyond multiplication, which I have since regret at several occasions.
I'm surrounded by amazingly talented computer scientists all day long and we
thrive on each others' knowledge. For instance, a mathematician friend of mine
once gave me the book "Fermat's Last Theorem" (ISBN 1841157910) which sparked
an interest in math, and more so the function that the language of math plays
in logic. I would only assume something like this Sol project of mine would be
a very good fit in any CS education.

~~~
jarel
You are awesome!

------
flashingpumpkin
I think it's also worth linking to David Beazley's Curious Course on
Coroutines and Concurrency [1]. It's exploring the ideas of a task scheduler
implemented in Python. This article reminded me of it. It's not a full VM, but
about half way into the PDF he goes into quite some detail on how to build a
task scheduler modelled after an OS and how it works in an actual OS. Give it
a read.

[1] <http://www.dabeaz.com/coroutines/>

~~~
rasmusfabbe
I will definitely read this. Thanks.

------
s_tec
This warms my heart; It's wonderful to see people doing crazy stuff like this
for fun.

~~~
tarabukka
I wouldn't call the concept itself too far-fetched. As a learning or teaching
exercise, though, building virtual machines, languages, JIT compilers and the
like is very interesting. I'm assuming that "Sol" is a play on "Lua", because
both virtual machines seem similar.

~~~
rasmusfabbe
A play at Lua: Definitely so. As mentioned and referenced in the article, Lua
has been a major source of inspiration. As "lua" means "moon" in Portugese, it
was only suiting to name "Sol" "sol" for "sun" in Swedish (my native tongue).
However, as @chubot informed me (in a comment here on HN), Lua was once called
"sol", or at least "sol" was considered for the name.

~~~
lucian1900
"Sol" is also "sun" in Portuguese, so even better :)

------
chubot
This is cool, especially the coroutines. BTW the predecessor to Lua was called
"Sol" -- moon and sun in Spanish/Portuguese.

(It was described in one of the Lua papers, but Google for "lua language
predecessor sol")

~~~
rasmusfabbe
I didn't know that! Ha, ha.

------
daurnimator
Bad choice of name >.<

SOL (meaning Sun in Portuguese) was a VM built a PUC-Rio. It was the
predecessor to Lua (meaning Moon in Portuguese).

~~~
andrewcooke
yeah - it's a neat project, but my first reaction, too, was to look for a link
to lua.

------
brianjolney
Somewhat offtopic - I really liked the digitized whiteboard looking drawings.
Is that off a tablet, or a photographed whiteboard?

~~~
rasmusfabbe
I drew those on my iPad using the Paper app. Highly recommended together with
a stylus pen.

~~~
brianjolney
awesome. thanks.

------
vhf
This is like Minix, but for VM ! :)

~~~
rasmusfabbe
I compiled my own minix back in the days and ran it on an AST Bravo laptop
(monochrome display and very sparse resources.) Fun times, ha ha.

------
kiallmacinnes
Very interesting - handlebars.js's internals suddenly makes so much more
sense!

------
donteatbark
Love the creativity!

------
webmonkeyuk
Is it just me that read "Bum queue" instead of "Run queue" in the first
diagram

