Update readme
This commit is contained in:
parent
3453b0fcd6
commit
cf767b2401
102
README.org
102
README.org
|
@ -1,4 +1,4 @@
|
||||||
#+TITLE: The Reality Engine
|
#+TITLE: Undâr Programming Language
|
||||||
#+AUTHOR: Zongor
|
#+AUTHOR: Zongor
|
||||||
#+EMAIL: archive@undar-lang.org
|
#+EMAIL: archive@undar-lang.org
|
||||||
#+DATE: [2025-04-05]
|
#+DATE: [2025-04-05]
|
||||||
|
@ -15,33 +15,6 @@
|
||||||
· · · ᚾ]
|
· · · ᚾ]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
The =Reality Engine= is a register-based virtual machine designed to render not just graphics, but persistent, inspectable, reproducible computational worlds.
|
|
||||||
|
|
||||||
It is:
|
|
||||||
- Written in **C89** for maximum portability
|
|
||||||
- **No dynamic allocation** - memory is static, frame-managed, zero-initialized
|
|
||||||
- **Deterministic by design** - identical input -> identical output
|
|
||||||
- **Self-inspectable** - symbol table, memory, and state are always accessible
|
|
||||||
- Inspired by Uxn, Dis VM, Dusk OS, and Plan 9
|
|
||||||
|
|
||||||
**VM Architecture**
|
|
||||||
|
|
||||||
| Feature | Specification |
|
|
||||||
|--------------------+---------------------------------------------|
|
|
||||||
| Instruction Format | 1-byte opcode, 3-byte operand (CISC-like) |
|
|
||||||
| Register Set | 32 general-purpose registers (R0-R31) |
|
|
||||||
| Initialization | **ZII**: Zero Is Initialization |
|
|
||||||
| Memory Model | Frame-based arenas (function scope = frame) |
|
|
||||||
| Heap Behavior | Copy-on-write; allocations append to frame |
|
|
||||||
| Frame Exit | Pointer resets on return (stack-GC style) |
|
|
||||||
| Error Handling | Returns stub pointers to zeroed memory |
|
|
||||||
|
|
||||||
This ensures:
|
|
||||||
- No =malloc=, no =free=, no GC
|
|
||||||
- Predictable memory use
|
|
||||||
- Perfect reproducibility
|
|
||||||
- Safe failure modes
|
|
||||||
|
|
||||||
* Undâr
|
* Undâr
|
||||||
|
|
||||||
Undâr is a permacomputing oriented, statically-typed language with **first-class arrays**, **immediate-mode semantics**, and **symbolic clarity**
|
Undâr is a permacomputing oriented, statically-typed language with **first-class arrays**, **immediate-mode semantics**, and **symbolic clarity**
|
||||||
|
@ -53,18 +26,48 @@ Undâr is a permacomputing oriented, statically-typed language with **first-clas
|
||||||
|
|
||||||
It runs on the =Reality Engine=, a minimal C89 VM inspired by Uxn, Plan 9, and Forth - but built for =spatial software=, =deterministic execution=, and =software that lasts=.
|
It runs on the =Reality Engine=, a minimal C89 VM inspired by Uxn, Plan 9, and Forth - but built for =spatial software=, =deterministic execution=, and =software that lasts=.
|
||||||
|
|
||||||
Sċieppan is a minimal lisp inpsired by sectorlisp.
|
Sċieppan is a minimal macro assembler that uses s-expressions.
|
||||||
You can view some examples in the =.lisp= files in =/test=
|
You can view some examples in the =.lisp= files in =/test=
|
||||||
|
|
||||||
|
|
||||||
|
The =Reality Engine= is a register-based virtual machine designed to render not just graphics, but persistent, inspectable, reproducible computational worlds.
|
||||||
|
|
||||||
|
It is:
|
||||||
|
- Written in **C89** for maximum portability
|
||||||
|
- **No dynamic allocation** - memory is static, frame-managed, zero-initialized
|
||||||
|
- **Deterministic by design** - identical input -> identical output
|
||||||
|
- **Self-inspectable** - symbol table, memory, and state are always accessible
|
||||||
|
- Inspired by Uxn, Dis VM, Dusk OS, and Plan 9
|
||||||
|
|
||||||
|
**VM Architecture**
|
||||||
|
|
||||||
|
| Feature | Specification |
|
||||||
|
|--------------------+-----------------------------------------------|
|
||||||
|
| Instruction Format | 1-byte opcode, 3-variable operand (CISC-like) |
|
||||||
|
| Register Set | 32 general-purpose registers (R0-R31) |
|
||||||
|
| Initialization | **ZII**: Zero Is Initialization |
|
||||||
|
| Memory Model | Frame-based arenas (function scope = frame) |
|
||||||
|
| Heap Behavior | Copy-on-write; allocations append to frame |
|
||||||
|
| Frame Exit | Pointer resets on return (stack-GC style) |
|
||||||
|
| Error Handling | Returns stub pointers to zeroed memory |
|
||||||
|
|
||||||
|
This ensures:
|
||||||
|
- No =malloc=, no =free=, no GC
|
||||||
|
- Predictable memory use
|
||||||
|
- Perfect reproducibility
|
||||||
|
- Safe failure modes
|
||||||
|
|
||||||
**Core Types**
|
**Core Types**
|
||||||
|
|
||||||
| Type | Description |
|
| Type | Description |
|
||||||
|--------+-------------------------------------------|
|
|--------+-------------------------------------------|
|
||||||
| =int= | 32-bit signed integer |
|
| =int= | 32-bit signed integer |
|
||||||
| =nat= | 32-bit natural number |
|
| =nat= | 32-bit natural number |
|
||||||
| =real= | Float/Q16.16 fixed-point real number |
|
| =real= | Q16.16 fixed-point real number |
|
||||||
| =str= | 4-byte packed string or fat pointer |
|
| =str= | 4-byte packed string or fat pointer |
|
||||||
| =bool= | Compile-time flag |
|
| =bool= | Compile-time flag |
|
||||||
|
| =str= | String |
|
||||||
|
| =char= | Character |
|
||||||
| =ref= | Reference prefix for passing by reference |
|
| =ref= | Reference prefix for passing by reference |
|
||||||
|
|
||||||
**Array Semantics (Fortran-Style)**
|
**Array Semantics (Fortran-Style)**
|
||||||
|
@ -190,27 +193,30 @@ Tunnels make I/O **uniform, composable, and archival**.
|
||||||
**Build the Reality Engine**
|
**Build the Reality Engine**
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
git clone https://git.alfrescocavern.com/zongor/reality-engine.git
|
git clone https://git.alfrescocavern.com/zongor/undar-lang.git
|
||||||
cd reality-engine
|
cd undar-lang && make
|
||||||
make
|
|
||||||
./zre client.ul
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
**Sample Program: =hello.ul=**
|
**Sample Program: =hello.asm.lisp=**
|
||||||
|
|
||||||
#+BEGIN_SRC ul
|
#+BEGIN_SRC lisp
|
||||||
function main(int argc, str[] argv) {
|
((code
|
||||||
str name = argc > 1 ? argv[1] : "World";
|
(label main
|
||||||
print("Hello, {name}!");
|
(load $0 &terminal-str)
|
||||||
exits("Done");
|
(load $1 &hello-str)
|
||||||
}
|
(strlen $2 $1)
|
||||||
|
(syscall DEVICE_WRITE $0 $1 $2)
|
||||||
|
(load $3 &new-line)
|
||||||
|
(string-length $4 $3)
|
||||||
|
(syscall DEVICE-WRITE, $0, $3, $4)
|
||||||
|
(halt)))
|
||||||
|
(data
|
||||||
|
(label terminal-str "/dev/term/0")
|
||||||
|
(label new-line "\n")
|
||||||
|
(label hello-str "nuqneH 'u'?")))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Run it:
|
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
./zre hello.ul Alice
|
./build/linux/undar-linux-debug ./test/hello.asm.lisp
|
||||||
# Output: Hello, Alice!
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Example: 3D Client (=client.ul=)
|
* Example: 3D Client (=client.ul=)
|
||||||
|
@ -218,7 +224,7 @@ Run it:
|
||||||
#+BEGIN_SRC ul
|
#+BEGIN_SRC ul
|
||||||
use "common.ul";
|
use "common.ul";
|
||||||
|
|
||||||
function main(int argc, str[] argv) {
|
fn256 main(int argc, str[] argv) {
|
||||||
nat w = 800, h = 450;
|
nat w = 800, h = 450;
|
||||||
Player me(argv[1], [0.0, 1.0, 2.0], PURPLE);
|
Player me(argv[1], [0.0, 1.0, 2.0], PURPLE);
|
||||||
|
|
||||||
|
@ -263,7 +269,7 @@ function main(int argc, str[] argv) {
|
||||||
- Versioned plexes: forward/backward compatibility
|
- Versioned plexes: forward/backward compatibility
|
||||||
- Self-documenting syntax: just enough magic
|
- Self-documenting syntax: just enough magic
|
||||||
- Open standard: no vendor lock-in
|
- Open standard: no vendor lock-in
|
||||||
- Archive formats: =.ul=, =.ubin=, =.uatom=
|
- Archive formats: =.ul=, =.rom=
|
||||||
|
|
||||||
* License
|
* License
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue