Pull to refresh

Forth *

Imperative stack-based computer programming language

0,24
Rating
Show first
Rating limit
Level of difficulty

The globally optimal, eighth, and fastest type of bytecode interpreters

Level of difficultyHard
Reading time14 min
Reach and readers1.5K

Совершать невозможное и раздавать пинки здравому смыслу — в этом и состоит жизнь членов Гуррен-Дана! (C) Камина

This article enters into a technical debate with a 2015 article by Atakua, whose approaches I am attacking. Atakua explores 7 types of bytecode interpreters, but does so disrespectfully - the fastest turns out to be binary translation, which is essentially no longer a bytecode interpreter, but a form of Ahead-Of-Time compiler. This binary translation translates bytecode into machine code, which is a chain of calls to compiled service routines. The very same ones that are responsible for executing each opcode in a bytecode interpreter.

But Atakua didn't squeeze all the possible speed out of bytecode interpreters. So this article is a tutorial: how to write a bytecode interpreter that can outperform JIT/AOT compilation in speed. Interested? Read on!

A benchmark is included. There will be a bit of hardcore and not a single AI-generated image!

Read more