Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
15 changes: 12 additions & 3 deletions docs/build_system.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
```
3 changes: 2 additions & 1 deletion docs/contrib.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading