objective-9c
kiljoy001/objective-9c
Recent commits
- docs: link the live playground
README excerpt
# objective-9c objective-9c is a small 9front language that transpiles o9 source to Plan 9 C. **Try it live:** the [Objective-9c playground](https://halatha.rentonsoftworks.com) runs in your browser on [Halatha](https://github.com/kiljoy001/halatha), with nothing to install. o9 is built for Plan 9-style programs: objects are CSP actors, public methods can be served through a 9P facade, structured data moves as `.tab` text, programs can shape their own namespaces, and raw Plan 9 C interop is isolated inside spawnable `function` blocks. ## Status - Release: 0.4.0 ([CHANGELOG.md](CHANGELOG.md)). - Target: 9front. - Output: generated C; no binary blob. - Build: `mk` builds `o9c/o9c` and `libo9.a`. - Tests: native 9front e2e tests under `o9c/test/` and `stdlib/e2e_*.o9`. - Current focus: keeping the language small while growing useful stdlib objects and examples. ## Start Here If you want to write an application rather than work on the compiler, start with [docs/APP_DEVELOPER.md](docs/APP_DEVELOPER.md). It has copy-paste CLIs, 9P services, settings files, UI examples, and an index of the programs that already exist. The short version: application code does not need raw C or manual `spawn`/`await`. Start with `stdlib/cli.o9`, `stdlib/config.o9`, and `stdlib/service.o9`; text, logging, files, directories, processes, networking, synchronization, runes, and custom 9P helpers live beside them in [`stdlib/README.md`](stdlib/README.md). Small complete examples are [demo/hello_cli.o9](demo/hello_cli.o9) and [demo/hello_service.o9](demo/hello_service.o9). ## Native QuickJS [`libquickjs/`](libquickjs/README.md) is a native Plan 9 QuickJS embedding library for lib9p servers. It intentionally omits the APE `qjs` CLI and the `std`/`os` modules, exposes a small `p9js_new`/`p9js_eval` API, and supplies memory/stack/interrupt hooks. The native 6c build is verified on generated9 amd64 after the host-side `preprocess-native.py` bridge; `mk test` prints `1+1 = 2`. It is a library scaffold, not a browser runtime. ## Quick Build From the repository root on 9front: ```rc mk mk install o9c --version o9build source.o9 ``` `o9build` binds the installed stdlib into the source directory namespace, transpiles the `.o9` file, compiles the generated C, links `libo9.a`, and writes an executable next to the source. Use `o9c` directly only when debugging the compiler. The version printed by `o9c --version` (or `o9c -V`) is defined in `o9c/grammar.d/99-main.y` and updated when the compiler's public version changes. After installation, `o9c`, `o9build`, `o9plumb`, and `o9proj` are on the command path. Start a small project with: ```rc o9proj myapp cd myapp mk run ``` To make plumbing an `.o9` file start a build, run: ```rc o9plumb ``` That installs an `include` line in `$home/lib/plumbing` and reloads plumber when `/mnt/plumb/rules` is available. ## A Small Program ```o9 class Counter { int64 val; method Counter(int64 initial) { val = initial; } method void inc(int64 n) { val = val + n; } method int64 get() { return val; } } main { Counter c = new Counter(10); c.inc(5); print(c.get(), "\n"); } ``` ## Mounted Method Call An app that stays alive with `serve()` posts a 9P service under `/srv`. With no app name argument, the default is the last class name (`Counter` here). Use clone sessions for result-bearing calls: ```rc mount -c /srv/Counter /mnt/o9 sid=`{cat /mnt/o9/clone} echo 'method Counter.c get' > /mnt/o9/$sid/ctl cat /mnt/o9/$sid/data echo close > /mnt/o9/$sid/ctl ``` ## Docs - [Quickstart](docs/QUICKSTART.md) - build and run a first app on 9front. - [Language Guide](docs/LANGUAGE.md) - the canonical guide for writing o9. - [Examples](docs/EXAMPLES.md) - small complete programs. - [Standard Library](stdlib/README.md) - stdlib object reference. - [tabula](docs/TABULA.md) - `.tab` files as structured, inert data. - [Two-Machine Demo](demo/TWO_MACHINE_DEMO.md) -
objective-9c is a C-language repository (8 stars, last pushed 2026-11-30) that describes a small 9front language transpiling o9 source to Plan 9 C, currently at release 0.4.0 with output as generated C rather than a binary blob. The build system uses `mk` to produce `o9c/o9c` and `libo9.a`, and tests consist of native 9front e2e tests under `o9c/test/` and `stdlib/e2e_*.o9`. The most recent commit subject is "docs: link the live playground."
summary generated by a local model from public repository data model: Ternary-Bonsai-2-27B-PTQ1_0-mtp.gguf