GNU Jitter
GNU Jitter is a software automatically generating a portable, very efficient language virtual machine with performance close to native code, starting from a relatively high-level specification provided by the user.
The VM state may include registers, stacks or a combination of both along with any runtime structure defined by user code; whenever possible the generator attempts to map such state data structures into hardware machine registers.
The specification contains some C code associated to every VM instruction; the generator takes care of combining such small blocks of C into a whole body of code with low—usually zero—dispatching and branching overhead.
The generated code includes a simple C API to dynamically emit and execute VM code, an optional self-contained driver program for running VM routines from text files, and development features such as disassembling and profiling. The Jitter runtime also features efficient support for conditional branching operations difficult to implement using just C such as value tag checking as required by dynamically typed languages, and arithmetic with overflow checking. VM code has access to procedure call and return operations, in most cases relying on efficient hardware mechanisms.
The generated C code is heavily conditionalised and can be configured to run using different dispatching techniques of varying sophistication; the most efficient dispatching techniques rely on some architecture-specific—but not VM-specific—assembly support provided by Jitter; every dispatching model but one also rely on GNU C extensions.
As a fallback case, in the interest of portability, one dispatching technique is provided, switch dispatching, requiring nothing more than standard C.
Configuration parameters are transparent with respect to the VM semantics and even the C API: a VM routine will always behave in the same way independently from the dispatching technique and other configuration parameters, the only observable difference being execution speed.
A new exact-pointer-finding garbage collector is in preparation. Garbage collection is compatible with Jittery VMs but optional; alternatives such as the Boehm-Demers-Weiser garbage collector are also supported.
Jitter is highly portable and a correct VM will exhibit the exact same behaviour on any platform featuring just a standard C compiler and library; however performance will be best using one of the supported architectures (currently: M68k, MIPS, PowerPC, RISC-V, SPARC, x86_64; second-tier: Aarch64, Alpha, ARM, S390x) on ELF systems with GCC. Of course Jitter is part of the GNU project and is mainly meant for use on the GNU system.
Table of contents
- Download
- Source repository
- Quick introduction
- Tutorials
- Documentation
- Occasional informal articles
- Mailing lists
- Online chat
- Getting involved
- Licensing
Download
Jitter has had no official release yet, but everybody is welcome to download a source snapshot from the git repository.
Source repository
The GNU Jitter sources are currently managed in a git repository hosted on the author's personal server, from which anybody can download a copy over HTTPS without authentication. Project members with write permission may request SSH access.
Quick introduction
Similarly to most other GNU projects, a source tarball for Jitter contains some machine-generated files, as a convenience for users who are interested in compiling the software but may not have advanced development tools available such as flex, Bison, Autoconf, Automake and the like. In the interest of portability and simplicity Jitter has no unusual compile-time or run-time dependencies.
Using a tarball
Since Jitter has had no official release yet we cannot yet provide a link to
an official source tarball; however source tarballs are trivial to
automatically generate for developers with access to a reasonably modern GNU
system.
We may consider publishing snapshot tarballs if sufficient interest arises.
At the present time the user will have to download a copy of the current sources from the git repository, as explained in the following section.
Downloading the sources from git and preparing the configuration system
The following command line suffices to download a snapshot:
git clone https://git.ageinghacker.net/jitter
After downloading a git snapshot please follow the instructions in README-hacking. This will involve a line such as
cd jitter && ./bootstrap
The bootstrap script serves to generate the files needed for configuring and building Jitter, including a configure script.
Compiling the sources
Jitter follows the GNU conventions for configuration and building and supports building out of the source directory; in fact it supports cross-compilation and even running the test suite in a cross build through an emulator.
Of course the simple default way of configuring and building is supported. The following will work from the source directory:
./configure && make
After this point, one may want to run
make check
In the case of make check, after the first build has succeeded and when building with GNU Make the user could invoke make check with -j8 or even dare -j on a sufficiently powerful machine. Please note that building the test suite programs in parallel has steep RAM requirements, at least in the order of gigabytes.
Exploring
At this point a user will find the included Jitter examples such as Structured and JitterLisp already compiled and usable in the build tree under bin/. All Jitter examples support a clean command-line interface including --help: along with the preliminary documentation they are a good starting point for exploring.
Tutorials
The resources below provide introductions to GNU Jitter.
- The awesome Mohammad-Reza Nabipoor presented a rather in-depth Jitter tutorial at GHM 2022 where Luca Saiu also gave a workshop based on the same basic idea, with many details simplified.
-
Luca Saiu presented Jitter in public for the first time at the 2017 edition
of the GNU Hackers' Meeting, in Germany;
the
GHM 2017 page
on
audio-video.gnu.org
contains, among the others, a video recording of his talk
“Jitter: my virtual machine is faster than yours”. The talk is
still relevant as of 2022 and works well as an introduction,
but be warned that as the project matures and gets richer more details
will change, drifting farther and farther away from the state of the
software at the time of the GHM.
- The GHM 2017 talk video (WebM, 3.4GB, 1 hour and 43 minutes) is available;
- you may want to download this slightly improved version of the GHM 2017 talk slides (PDF, 1MB).
-
The recording of an informal video presentation by Luca Saiu along with
some friends from the
GNU poke project from
March 2021 can be useful.
- A video recording ot the March 2021 Jitter talk (2 hours and 24 minutes) is available on The Internet Archive.
-
Luca Saiu's talk at the
Binary T00ls Summit 2022
“GNU Jitter and GCC: the fun of playing with fire”
is an ideal follow-up to his GHM 2017 presentation, focusing on the inner
workings of a Jittery VM used as a JIT, and on the complications hidden by
Jitter.
- You may want to download the BTS 2022 slides, slightly edited after the event (PDF, 600KB);
- A video recording is available. Thanks to José Marchesi for editing it.
-
An incomplete written tutorial on the author's personal web site should be
finished and merged into the rest of the documentation.
- An incomplete written tutorial about Jitter is available. It will be moved to this site when complete.
Documentation
The documentation for Jitter is, alas, not yet in a usable state and is therefore not published here at this time. Three manuals will exist:
- The GNU Jitter manual;
- the Structured manual;
- the JitterLisp manual.
Structured and JitterLisp are two complete examples of how Jitter can be used, each complex enough to deserve its own manual, and its own examples. Structured is easier and meant as a tutorial for beginners; its manual is still an empty stub. JitterLisp is more advanced and complex, but also has a more complete manual.
All the manuals, in their current state, are accessible from the Jitter repository and can be easily be compiled from their Texinfo source into any format among GNU Info, PDF, PostScript, DVI, HTML. For example executing the following line from the build directory will build all the manuals in PDF format, and show their location in the build tree:
make pdf && find -name '*pdf'
Every program distributed with Jitter also comes with a man page,
automatically generated from the program's output when called with
--help and --version.
Invoking each program from the source distribution—including the
examples—with such options is a good way to start exploring them.
Occasional informal articles
Luca Saiu's blog will
feature the occasional post
about Jitter, as
might the
Jitter project page
on
Savannah.
Such posts are also included in the
GNU Planet federation.
Mailing lists
Right now Jitter has no mailing list of its own, but discussions about Jitter are considered on-topic on the epsilon-devel mailing list: that includes Jitter development and enhancement requests, as well as bug reports and more. The list is public and anybody is welcome to subscribe, even without participating actively.
As per the GNU convention there exists a bug-jitter mail address on
the
gnu.org server; this address, however, is just an alias for the
list above and is not itself associated to a subscription web interface:
please use
the
epsilon-devel Mailman web interface
for subscribing.
Given the current low traffic on the list this arrangement seems practical.
Should the situation change in the future we could very easily add more
independent mailing lists specific to Jitter.
Announcements about Jitter and most other GNU software are made on the info-gnu mailing list (archives).
Security reports that should not be made immediately public can be sent directly to the maintainer. If there is no response to an urgent issue, you can escalate to the general security mailing list for advice.
Notice that Jitter's autor can also be contacted in private.
Online chat
The author is usually logged in as lucasaiu, on the Libera IRC network, in the ##jitter channel (double # sign).
IRC works well for quick discussions or questions where one expects quick turnaround when everybody involved is online at the same time. For every other case email communication is preferred.
Getting involved
Development of Jitter, and GNU in general, is a volunteer effort, and you can contribute. For information, please read How to help GNU. If you'd like to get involved, it's a good idea to join the discussion mailing list (see above).
Licensing
Jitter is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.