update documentation

This commit is contained in:
zongor 2025-06-21 23:32:41 -04:00
parent d27d4259aa
commit 457c77b6ab
4 changed files with 4 additions and 11 deletions

View File

@ -51,14 +51,12 @@
* Technical Details
** VM Architecture
- Von Neumann style bytecode interpreter written in C89.
- register based bytecode interpreter written in C89.
- Portable to new systems, microcontrollers, and web via Emscripten.
** Memory Management
- Reference counting for globally scoped objects.
- =weak= keyword to avoid cyclical references.
- garbage collection as a system call (choose when to free memory)
- Arena allocators for short-lived, scoped memory (e.g., function-local objects).
** Rendering & I/O
- SDL2-based abstraction for input, audio, and rendering.

View File

@ -14,7 +14,7 @@ one large uint32 array
:PROPERTIES:
:CUSTOM-ID: types
:END:
real (fixed point numbers)| Q16.16 number
real (floating point number) f32
int (integer) i32
nat (unsigned integer) u32

View File

@ -52,9 +52,7 @@ type Vec3 {
:CUSTOM_ID: numeric
:END:
- =real=
- 32 bit Q16.16 fixed point by default.
- self casts to a 64 bit floating point (Double) by default for modern CPUs that have a FPU
for 3D math for performance reasons
- 32 bit floats
- =int=
- 32 bit integer
- =nat=

View File

@ -16,13 +16,10 @@
#include <emscripten.h>
#endif
uint32_t pc = 1; /* Program counter */
Code *code;
void mainloop() {
pc = step_vm(&code->current, code->memory);
if (pc == 0) {
if (!step_vm(&code->current, code->memory)) {
#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop(); /* this should "kill" the app. */
#else