1
0
Fork 0
A statically-typed permacomputing-oriented language for the purpose of creating 1st generation style 3D games and graphical user interfaces that work on constrained systems, microcontrollers, retro consoles, and the web using emscripten.
Go to file
zongor 3e46c04513 add more examples 2025-07-13 00:12:27 -04:00
docs throwing away a bunch of stuff, lets do the whole compiler inside the VM 2025-07-08 21:59:56 -04:00
src add more examples 2025-07-13 00:12:27 -04:00
test add more examples 2025-07-13 00:12:27 -04:00
.gitignore begin breaking up into modules, add wasm 2025-06-11 22:41:49 -04:00
LICENSE change back to MIT since using some stuff from craftingintepreters 2025-06-15 15:54:49 -04:00
README.org update documentation 2025-07-05 23:51:12 -04:00

README.org

Zongor's Reality Engine

Overview

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

Key Features

Core Philosophy

  • Simple, portable, lightweight
  • Targets permacomputing, game world preservation, rapid prototyping, and indie games.
  • No macros or object hierarchies—prioritizes clarity and explicit behavior.
  • C/Zig like syntax. Lisp/Lua like development workflow.

Engine & Tooling

  • Integrated 2D/3D rendering system:

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

    • 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

  • Strongly typed but with a friendly 'let' syntax.
  • real type (f32).
  • int for integer numbers (i32).
  • nat for unsigned integer numbers (u32).
  • byte arrays for interop (u8, i64, etc.).
  • str Strings with interpolation, split, replace, trim, etc.
  • Error handling:

    • try-catch
    • Null coalescing (??) and null checks (?.).
  • Fortran style array operations.
  • Lightweight coroutines with event-loop-driven multitasking.
  • FFI via C-defined "system calls" (examples provided in VM).

Modularity & Ecosystem

  • Fortran-like arrays.
  • Standard library: math, networking, 3D rendering, minimal GUI.
  • use keyword for modular code organization via file-based namespaces.

Technical Details

VM Architecture

  • register based bytecode interpreter written in C89.
  • Portable to new systems, microcontrollers, and web via Emscripten.

Memory Management

  • Frame scoped arena allocators

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.
  • Fixed point for numbers for microcontrollers/retro computers without fpu
  • Custom renderer without SDL for portability

Motivation

ZRE 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).