diff --git a/README.md b/README.md index e723a95..14f2d43 100644 --- a/README.md +++ b/README.md @@ -4,29 +4,45 @@ This repository contains experimental implementations of the OuroLang programmin ## Building -A simple C++ interpreter is provided in `ouro_lang.cc`. You can build it using g++: +The recommended way to compile the project is via Zig: ```bash -g++ -std=c++23 ouro_lang.cc -o ouro_lang +zig build ``` -Then run the REPL: +This compiles the REPL and all supporting modules using C23/C++23 and links against LLVM. Run the modular demo with: ```bash -./ouro_lang +zig build mod-run ``` -A Zig build script is also included (`build.zig`) for environments with the Zig compiler installed. It compiles the C/C++ sources using modern standards and links against LLVM. Use it to build the entire project with: +Execute its unit tests using: ```bash -zig build +zig build mod-test ``` -The script also exposes tasks for running the module example and its unit tests. +If Zig is unavailable you can still build the simple interpreter directly: + +```bash +g++ -std=c++23 ouro_lang.cc -o ouro_lang +./ouro_lang +``` + +Legacy CMake files remain for compatibility and can be used instead of Zig: + +```bash +mkdir build && cd build +cmake .. +cmake --build . -- -j\$(nproc) +``` ## Repository Structure -The project includes a Zig-based build system, tests, container setup, and documentation. Invoke `zig build` to compile all targets. +The source tree contains C and C++ code alongside a `build.zig` script. +Zig's build system is used to compile the interpreter and modules. A +CMake configuration is kept in `cmake/` for environments that still +depend on it. ## Zig Build with Modules diff --git a/docs/architecture.md b/docs/architecture.md index efac82d..ac632ff 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -9,7 +9,6 @@ components. The current prototype focuses on: * a REPL front-end built on top of the interpreter so language features can be exercised interactively -Future iterations will replace the experimental pieces with a modular -pipeline written in modern C++23 with optional Zig build integration. -For details on the basic datatypes available, refer to the **Types** -section of `../OuroLang_Spec_2_0.md`. +The project is now driven by Zig's build system which compiles the +C and C++23 components. Future iterations will continue to evolve this +modular pipeline while keeping Zig at the centre of the build process. \ No newline at end of file diff --git a/docs/build_system.md b/docs/build_system.md index db8d54f..242e4b8 100644 --- a/docs/build_system.md +++ b/docs/build_system.md @@ -1,13 +1,13 @@ # Build System -The repository is built using Zig. Compile all artifacts with: +The repository uses Zig's build system by default. Simply run ```bash zig build ``` -The `build.zig` file also exposes custom steps for running the module -demo and its unit tests: +to compile the interpreter and supporting modules. Additional steps +are available for the module demo: ```bash zig build mod-run @@ -16,3 +16,12 @@ zig build mod-test No external dependencies are required; all modules are built from the checked-in sources. + +If Zig is unavailable, a CMake configuration remains: + +```bash +mkdir build && cd build +cmake .. +cmake --build . -- -j\$(nproc) +ctest --output-on-failure +``` diff --git a/docs/contrib.md b/docs/contrib.md index 1a0e2ce..5c46f9d 100644 --- a/docs/contrib.md +++ b/docs/contrib.md @@ -1,7 +1,8 @@ # Contributing We welcome pull requests that improve the interpreter, documentation or -build system. Please keep patches small and ensure `ctest` passes. +build system. Please keep patches small and ensure `zig build mod-test` +passes. Steps for new contributors: diff --git a/docs/testing.md b/docs/testing.md index 2c931d7..3765730 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -5,7 +5,7 @@ fuzzing harness. ### Unit tests -Run the module test suite with: +Run the small suite of module tests with Zig: ```bash zig build mod-test