The TProc Library: A Simple Example (Part I)

Published February 2, 2026

Abstract

The TProc Library uses the Rope structure—as defined in its similarly named paper. We will in this blog post study its implementation through OCL's TProc.

Introduction

Let us walk through the TProc library in a structured manner.

Definition of a TProc Example:

Let the following C++ source:

/*
 * File: example.cpp
 * Purpose: Rope example.
 * Author: Amlal El Mahrouss (amlal@nekernel.org)
 * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License.
 */

#include <ocl/tproc/rope.hpp>
#include <iostream>
#include <memory>

#ifndef STANDALONE
using namespace ocl;
#else
using namespace boost;
#endif

int main()
{
	auto rope = tproc::crope("The Quick Brown Fox Jumps Over The Lazy Dog");
	auto new_elem = std::make_unique<tproc::crope>(", and Jumps again.");
	
	rope.concat(new_elem.get());

	std::cout << *++rope << std::endl;
}

Three things are done:

  • 'rope' has ownership of 'new_elem'.
  • calling 'std::cout' (or any 'std::ostream' really.) on rope will return the complete rope string of rope.
  • The data structure is O(log n)—which makes it perfect for text processing applications.

What this solves:

The following is addresed in TProc:

  • Text manipulation.
  • Performance aware programs.

Conclusion:

The TProc is free-software, available at: ocl.nekernel.org. On both GitHub and Codeberg.