Skip to main content

o2_rs/
lib.rs

1// This file is part of o2.
2//
3// Copyright (c) 2026  René Coignard <contact@renecoignard.com>
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
18//! # O₂
19//!
20//! `o2` is a Rust port of the [ORCΛ](https://github.com/hundredrabbits/Orca)
21//! esoteric programming language and terminal livecoding environment.
22//!
23//! This library exposes the core engine of `o2`, allowing other developers to:
24//! - Run the grid simulation ([`core::app`], [`core::vm`]).
25//! - Send MIDI, OSC, and UDP output ([`core::io`]).
26//! - Map glyphs to MIDI note IDs ([`core::transpose`]).
27//! - Control tempo programmatically ([`editor::clock`]).
28//! - Issue commander text commands ([`editor::commander`]).
29//!
30//! # Architecture
31//!
32//! The pipeline flows as follows:
33//!
34//! ```text
35//! Grid cells (Vec<char>)
36//!     → core::vm::run()                    per operator per frame
37//!     → core::app::EditorState::operate()  full-frame tick
38//!     → core::io::MidiState::run()         flush MIDI / OSC / UDP
39//!     → ui::render::draw()                 render to terminal
40//! ```
41
42#![warn(missing_docs)]
43#![warn(missing_debug_implementations)]
44
45/// Grid simulation engine, MIDI I/O, and operator dispatch.
46pub mod core;
47
48/// Cursor, history, commander, clock, and input handling.
49pub mod editor;
50
51/// Terminal rendering and colour theme.
52pub mod ui;