Crates.io | vtl-rs |
lib.rs | vtl-rs |
version | 0.0.3 |
source | src |
created_at | 2024-10-04 01:25:24.649543 |
updated_at | 2024-10-05 14:52:09.233629 |
description | Very Tiny Language (VTL) in Rust, inspired by the historical VTL-2 on Altair 680b and others. |
homepage | |
repository | https://codeberg.org/spezifisch/vtl-rs |
max_upload_size | |
id | 1395895 |
size | 375,762 |
vtl-rs is a Rust implementation of the Very Tiny Language (VTL-2), a simple, high-level language originally designed for the Altair microcomputers in the 1970s. This project aims to be a spiritual successor with simplicity and hackability in mind.
VTL-2, or Very Tiny Language, was a minimalist programming language developed to run on microcomputers like the Altair 680b, often with as little as 1-2 KB of memory. Despite its size, VTL-2 provided essential programming constructs, including:
+
, -
, *
, /
, %
)The current implementation of vtl-rs in Rust is an early-stage interpreter with several core features already working:
+
), subtraction (-
), multiplication (*
), division (/
), and modulo (%
).?
, and they will store intermediate results for use in further calculations.~/.vtl-rs_history
on Linux.Here's a simple example of using vtl-rs in its current state ("OK" lines skipped for clarity):
VTL> ?=2+2
4
VTL> ?="HELLO WORLD!"
HELLO WORLD!
VTL> ?=2+2
4
VTL> A=123
OK (123)
VTL> B=456
OK (456)
VTL> ?=A+B
579
VTL> ?=7/3
2
VTL> ?=%
1
You can easily build the REPL (a library build is possible, too!) on Linux/macOS/Windows or wherever Rust is running. You will need current Rust and Cargo installed, then:
# to run vtl-rs:
cargo run
# this will give you the REPL prompt shown in the example
# or
# to build vtl-rs:
cargo build
# the executable will be somewhere inside the target/ directory after that
For those interested in the history of VTL-2, or the original manuals and documents, here are some useful references: