Skip to content

About

HolyC to WebAssembly compiler and browser runtime. Write and run HolyC online with TempleOS-Web.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

128 Commits

Folders and files

Repository files navigation

HolyC-wasm — TempleOS font, sword and scales

HolyC-wasm

HolyC to WebAssembly. A compiler and runtime for running HolyC programs in browsers and Node.js.

Try the editor in TempleOS-Web →


Use the compiler

From a JavaScript module in this checkout:

import {compileHolyC} from "./src/compiler.js";
import {createHost} from "./src/runtime/host.js";

const {bytes}=compileHolyC('"Hello\n";',{lenient:false});
const host=createHost({ansi:false,onText:text=>process.stdout.write(text)});
const {instance}=await WebAssembly.instantiate(bytes,{env:host.env});
host.attach(instance);
instance.exports.__main();

Use lenient:false so unsupported symbols and calls produce errors. The older lenient mode can replace them with zeros.

Compiler and runtime reference


What it supports

The runtime supplies graphics, sound, keyboard input, memory and supported TempleOS APIs. Apps/HEMU supplies the WebAssembly host for HEMU's HolyC machine; HolyC-fmt uses it to run its HolyC formatter.

This is a compiler and compatibility runtime, not the TempleOS kernel. Native language behavior is checked against V5.03, but unsupported assembly, hardware and OS behavior remain. A successful compile alone does not establish compatibility.

Compatibility limits · Native oracle


Development
npm test
npm run test:strict

Runtime HolyC lives in Kernel/, Compiler/ and Adam/. Run npm run generate after editing it; npm test also checks that its generated browser module is current.

The tests compare WASM behavior with recorded TempleOS V5.03 results. Reproducing the native oracle also needs its documented QEMU and disk setup.

Full check list and evidence · ABI


Credits

TempleOS, HolyC, the sword-and-scales artwork and the 8×8 system font were created by Terry A. Davis. TempleOS is public domain. The banner uses its font and artwork.

About

HolyC to WebAssembly compiler and browser runtime. Write and run HolyC online with TempleOS-Web.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages