Polymorph VM Instruction Set

Jakob Jenkov
Last update: 2022-06-26

The Polymorph VM instruction set specifies what instructions the Polymorph VM can execute. Since the design goals of Polymorph VM, and the Polymorph project in general, are somewhat different from many other projects out there, the Polymorph VM instruction set also ended up looking different than whatever else is out there. This text explains why.

Design Goals

This instruction set is designed specifically according to the following design goals:

  • Reduced instruction set
  • High expressiveness
  • Concise code
  • Compact binary representation

Reduced Instruction Set

The basic premise of Polymorph VM is, that the advanced parts of functionality it should be able to execute, are plugged in via plugin functions implemented in the same language the Polymorph VM is embedded into. So far, Polymorph VM only has a Java implementation, but that might change in the future. Because the advanced functionality is not implemented using Polymorph script, it is assumed that most scripts won't be that large. Because scripts won't be that large, the script language does not have to be as advanced as a language used to implement larger applications and systems.

High Expressiveness

Polymorph scripts are assumed to mostly contain configuration of or queries to existing applications, systems or platforms, plus a bit of orchestration. Perhaps a bit of extra orchestration is needed on top of the configuration or queries. Therefore, the Polymorph VM instruction set is designed to enable you to express configuration and query style constructs more easily than in other popular programming languages.

Concise Code

The reduced instruction set and high expressiveness is intended to be achieved using a concise script syntax. If the script syntax is not concise, people will get annoyed when writing scripts.

Compact Binary Representation

Polymorph scripts are imagined to often have to be transferred over a network, loaded from local disk storage and possibly cached in memory - before being executed. In all cases it is preferable that the binary representation of the Polymorph script language is compact - meaning it can be encoded using few bytes.

Jakob Jenkov

Featured Videos

Core Software Performance Optimization Principles

Thread Congestion in Java - Video Tutorial

Close TOC

All Trails

Trail TOC

Page TOC