https://github.com/a-boring-square/thorium
A statically-typed functional language compiling to Lisp-inspired bytecode, running on a custom VM.
https://github.com/a-boring-square/thorium
bytecode-compiler bytecode-virtual-machine functional-programming programming-language virtual-machine
Last synced: 2 months ago
JSON representation
A statically-typed functional language compiling to Lisp-inspired bytecode, running on a custom VM.
- Host: GitHub
- URL: https://github.com/a-boring-square/thorium
- Owner: A-Boring-Square
- Created: 2025-08-29T22:28:37.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-08-30T00:17:33.000Z (3 months ago)
- Last Synced: 2025-08-30T00:25:21.280Z (3 months ago)
- Topics: bytecode-compiler, bytecode-virtual-machine, functional-programming, programming-language, virtual-machine
- Language: Odin
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Thorium
Thorium is a statically-typed functional programming language that compiles to Lisp-inspired human-readable bytecode and runs on a custom VM called element90.
It is designed to be simple, inspectable, and educational, while still supporting advanced features like:
- Immutable and mutable variables (
@mut) - Lists and arrays
- Structs and first-class functions
- External functions and built-in standard library functions
- Debug metadata for runtime inspection
Distribution
Thorium ships as a ZIP file containing:
element90 # Thorium VM executable
thbc # Thorium Bytecode Compiler executable
core/ # Standard library modules
src/ # Source code for element90 and thbc
-
element90: runs compiled.thprgprograms. -
thbc: compiles.thsource code to.thb(human-readable bytecode) or.thprg(compiled program). -
core/: standard library modules for Thorium programs.
File Types
ExtensionDescription
.thThorium source code (human-editable)
.thbHuman-readable bytecode (intermediate representation)
.thprgCompiled program suitable for element90
Quick Start
- Write a Thorium program (
demo.th):@module demo
@use core.ioint numbers = [1 : 2 : 3 : 4 : 5]
function sum_list : nums int[] : int =
int total
total = 0
for n in nums do
total = total + n
ret totalio.print : sum_list : numbers
- Compile the program:
./thbc demo.thThis generates
demo.thb(inspectable bytecode) anddemo.thprg(compiled program). - Run the compiled program:
./element90 demo.thprg
Features
- Statically typed functional language
- First-class functions
- Structs
- Lists and
forloops - External functions for integration with other code
- Built-in debugging support
Use Cases
Thorium is ideal for:
- Learning how a programming language VM works
- Exploring functional programming concepts
- Building small educational projects with a minimal runtime
- Embedding the VM and program into freestanding executables for distribution