A VM which is intended for the creation and preservation of 3D worlds
Go to file
zongor f4cf1a457a update readme, spec, example 2025-05-24 23:27:01 -04:00
docs update readme, spec, example 2025-05-24 23:27:01 -04:00
src start from scratch with own code 2025-05-11 18:54:31 -04:00
test start from scratch with own code 2025-05-11 18:54:31 -04:00
.gitignore add initial compiler, add tests 2025-05-03 21:07:19 -04:00
LICENSE Initial commit 2023-02-04 19:47:41 -05:00
README.org update readme, spec, example 2025-05-24 23:27:01 -04:00

README.org

Zongor's Universe Machine

Overview

ZTL is a lightweight, portable programming language for permacomputing, game preservation, and indie game development. Built in C99 for cross-platform compatibility (desktop, microcontrollers, and web via Emscripten). Designed for simplicity, performance, and creative exploration. It is inspired by uxn, Dusk OS, Lua, Lisp, C, and Zig.

Key Features

Core Philosophy

  • Simple, portable, lightweight syntax inspired by C.
  • Targets permacomputing, game world preservation, rapid prototyping, and indie games.
  • No macros or object hierarchies—prioritizes clarity and explicit behavior.

Engine & Tooling

  • Integrated 2D/3D rendering system:

    • Immediate-mode canvas-based 3D rendering with low-poly 5th6th gen console aesthetics.
    • 2D overlays styled after ImGui.
    • SDL2 backend for input, audio, and cross-platform compatibility.
  • Tree-walk interpreter + stack-based bytecode VM:

    • Compile bytecode to files for performance.
    • REPL with hot-code reloading for rapid iteration.
  • Emacs major mode included; Vim, VSCode, and Lite XL support planned.

Language Design

  • Dynamically typed with optional type hints in function signatures.
  • Unified real type (f64 by default) with byte for interop (u8, i32, f32, etc.).
  • 3D math primitives: vec, mat, quat, and more.
  • Strings with interpolation, split, replace, trim, etc.
  • Error handling:

    • Go-style explicit errors.
    • Null coalescing (??) and null checks (?.).
  • Lightweight coroutines with event-loop-driven multitasking.
  • FFI via C-defined "native functions" (examples provided in VM).

Modularity & Ecosystem

  • Unified table type (like Lua) for lists, maps, and tuples.
  • Standard library: math, networking, 3D rendering, minimal GUI.
  • use keyword for modular code organization via file-based namespaces.

Technical Details

VM Architecture

  • Stack-based bytecode interpreter written in C99.
  • Portable to new systems, microcontrollers, and web via Emscripten.

Memory Management

  • Reference counting for globally scoped objects.
  • weak keyword to avoid cyclical references.
  • Arena allocators for short-lived, scoped memory (e.g., function-local objects).

Rendering & I/O

  • SDL2-based abstraction for input, audio, and rendering.
  • Immediate-mode 3D canvas with 2D overlay support.

Planned Projects

  1. Code Editor with Terminal Emulator

    • Built-in development tooling.
  2. 3D Chat Room

    • Multiplayer cube avatars navigating a shared low-poly world.

Community & Collaboration

Roadmap

  • MVP: Core VM, REPL, and SDL2 integration.
  • 3D rendering pipeline + ImGui-style GUI.
  • Standard library and FFI examples.
  • Emacs/Vim tooling + website launch.

Motivation

ztl bridges retro-inspired creativity with modern portability for:

  • Game jams (rapid prototyping + 3D engine).
  • Indie games (5th/6th-gen aesthetics).
  • Permacomputing (low-resource, sustainable code).
  • Education (simple VM/language design).

Contributing

Contributions welcome! Join the community or submit PRs on GitHub/GitLab/yourrepo.