|
|
||
|---|---|---|
| arch | ||
| emit | ||
| tools | ||
| .gitignore | ||
| LICENSE | ||
| README.org | ||
| ROADMAP.org | ||
| build | ||
| lexer.c | ||
| lexer.h | ||
| libc.c | ||
| libc.h | ||
| main.c | ||
| parser.c | ||
| parser.h | ||
README.org
TITLE: Undâr Programming Language
A permacomputing & 3D video game oriented language transpiler.
Getting Started
Requirements
Main
- C compiler that supports C89
Build
git clone https://git.alfrescocavern.com/zongor/undar-lang.git
cd undar-lang && ./build
Memory Management
memory is stack based only.
For a limited dynamic style you can create unbounded arrays which go on a pre-allocated memory pool.
dynamic allocations push pointers within a call frame. when a frame exits, the pointer is reset and the child copys its return value to the end of the parent, thus freeing memory deterministically.
values passed to functions must be explicitly returned to propagate. if a value is modified in a child function it will change the parents value, unless the size of the structure changes then it will copy the parents value and append it to its own frame with the modification. this allows for the low resource usage of a C but the convenience of a Java/Go without the garbage collection.
Core Types
| Type | Description |
|---|---|
byte |
Character/8 bit unsigned int |
u8 |
8 bit unsigned int |
i8 |
8 bit signed int |
u16 |
16 bit unsigned int |
i16 |
16 bit signed int |
u32 |
exactly 32-bit unsigned integer |
i32 |
exactly 32-bit signed integer |
int |
signed number |
nat |
unsigned number |
real |
Q16.16 fixed-point real number |
str |
fat pointer [length + data] string |
bool |
true/false |
primitive types like int, nat, real, etc. will always be safe to change in child frames.
complex types like str, plex or arrays will be references to their location in the memory pool
License
MIT-0
Inspirations
- Plan 9 / 9P - Unified I/O, Tunnels.
- Lisp - Live coding, REPL, introspection.
- Fortran - Array semantics.
- C / Zig - Portability, control, minimalism.
- Lua - Friendly syntax, portable, and minimal.
- Lox - The start of my programming language creation journey.
- Uxn - Major inspiration, espeically around the core VM.
- Dusk OS - A much better system for doing permacomputing.
- Dis VM - CISC VM structure
- Retro Systems - N64, PS1, Mac Classic, Windows 95 - UI esthetics