Download Latest Version libC1316-0.0.137-20261020.zip (32.0 kB) Google Add to Preferred Sources
Home / implementations
Name Modified Size InfoDownloads / Week
Parent folder
framework-4.8 < 4 hours ago
Totals: 1 Item   0

C13136 Virtual Machine

C13136 is a compact serializable stack-based virtual machine designed as the execution engine, Cencio is its standard runtime.

The project aims to provide a simple, expressive and extensible runtime environment capable of supporting multiple programming paradigms while remaining easy to understand, experiment with and evolve.

Cencio vs C13136

Although closely related, Cencio and C13136 are distinct projects.

Cencio

Cencio is the standard serializable runtime.

It defines the high level functions made availabale for a quickly prototype new programming languages.

C13136

C13136 is the domain specific virtual processor.

It executes bytecode generated by the compilers and provides:

  • snapshot capabilities
  • operand stack management
  • runtime frames and scopes
  • function invocation
  • closures
  • static and bounded dynamic binding
  • branching and iteration
  • multiple return values
  • object interoperability
  • suspend and resume

Design Goals

The project is guided by a few simple principles:

Simplicity

The instruction set remains intentionally compact and easy to understand.

Expressiveness

Despite its small size, the VM is designed to support a wide range of language features including:

  • procedural programming
  • imperative programming
  • functional programming
  • first-class functions
  • closures
  • object-oriented programming

Extensibility

The architecture is intentionally open to future evolution without breaking existing bytecode.

Serialization

The VM allows for the creation of easily serializable snapshots when using Cencio's libraries and avoiding closures.

Educational Value

The VM is designed not only as a runtime system but also as a learning and experimentation platform for:

  • language design
  • compiler construction
  • bytecode execution
  • runtime environments
  • closure implementation
  • scope resolution strategies
  • serialization implementation

Current Capabilities

The virtual machine currently supports:

  • stack-based execution
  • nested scopes
  • local and global variables
  • function calls
  • closures
  • static binding
  • bounded dynamic binding
  • loops and branching
  • multiple return values
  • frame pooling
  • constant pool management
  • snapshot

Documentation

Detailed information about the architecture, instruction set and language semantics is available in the accompanying manuals and technical documentation contained in this repository.

Status

The project is still alpha. C13136 is an actively evolving experimental project focused on exploring virtual machine architecture and modern language runtime techniques while maintaining a compact and approachable design.

Changelog

2026-10-20 (0.0.137)

This is a breaking change. No more AEQ, ANE, added HLT again. BRU rolled back to only support 0, 1, 2 as argument. Improved the public API, tested the suspend/resume feature. Added support for data type 15 (byte arrays). Strings are expected do be passed as UTF-8 byte arrays, for now base64 encoded. Tested closures in while loops and they work. Return values greater than 127 create a snapshot. Managed to suspend the VM from different threads.

2026-10-12 (0.0.130)

This is a breaking change. I experimented with using specific instructions for mathematical operations, achieving a 10% performance boost; however, this fell outside current objectives, so I rolled back the changes. The FPU was removed from the core; internally, the CPU uses int32 for boolean values. Work was done to minimize runtime allocations. Added the ability to take snapshots via BRL 4. Removed the HTL instruction and replaced it with BRL 3. Added AEQ and ANE for reference comparisons.

2026-09-28 (0.0.109)

Fixed a bug in Capture. We are near a beta. No more hidden variables; every frame holds a tiny Vec(2) and functions directly use that one (for VRY and RET opcodes). FramePool recoded, and tested, going on with the test suite and review. Fixed a serious bug in Frame, removed unused code in in Vec.

2026-09-24 (0.0.105)

This is a breaking change. Many core parts have been rewritten, now we have our own dictionary<int,object>; Slice now is called Vec. Finally added a way to manage closures and static bindings; the old CAL opcode has been renamed JSR. I have added two more opcodes: CLS/CAL for creating and invoking closures. Added a frame pool in order to reduce runtime allocations. This is a quite big release and rewrite and I need to test it carefully. Added a way to die gracefully without a stack trace. Added a way to pass command line arguments. SMR 0 now clears the MR register. Performance improvements.

2026-09-07 (0.0.90)

This is a breaking change. SMR 0 now returns an array, no more a list.

2026-09-01 (0.0.89)

This is a breaking change. Adapted the code for being called by my fantasy console prototype. Managed more data types: single, short, byte.

2026-08-18 (0.0.83)

First documented version

Source: README.md, updated 2026-10-20