Hybrix is an open source programming language created in 2025 by Pete Gonzalez.
| #1508on PLDB | 1Years Old |
The programming language of Hybrix, a virtual computer with a 32-bit CPU called Chombit. It is small, imperative, statically typed, and garbage-collected, with classes and inheritance. Its design goal is that a programmer can understand any program all the way down to the machine: each variable has a fixed address for its lifetime, and every instruction has a documented cycle cost.
module main
func start()
# Minimal initialization of the Hybrix framework console
console::init(io::tilemap_a)
var font_layer: tile_layer
font_layer <- new tile_layer(io::tilemap_a, io::tileset_a_addresses)
font_layer.load_tileset(art::fonts[0])
var i: int
i <- 1
loop
# Print the number
console::print_int(i)
# Print a special "newline" character, starting a new line
console::print("{n}")
# When i reaches 10, drop out of the loop
if i = 10
do drop
i <- i + 1
end loop
end func
end moduleThe garbage collector is less than 260 CPU instructions of hand-coded Chombit assembly.and as at base bool break byte byte_to_signed chombit class_id class const constructor data do drop else elsif end extends false float func get hook if infinity inset int intrinsic is lift located loop module nan new not null of or out pair pair_to_unsigned repeat return self set size then to_address to_byte to_int to_pair trio true type unsafe var view| Feature | Supported | Example | Token |
|---|---|---|---|
| Breakpoints | ✓ | ||
| Garbage Collection | ✓ | node <- new queue_node(item) | |
| Generics | ✓ |
class list |
|
| Virtual function | ✓ | new hook get_name(): string return "shape" end hook | |
| Constructors | ✓ | constructor(item: string) .item <- item .next <- null end constructor | |
| Inheritance | ✓ | class circle extends shape var radius: int end class | |
| Classes | ✓ | class shape var x: int var y: int end class | |
| Conditionals | ✓ | if squared_distance < main::get_squared(r1 + r2) then touching <- true else touching <- false end if | |
| Module Pattern | ✓ | module rectangle func get_area(width: int, height: int): int return width * height end func end module | |
| Functions | ✓ | func get_area(width: int, height: int): int var area: int area <- width * height return area end func | |
| Type Aliases | ✓ | type inches is int | |
| Static Typing | ✓ | func get_area(width: int, height: int): int | |
| Assignment | ✓ | area <- width * height | <- |
| Null | ✓ | .next <- null | |
| Booleans | ✓ | var touching: bool touching <- true | |
| Hexadecimals | ✓ | $12ab_34de | |
| Integers | ✓ | var area: int | |
| hasEscapeCharacters | ✓ | "This {quote}word{quote} is in quotes" | |
| Strings | ✓ | "Hello, world!" | " |
| Line Comments | ✓ | # A comment | # |
| Comments | ✓ | # A comment |