An ag(e)ing hacker, Luca Saiu's blog
2017-08-31 04:18 (last update: 2017-09-03 14:05) Luca Saiu

Introducing Jitter, an efficient language Virtual Machine generator

During the last few months of this long silence I’ve been busy working on a new project. Of course it is free software, and I plan to propose it soon as an official GNU project. I’m now releasing Jitter to the public, after presenting it for the first time at the 2017 GNU Hackers’ Meeting (http://www.gnu.org/ghm) in Germany last weekend.

The meeting, by the way, was awesome — thanks to the organizers John Darrington and Alex Sassmannshausen and to everybody who attended. I was good to see the old friends, and make some new ones as well.

The Jitter presentation

My talk, the first on Friday morning, had the very pompous title The art of the language VM, or Machine-generating virtual machine code, or Almost zero overhead with almost zero assembly, or My virtual machine is faster than yours.

This was supposed to be the official abstract:

Interpreters are ubiquitous, but even the best ones introduce considerable overhead.

While I was working at making GNU epsilon faster for bootstrapping and interactive use I wrote a fast direct-threaded engine. Disappointed by the modest speedup (4-6x) I read and re-read papers, combined my own ideas to what was already published and let the experiment get completely out of hand until it blossomed into a new project, much more general than epsilon.

The talk will show a succession of increasingly sophisticated approaches to accelerate language virtual machines, from switch dispatching to threaded code and beyond, including techniques to reduce overhead from dispatching and from accessing operands—be they stack slots, registers or literals; the final iteration of this refinement process could quite reasonably be called a JIT. I will give credit where credit is due: most of the techniques shown are already published, but at least one or two crucial bits are, as far as I can see, original.

My new virtual machine generator accepts as input a high-level instruction specification including C code, and generates a fast VM. The system is easy to port: very little assembly code is needed, and even that only serves to enable optional optimizations; VM specifications need to assembly at all. I plan to propose my VM generator, presented in public for the first time, as a new independent GNU project. Feedback is welcome.

The talk will be highly technical. It will assume familiarity with C and ideally at least some ability to read assembly. GForth will be used in a few examples, but familiarity with Forth will not be required.

In the end I decided to leave out the GForth demo, to not make the talk even longer — I would have shown code words with see, comparing them with similar disassembled VM instructions from the Uninspired example, which includes both register and stack primitives.

With or without showing GForth I remain deeply indebted to the people from that project, particularly Anton Ertl, from whose work I learned many of the ideas in Jitter. It was unfortunate that no GForth hackers were present at the meeting this year. I remember with pleasure meeting Bernd Paysan at a previous edition, who was particularly friendly to me. Guess there will be other occasions.

Downloads

Jitter’s git repository is currently private, but I’ve published a snapshot at http://ageinghacker.net/jitter.

The slides are available at http://ageinghacker.net/talks/jitter-slides--saiu--ghm2017--2017-08-25.pdf, very slightly expanded since the presentation and with a few corrections.

A video recording will be up soon, thanks to Christopher Dimech — and everybody should see his own GHM presentations as well, about the importance of applying the free software philosophy to scientific software and data.

— Luca Saiu, 2017-08-31 04:18 (last update: 2017-09-03 14:05)

Tags:
english, epsilon, forth, ghm, gnu, hacking, jitter, software-by-myself, talk

Next post Previous post

You might want to go to the main blog index (Atom feedfeeds for every post: Atom 1.0, RSS 2.0) or to my web site https://ageinghacker.net.

[my photo]
Luca Saiu

The opinions I express here are my own and do not necessarily reflect the beliefs or policies of my employer or for that matter of anyone else. In case you felt that the public statement of my thoughts threatened your warm sense of security and your emotional stability feel free to leave at any time.
The system does not support user comments and probably never will. Anyway you can contact me if you want to discuss some topic with me. I might update my posts if you provide interesting insights.

You might be interested in my web site https://ageinghacker.net.


Copyright © 2009, 2011-2014, 2017, 2018, 2021-2024 Luca Saiu
Verbatim copying and redistribution of this entire page are permitted in any medium without royalties, provided this notice is preserved.
This page was generated by
trivialblog. trivialblog is free software, available under the GNU GPL.
Tag icon copyright information is available in this file.