# Programming Languages Used in OpenLogi: Inside the Rust-Centric Codebase

> Explore OpenLogi's codebase, primarily written in Rust. Discover the roles of TOML, Shell, and Objective-C in its development and packaging.

- Repository: [Xuan Zhang/OpenLogi](https://github.com/AprilNEA/OpenLogi)
- Tags: internals
- Published: 2026-08-28

---

**OpenLogi is predominantly implemented in Rust, with TOML managing build configuration, Shell scripts handling Linux packaging, and Objective-C FFI bindings enabling macOS platform integration.**

OpenLogi, developed in the AprilNEA/OpenLogi repository, is a system-level input automation platform built with memory safety as a core architectural principle. Understanding the programming languages used in OpenLogi reveals a strategic emphasis on Rust for runtime performance, supported by domain-specific languages for build tooling and native platform bridging.

## Primary Language: Rust

The AprilNEA/OpenLogi source code is overwhelmingly Rust-centric. All core functionality—including device I/O, the GUI client, the background agent, and the IPC protocol—is implemented in Rust source files.

The central library resides in [`crates/openlogi-core/src/lib.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-core/src/lib.rs), exposing the public `OpenLogi` API and `Config` structures. The background agent initializes at [`crates/openlogi-agent/src/main.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-agent/src/main.rs), while the desktop GUI application launches from [`crates/openlogi-desktop/src/main.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-desktop/src/main.rs). This consistent use of Rust ensures thread safety and zero-cost abstractions for system-level operations like input monitoring and asset handling.

```rust
use openlogi_core::{OpenLogi, Config};

fn main() -> anyhow::Result<()> {
    // Load the default configuration from a TOML file
    let config = Config::load_from_path("config/example.toml")?;
    // Initialise the OpenLogi runtime
    let mut openlogi = OpenLogi::new(config)?;
    // Run the event loop (blocks until the user quits)
    openlogi.run()
}

```

## Configuration and Build Systems: TOML

While Rust implements the logic, **TOML** handles declarative configuration. The workspace manifest at [`Cargo.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/Cargo.toml) defines all crate members and external dependencies, while [`rust-toolchain.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/rust-toolchain.toml) pins the specific Rust compiler version required for reproducible builds. Cargo, Rust's package manager, consumes these files to orchestrate compilation and dependency resolution across the workspace.

## Auxiliary Languages for Platform Integration

### Shell Scripts for Packaging

The repository utilizes **Bash** for Linux distribution packaging and installation automation. The [`packaging/linux/install.sh`](https://github.com/AprilNEA/OpenLogi/blob/main/packaging/linux/install.sh) script installs compiled binaries to `/usr/local/bin` and registers desktop entries, while [`packaging/linux/uninstall.sh`](https://github.com/AprilNEA/OpenLogi/blob/main/packaging/linux/uninstall.sh) provides cleanup functionality. These scripts handle platform-specific deployment logic outside the Rust build process.

```bash
#!/usr/bin/env bash
set -euo pipefail

# Install the compiled binary into /usr/local/bin

install -Dm755 target/release/openlogi /usr/local/bin/openlogi

# Install the desktop entry

install -Dm644 assets/openlogi.desktop /usr/share/applications/openlogi.desktop

```

### Objective-C via FFI for macOS

For macOS-specific functionality—particularly input monitoring and permission handling—OpenLogi interfaces with native APIs through **Foreign Function Interface (FFI)** bindings. While the bridging logic resides in Rust files such as `crates/openlogi-hook/src/macos/*.rs`, these modules call into Objective-C APIs as documented in [`.claude/rules/objc-ffi.md`](https://github.com/AprilNEA/OpenLogi/blob/main/.claude/rules/objc-ffi.md). This architecture allows the Rust codebase to invoke macOS system functions that require Objective-C runtime access without maintaining separate Objective-C source modules.

### C Libraries via Windows Crate

On Windows platforms, the HID transport layer leverages the `windows` crate, which provides Rust bindings to native **C** APIs. Although no pure C source files exist in the repository, the build links against system C libraries for hardware abstraction. This indirect dependency enables low-level HID device communication while preserving Rust's memory safety guarantees.

## Summary

- **Rust** is the sole implementation language for core functionality, with entry points at [`crates/openlogi-core/src/lib.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-core/src/lib.rs), [`crates/openlogi-agent/src/main.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-agent/src/main.rs), and [`crates/openlogi-desktop/src/main.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-desktop/src/main.rs).
- **TOML** files ([`Cargo.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/Cargo.toml) and [`rust-toolchain.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/rust-toolchain.toml)) manage workspace configuration and toolchain specifications.
- **Shell** scripts in `packaging/linux/` automate Linux binary installation and asset deployment.
- **Objective-C** is accessed via FFI bindings in `crates/openlogi-hook/src/macos/` for macOS native API integration.
- Indirect **C** library linking supports Windows HID communication through the `windows` crate.

## Frequently Asked Questions

### Is OpenLogi written entirely in Rust?

While the runtime application logic, GUI, and background agent are implemented in Rust, the project utilizes TOML for build configuration, Shell scripts for packaging automation, and Objective-C FFI for macOS platform integration. This polyglot approach is strictly limited to build tooling and platform-specific bridging, maintaining a homogeneous Rust runtime codebase.

### What is TOML used for in OpenLogi?

TOML serves as the declarative configuration language for Cargo, Rust's build system and package manager. The [`Cargo.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/Cargo.toml) file defines workspace members and dependency versions, while [`rust-toolchain.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/rust-toolchain.toml) specifies the exact Rust compiler version required, ensuring reproducible builds across development and CI environments.

### Why does OpenLogi use Objective-C if it is a Rust project?

OpenLogi uses Objective-C exclusively through FFI (Foreign Function Interface) to access macOS-specific system APIs for input monitoring and permission handling. Rust code in `crates/openlogi-hook/src/macos/` calls into these native APIs because certain macOS security functions require Objective-C runtime access that cannot be expressed in pure Rust without significant platform abstraction overhead.

### Does OpenLogi contain any C source code?

No pure C source files exist in the repository. However, the Windows build links against system C libraries via the `windows` crate, which wraps native Windows C APIs required for HID device transport. This creates an indirect dependency on C system libraries without maintaining C source code within the project itself.