Feb 23, 2024: Why Are My Bytecode Interpreters Slow? Hunting Truffles with VTune
As part of our work on the AST vs. Bytecode Interpreters paper, I briefly looked at how the native code of ahead-of-time-compiled bytecode loops looks like, but except for finding much more code than what I expected, I didn’t look too closely at what was going on.
Nov 8, 2022: How Effective are Classic Lookup Optimizations for Rails Apps?
We know that Ruby and especially Rails applications can be very dynamic and pretty large. Though, many of the optimizations interpreters and even just-in-time compilers use have been invented in the 1980s and 1990s before Ruby and Rails even existed. So, I was wondering: do these optimizations still have a chance of coping with the millions of lines of Ruby code that large Rails apps from Shopify, Stripe, or GitLab have? Unfortunately, we don’t have access to such applications. As the next best thing, we took the largest Ruby benchmarks we could get our hands on, and analyzed those.
Oct 10, 2022: The Cost of Safety in Java
Overhead of Null Checks, Array Bounds, and Class Cast Exceptions in GraalVM Native Image
Oct 6, 2022: Effortless Language Servers
Ever since my blog post in 2016, I have wanted a good language server for SOM and Newspeak. Though, I didn’t really have the time to implement more than a few features.
Jul 11, 2019: SOMns 0.7.0 Release with Extension Modules and Artifacts
It has been a while since we put together a release for SOMns. And it has been even longer, since I last wrote about it on this blog.
Apr 17, 2018: A Typical Truffle Specialization Pitfall
Writing specializations is generally pretty straight forward, but there is at least one common pitfall. When designing specializations, we need to remind ourselves that type-based specializations are technically guards.
Oct 15, 2017: Debugging Concurrency Is Hard, but We Can Do Something About It!
When we have to debug applications that use concurrency, perhaps written in Java, all we get from the debugger is a list of threads, perhaps some information about held locks, and the ability to step through each thread separately.
Sep 6, 2017: Building High-level Debuggers for Concurrent Languages with Truffle: The Missing Bits
Note: This post is meant for people familiar with Truffle. For introductory material, please see for instance this list.
Jul 5, 2017: A 10 Year Journey, Stop 5: Growing the SOM Family
Jun 6, 2017: A 10 Year Journey, Stop 4: Concurrency and Tooling
This post, the fourth in the series, is about my current work on concurrency and tooling. As mentioned before, I believe that there is not a single concurrency model that is suitable for all problems we might want to solve. Actually, I think, this can be stated even stronger: Not a single concurrency model is appropriate for a majority of the problems we want to solve.
May 14, 2017: A 10 Year Journey, Stop 3: Performance, Performance, and Metaprogramming
The third post of this series is about how I started using Truffle and Graal, pretty much 4 years ago. It might be in parts ranty, but I started using it when it was in a very early stage. So, things are a lot better today.
Mar 7, 2017: SOMns 0.2 Release with CSP, STM, Threads, and Fork/Join
Since SOMns is a pure research project, we aren’t usually doing releases for SOMns yet. However, we added many different concurrency abstractions since December and have plans for bigger changes. So, it seems like a good time to wrap up another step, and get it into a somewhat stable shape.
Jan 10, 2017: Communicating Sequential Processes for Newspeak/SOMns
One possible way for modeling concurrent systems is Tony Hoare’s classic approach of having isolated processes communicate via channels, which is called Communicating Sequential Processes (CSP). Today, we see the approach used for instance in Go and Clojure.
Oct 25, 2016: Cross-Language Compiler Benchmarking: Are We Fast Yet?
Research on programming languages is often more fun when we can use our own languages. However, for research on performance optimizations that can be a trap. In the end, we need to argue that what we did is comparable to state-of-the-art language implementations. Ideally, we are able to show that our own little language is not just a research toy, but that it is, at least performance-wise, competitive with for instance Java or JavaScript VMs.
Oct 22, 2016: Language Research with Truffle at the SPLASH'16 Conference
Next weekend starts one of the major conferences of the programming languages research community. The conference hosts many events including our Meta’16 workshop on Metaprogramming, SPLASH-I with research and industry talks, the Dynamic Languages Symposium, and the OOPSLA research track.
Aug 10, 2016: Can we get the IDE for free, too?
With the Truffle language implementation framework, we got a powerful foundation for implementing languages as simple interpreters. In combination with the Graal compiler, Truffle interpreters execute their programs as very efficient native code. Now that we got just-in-time compilation essentially “for free”, can we get IDE integration for our Truffle languages as well?
Apr 8, 2016: Adding Debugging Support to a Truffle Language
Beside the great performance after just-in-time compilation, the Truffle Language implementation framework provides a few other highly interesting features to language implementers. One of them is the instrumentation framework, which includes a REPL, profiler, and debugger.
Feb 4, 2016: Open PostDoc Position on Programming Technology for Complex Concurrent Systems
We, or more specifically our colleagues from the Software Languages Lab in Brussels are looking for a post-doctoral researcher to work on a collaborative research project with us.
Jan 25, 2016: Towards Meta-Level Engineering and Tooling for Complex Concurrent Systems
Last December, we got a research project proposal accepted for a collaboration between the Software Languages Lab in Brussels and the Institute for System Software here in Linz. Together, we will be working on tooling for complex concurrent systems. And with that I mean systems that use multiple concurrency models in combination to solve different problems, each with the appropriate abstraction. I have been working on these issues already for a while. Some pointers are available here in an earlier post: Why Is Concurrent Programming Hard? And What Can We Do about It?
Jan 12, 2016: Type Hierarchies and Guards in Truffle Languages
Continuing a little bit with writing notes on Truffle and Graal, this one is based on my observations in SOMns and changes to its message dispatch mechanism. Specifically, I refactored the main message dispatch chain in SOMns. As in Self and Newspeak, all interactions with objects are message sends. Thus, field access and method invocation is essentially the same. This means that message sending is a key to good performance.
Dec 8, 2015: Add Graal JIT Compilation to Your JVM Language in 5 Easy Steps, Step 5
Step 5: Optimizing the Interpreter for Compilation
Dec 1, 2015: Add Graal JIT Compilation to Your JVM Language in 5 Easy Steps, Step 4
Step 4: Complete Support for Mandelbrot
Nov 24, 2015: Add Graal JIT Compilation to Your JVM Language in 5 Easy Steps, Step 3
Step 3: Interpreting a Simple Fibonacci Function with Golo+Truffle
Nov 17, 2015: Add Graal JIT Compilation to Your JVM Language in 5 Easy Steps, Step 2
Step 2: Adding Bit Operations To Golo
Nov 10, 2015: Add Graal JIT Compilation to Your JVM Language in 5 Easy Steps, Step 1
Over the course of the next four weeks, I plan to publish a new post every Tuesday to give a detailed introduction on how to use the Graal compiler and the Truffle framework to build fast languages. And this is the very first post to setup this series. The next posts are going to provide a bit of background on Golo, the language we are experimenting with, then build up the basic interpreter for executing a simple Fibonacci and later a Mandelbrot computation. To round off the series, we will also discuss how to use one of the tools that come with Graal to optimize the performance of an interpreter. But for today, let’s start with the basics.
Oct 21, 2015: Optimizing Communicating Event-Loop Languages with Truffle
The past few month, I have been busy implementing a fast actor language for the JVM. The language is essentially Newspeak with a smaller class library and without proving access to the underlying platform, which can lead to violations of the language’s guarantees.
Oct 19, 2015: Tracing vs. Partial Evaluation: Comparing Meta-Compilation Approaches for Self-Optimizing Interpreters
Back in 2013 when looking for a way to show that my ideas on how to support concurrency in VMs are practical, I started to look into meta-compilation techniques. Truffle and RPython are the two most promising systems to build fast language implementations without having to implement a compiler on my own. While these two approaches have many similarities, from a conceptual perspective, they take two different approaches that can be seen as the opposite ends of a spectrum. So, I thought, it might be worthwhile to investigate them a little closer.
Apr 28, 2015: Zero-Overhead Metaprogramming
Runtime metaprogramming and reflection are slow. That’s a common wisdom. Unfortunately. Using refection for instance with Java’s reflection API, its dynamic proxies, Ruby’s #send or #method_missing, PHP’s magic methods such as __call, Python’s __getattr__, C#’s DynamicObjects, or really any metaprogramming abstraction in modern languages unfortunately comes at a price. The fewest language implementations optimize these operations. For instance, on Java’s HotSpot VM, reflective method invocation and dynamic proxies have an overhead of 6-7x compared to direct operations.
Jan 31, 2015: FOSDEM 2015: Building High-Performance Language Implementations With Low Effort
Today, I gave a talk on implementing languages based on the ideas behind RPython and Truffle at FOSDEM on the main track. Please find abstract and slides below.
Nov 19, 2014: SOM Performance Numbers
Today, I got a few more benchmarks running to get a better idea of where RTruffleSOM and TruffleSOM stand in terms of their absolute performance.
Sep 22, 2014: Are We There Yet? Simple Language-Implementation Techniques for the 21st Century
The first results of my experiments with self-optimizing interpreters was finally published in IEEE Software. It is a brief and very high-level comparison of the Truffle approach with a classic bytecode-based interpreter on top of RPython. If you aren’t familiar with either of these approaches, the article is hopefully a good starting point. The experiments described in it use SOM, a simple Smalltalk.