-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
This guide takes you from a fresh machine to a running generated SERP service in about 15 minutes.
- macOS or Linux (Ubuntu 20.04+ / Debian 11+)
- CMake ≥ 3.16
- C++17 compiler (
clang++org++) -
serpgen— installed as part of theserp-devpackage
Install serp-dev using the platform instructions in Installation. It provides the SERP headers, CMake package, serpgen, test engine, and runtime debug adapters.
Verify the install:
serpgen --versionserpgen ships with project templates. The calculator_console template creates a minimal two-service workspace — a Calculator service and a console client — wired up and ready to build.
serpgen template calculator_console myapp
cd myappThe generated workspace layout:
myapp/
├── specs/
│ └── serp.sidl # SerpIDL specification (edit this)
├── src/
│ └── components/ # Your implementation code lives here
│ └── calculator/
│ └── CalculatorImpl.cpp
├── gen/ # Generated — do not edit by hand
├── CMakeLists.txt
└── build/
Before generating, check that the spec parses cleanly:
serpgen validate -w specs/serp.sidlA clean spec prints no errors. Fix any reported issues before proceeding.
serpgen generate-workspace -w specs/serp.sidlThis writes (or overwrites) everything under gen/:
-
gen/interfaces/— pure virtualICalculator.hand similar -
gen/base/—CalculatorBase.h/.cpp(dispatch, serialization wiring) -
gen/services/—Calculator.h/.cpp(default stub, generated once) -
gen/mains/—main_monolith.cppand per-process entry points -
gen/adapters/— transport glue
Configure and build the monolith target:
cmake -S . -B build/monolith -DCMAKE_BUILD_TYPE=Debug
cmake --build build/monolith --parallelThe monolith target runs all services in a single process using the inprocess transport — the fastest path for development.
./build/monolith/myapp_monolithYou should see the console client connect to the Calculator service and execute the demo calls defined in the template.
Open the implementation stub for the service you want to fill in:
src/components/calculator/CalculatorImpl.cpp
The stub contains empty method handlers that match the interface defined in specs/serp.sidl. For example:
// In CalculatorImpl.cpp — generated stub, ready to fill in
void CalculatorImpl::add(int32_t a, int32_t b, AddCallback callback)
{
// TODO: implement
callback(a + b);
}Replace the // TODO body with real logic. The method signature and callback type are generated from the spec and must not be changed by hand — change the spec instead, then regenerate.
After changing specs/serp.sidl (adding methods, updating types, etc.):
# 1. Validate
serpgen validate -w specs/serp.sidl
# 2. Regenerate
serpgen generate-workspace -w specs/serp.sidl
# 3. Rebuild
cmake --build build/monolith --parallel
# 4. Run
./build/monolith/myapp_monolithImportant: Files in gen/ are always regenerated and any manual edits there will be lost. Files in src/ are never touched by serpgen — your implementation code survives every regeneration.
- Read Core Concepts for the mental model behind services, transports, and code generation.
- Read SerpIDL Overview to learn how to write and extend interface specs.
- Check out serp-demo for a more complete example workspace.
Getting Started
The Development Model
Architecture Language
Code Generator
- Generator Overview
- Generated Code Layout
- Deployment Configurations
- Lifecycle Backends
- CMake Integration
Framework Internals
- Core Concepts
- Services & Lifecycle
- Methods
- Properties
- Notifications
- Timers & Watchdog
- Promises & Async
- Streams
- Commands
- Logging
- Test Engine
- Transports
- Runtime & Debug Tools
VS Code Plugin
Examples