Hacker News new | past | comments | ask | show | jobs | submit login
Sol — a sunny little homemade virtual machine (rsms.me)
277 points by whalesalad on Oct 15, 2012 | hide | past | favorite | 54 comments



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>


Also his article on building your own little programming language is equally awesome. Probably going to be my next project, thanks for giving some pointers!

/edit: link to blog post: http://rsms.me/2012/10/07/mylang-tutorial1.html


Wow - he is also the designer brains behind the Spotify brand, which has always been impressive to me.


And now at Facebook. The best designers also code but creating your own programming languages and VMs... respect.


Rasmus, since you're reading this thread, I'm curious. If I understand correctly, you did the Spotify brand and looks as it stands. My compliments! What, then, has convinced you to move to a large and very much designed-out webapp like Facebook? I mean, it's not like the Like button and the blue Facebook bar weren't there before you came - this suggests that you downgraded from setting up an entire brand to doing a page here and a button there. But I bet that's not the case, because in that case you wouldn't have gone, right? Note: this is not criticism, quite the contrary: I can't imagine what Facebook has competent designers to offer and I'd like to know. (I wondered the same when they acqui-hired the Amsterdam design consultancy Sofa)


Actually, we have some of the most talented designers I've ever met. Now, I'm working on things other than those you are bluntly describing. Most design work has been with special projects as well as our "native" apps. However, for the time being I've dedicated myself to software engineering around something I find very exciting. I probably said too much already.


It's interesting to hear you remark on your co-designers as, until now, I'd always assumed that the site was largely designed by it's developers. I know that would normally be unheard of for a portal the size of Facebook, but of all the sites I visit, I find Facebook to have the most confusing layout.

There's a weird mismatch of navigation features from hidden drop down lists, dialogue boxes and content that redirects to whole other pages; I'm never quite sure what onclick event will return what result. Plus the general layout of the site seems cluttered and counter-intuitive too.

Now this might just be me. I don't know what level of user testing Facebook performs before pushing features live, but I might be one of those small few who are just beyond help. However being a developer of similar age to yourself - I've spent my whole working life with badly designed developer tools and usually manage fine. Where as Facebook -a tool for the masses- seems to be one of the few exceptions that genuinely stumps me.

In many ways, that site's design is an "anti-rsms"; it seems to be the polar opposite of the design principles you adopt in your own projects (eg a clean methodical layout with clear separation between content and navigation tools). And while I'm discussing your own talents, I just was to commend you for what you've achieved despite choosing a non-traditional path into IT (ie straight to work rather than studying at Uni). Having trod a similar route as yourself, I know from experience that it can be significantly harder. So I can only imagine how much hard work and dedication you would have needed to be where you are now. Kudos.


Thanks for the heads-up anyway! :-)


Yes, you said too much already.

There was a "spotify" or music service thing leaked from facebook js code a while back. So what you are saying facebookers will integrate even more closely with spotify. Listen to music in the browser with friends? Yey.


Wow! He's aaaaaaaawesome!


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!!


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.


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).


Most designers can hardly FTP files to their server. Using the terminal is a terrifying idea. Writing code is a mountain of difficulty. I only know because I went through it myself.


Thanks.


As a developer very keen on honing my design skills, your work has been an inspiration. Thanks.


That really warms my heart. Thanks for letting me know I can be an inspiration.


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.


(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.


You are awesome!


Interesting that you mentioned Georgia Tech (BS '06, MS '09), as I was thinking that it's disappointing that no systems or compilers classes are required anymore.

The new Threads curriculum doesn't (or didn't when I last paid attention to it) require anything nearly this complicated. I have a friend who graduated under Threads without having taken CS2200 (Systems and Networks) or ECE2030 (Intro ECE). He's a talented computer scientist, but he's had to learn a lot of the bits of systems that are relevant to his day-to-day work on his own.

That said, I feel like this goes beyond anything that was ever strictly "required". The most complicated VM or language related work I had that was in a core class was Olin Shivers's[0] CS3240 (Languages and Computation). That concluded with us building a basic Scheme interpreter in Java. The other work I did on the subject was in specialization or elective classes (or grad school).

[0]: To folks who might happen to be at Northeastern, do take any class you can with Olin. He is a fantastic professor, and I can't recommend his classes enough. Favorite class I took at tech, hands down.


I'm not a fan of the threads program either. It is too easy to not learn any 'hardcore' CS with it. I took Devices and Information Internetworks. Doing some like Media and People (very popular for reasons to be mentioned), you didn't have to take CS2200, CS3251, or ECE2030/1. Granted I didn't take any compilers/VM classes, but I did take several low-level classes as I feel like it's hard to truly understand CS basics without understanding how a computer works from the base up. I think the switch to allowing easier tracks is to get more people interested, but at the cost of a degree which is not truly well rounded.


Really depends on your school. I went to a little podunk college (graduated in '02) with a tiny CS department and we did not do anything nearly this complex. You went to a top 10 CS school and did stuff like this. I don't have any real data but I imagine the situation is probably the same these days.


I'm a Canadian and we did something exactly like this as well for a junior level class.


What does being Canadian have to do with this? :P


There is no such thing as ivy league.


Where did you go? Because UofT, UBC, McGill, Waterloo, etc. are up there in the rankings with GATech.


Implementing a multithreaded VM was part of the semester task to pass Compilers (Warsaw University, 1996.) The VM was a bare bones instruction set plus threading support. The rest of the task was to implement a compiler for a concurrency-supporting language targetting the VM.

The most tedious part was implementing a garbage collector on top of the VM (GC was not part of the VM spec) We grumbled a lot about this task :)


From my personal experience no they aren't, although I would have loved to have gone somewhere where they were.


Amusing to see other gatech people here on here. I remember taking a systems class as well either 2nd or 3rd year (CS '03). Pretty much exactly what this is implemented all in C.

I talk to my other friends at CS schools and lately some of them don't nearly go into as much depth.


Another possibility is the non-CS crowd on HN might be bigger than is generally assumed. I'm an ECE undergrad, though the programme at my school skews to EE rather than CS. Our compilers course always felt like an afterthought, with implementation being entirely at the instructors discretion. We mostly just drew a bunch of state diagrams :-)


Funny, but no, not everywhere. I did a project like that, though, in my undergrad years, but it wasn't a assignment, just for fun.

Instead of doing something like this, they just made us memorize the x86 instructions and their nuances. I shudder every time I think about it.


I did not have to implement a virtual machine to get my degree at New Mexico Tech, but I did have to write a compiler with an x86 backend, and some Linux drivers. It depends on the school, but Georgia Tech is well known for a reason.


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/


I will definitely read this. Thanks.


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


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.


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.


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


I've been following this guy for a while. He did that editor a while back too. The polish on his stuff is excellent.

How does he have time for this stuff?

I would like to work on foundational projects too, but there are too many practical things that need go get done.

It is good to see that somebody has time for this.


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")


I didn't know that! Ha, ha.


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).


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


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



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


awesome. thanks.


I was thinking the same thing, I think it's a whiteboard.


This is like Minix, but for VM ! :)


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.


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


Love the creativity!


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: