Rho Rho language and toolchain

Components and plugins

A component is a module that publishes a command: rho fmt, rho test,
rho doc. The CLI does not know these commands — they arrive with the
component, which is why adding a tool does not mean rebuilding the toolchain.

A plugin is a module that extends a tool rather than adding a command. A
doc plugin adds a page to the site a doc build produces; a test plugin runs
suites the runner does not implement itself.

Both are published, installed and enabled the same way, and each documents
itself: every page below is generated from that module's own docs/, so this
index is a map rather than a second copy.

Build and target

ModuleCommandWhat it does
rho-targetrho targetBoard and architecture specifications, and the CMake that builds for them
rho-cimportrho cimportGenerates a Rho foreign interface from C headers
rho-kconfigrho kconfigConfiguration bridge between a project and the Kconfig tooling around it

Run, debug, flash

ModuleCommandWhat it does
rho-flashrho flashPuts a built binary on a board
rho-deployrho deployPuts a built program on a host, and starts it
rho-dbgrho dbgA debug adapter: DAP on one side, GDB on the other, a probe in between
rho-monitorrho monitorA target's console over UART, RTT or an ITM trace, alongside a debug session
rho-testrho testDiscovers and runs a project's tests

Measure

ModuleCommandWhat it does
rho-memrho memWhere a program's memory went, and whether it fits its budgets
rho-benchrho benchHow long code takes, what stack and heap it uses, and how that compares with a baseline
rho-lintrho lintEvery static analyzer over one compilation database, as SARIF

Toolchain and documentation

ModuleCommandWhat it does
rho-fmtrho fmtThe source formatter
rho-docrho docThe documentation generator that built this site
rho-logrho logStructured logging
rho-lsprho lspThe language server
rho-doctorrho doctorWhat the installed modules need from this machine, and what it has
rho-keeperrho keeperA dashboard for the installation and its registry, and what it fixes

Services

ModuleCommandWhat it does
rho-routerrho routeHTTP routing, parameter binding and API metadata
rho-sqlrho sqlSQL a service declares, and the engine that runs it
rho-openapirho openapiOpenAPI 3.1 descriptions and API references
rho-authrho authRegistry credentials

Plugins

A plugin extends a tool. It is enabled with rho plugin enable <name>, and a
tool that has one runs it wherever that tool offers the hook.

PluginExtendsWhat it adds
rho-doc-apirho-docA service's HTTP API reference to its documentation site
rho-doc-tocrho-docA table of contents and a generation notice
rho-sql-sqliterho-sqlRuns a service's SQL against a sqlite database
rho-test-gtestrho-testRuns a project's GoogleTest suites
rho-test-junitrho-testWrites a JUnit report, which is what a CI system reads
rho-robohubfour componentsMaps the RoboHub platform's target, configuration, C and flashing conventions onto the toolchain's contracts

rho-robohub is the one to read if you are adding a platform: it implements one
contract across rho-target, rho-kconfig, rho-cimport and rho-flash at
once, and it runs only for a project whose module graph names the platform.

Applications

Applications are written in Rho rather than extending the toolchain. They are
built and run like any other project.

ApplicationWhat it is
registryThe remote module registry: what rho module search and rho module install talk to

Adding one

handbook/modules describes components and plugins, and what a manifest
declares for each. A component is a module with a command, a main that is a
binary in its own root, and its own go.mod; a plugin is a module with an
extends block naming the component it plugs into and the hooks it answers.

rho-doc-toc is the smallest plugin in the tree and the shortest thing to read
before writing one.