<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aidomx Dev</title>
    <description>The latest articles on DEV Community by Aidomx Dev (@aidomx).</description>
    <link>https://dev.to/aidomx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4170019%2Fa786869f-5d52-4c8b-ba5f-1216c71af08b.png</url>
      <title>DEV Community: Aidomx Dev</title>
      <link>https://dev.to/aidomx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aidomx"/>
    <language>en</language>
    <item>
      <title>Example Project with rbot: A Simple, Fast, and Modern C/C++ Build System</title>
      <dc:creator>Aidomx Dev</dc:creator>
      <pubDate>Thu, 08 Oct 2026 02:33:10 +0000</pubDate>
      <link>https://dev.to/aidomx/example-project-with-rbot-a-simple-fast-and-modern-cc-build-system-4lfb</link>
      <guid>https://dev.to/aidomx/example-project-with-rbot-a-simple-fast-and-modern-cc-build-system-4lfb</guid>
      <description>&lt;p&gt;If you are a C or C++ developer, chances are you have experienced "CMake fatigue." You just want to compile a few source files, but suddenly you are writing 50 lines of boilerplate, dealing with &lt;code&gt;CMakeLists.txt&lt;/code&gt; quirks, or wrestling with Ninja's rigid DAG (Directed Acyclic Graph) requirements.&lt;/p&gt;

&lt;p&gt;What if building your project could be as simple as writing a 2-line configuration file?&lt;/p&gt;

&lt;p&gt;Meet &lt;strong&gt;rbot&lt;/strong&gt; (Rupa Builder Of Target). It is a modern, declarative build system designed with one core philosophy: &lt;strong&gt;"A simple builder for you."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, we will walk through how to build C and C++ projects using &lt;code&gt;rbot&lt;/code&gt;, from a simple single project to a complex workspace with circular dependencies.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Single Project (Zero Boilerplate)
&lt;/h2&gt;

&lt;p&gt;Let's start with the absolute basics. You have a standard C project with a &lt;code&gt;src/&lt;/code&gt; folder. &lt;/p&gt;

&lt;p&gt;With &lt;code&gt;rbot&lt;/code&gt;, you don't need a massive configuration file. You just initialize it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rbot init
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Created   : Buildfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you open the generated &lt;code&gt;Buildfile&lt;/code&gt;, you will see something beautifully minimal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;use project&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. &lt;code&gt;rbot&lt;/code&gt; relies on &lt;strong&gt;Convention over Configuration&lt;/strong&gt;. It automatically looks into the &lt;code&gt;src/&lt;/code&gt; directory, finds your &lt;code&gt;.c&lt;/code&gt; files, picks the best available compiler (GCC or Clang), and builds your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rbot
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Build with gcc &lt;span class="nt"&gt;-std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gnu11
&lt;span class="o"&gt;[&lt;/span&gt;  1/  2] OK    0.05s  src/main.c
&lt;span class="o"&gt;[&lt;/span&gt;  2/  2] OK    0.04s  src/utils.c
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Linking   : bin/my_app

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Summary
Target   : bin/my_app
Status   : Success
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What about C++?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;rbot&lt;/code&gt; v0.2.2 introduces interactive initialization and first-class C++ support. Run &lt;code&gt;rbot init -p&lt;/code&gt;, and it will ask for your language:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rbot init &lt;span class="nt"&gt;-p&lt;/span&gt;
| Project name? &lt;span class="o"&gt;[&lt;/span&gt;my_cpp_app]: 
| language? &lt;span class="o"&gt;[&lt;/span&gt;c, cpp]: cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It automatically generates a &lt;code&gt;src/main.cpp&lt;/code&gt; and writes the appropriate C++ configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;use project&lt;/span&gt;
&lt;span class="s"&gt;std = c++17&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can even override the compiler effortlessly: &lt;code&gt;compiler = clang++&lt;/code&gt;. &lt;code&gt;rbot&lt;/code&gt; handles the rest, including generating a valid &lt;code&gt;compile_commands.json&lt;/code&gt; for your LSP (clangd/ccls) automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Workspace (Solving Circular Dependencies Natively)
&lt;/h2&gt;

&lt;p&gt;Here is where &lt;code&gt;rbot&lt;/code&gt; truly shines and separates itself from low-level executors like Ninja. &lt;/p&gt;

&lt;p&gt;In a real-world monorepo or workspace, it is very common for modules to have &lt;strong&gt;circular dependencies&lt;/strong&gt; (e.g., Module A needs Module B, and Module B needs Module A). &lt;/p&gt;

&lt;p&gt;If you try to model this in Ninja, it will throw a &lt;code&gt;dependency cycle&lt;/code&gt; error. To fix it, you are forced to manually flatten your graph to the object file (&lt;code&gt;.o&lt;/code&gt;) level or rely on linker tricks like &lt;code&gt;--start-group&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;rbot&lt;/code&gt; understands the concept of a Workspace.&lt;/strong&gt; It doesn't force you to flatten your graph. You just declare your intent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Buildfile.ws&lt;/span&gt;
&lt;span class="s"&gt;use workspace&lt;/span&gt;
&lt;span class="s"&gt;projects = alpha, beta&lt;/span&gt;

&lt;span class="c1"&gt;# Alpha depends on Beta&lt;/span&gt;
&lt;span class="s"&gt;alib.linux = beta&lt;/span&gt;
&lt;span class="c1"&gt;# Beta depends on Alpha&lt;/span&gt;
&lt;span class="s"&gt;blib.linux = alpha&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run &lt;code&gt;rbot -w&lt;/code&gt;, it uses a &lt;strong&gt;Two-Phase Build&lt;/strong&gt; architecture:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Library Pass:&lt;/strong&gt; It compiles all objects and packages them into static/shared libraries for all projects simultaneously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Binary Pass:&lt;/strong&gt; It links the final binaries once all libraries are ready.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You get a clean, logical build without ever touching a linker flag or flattening your directory structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Under the Hood: Why is it so fast?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;rbot&lt;/code&gt; isn't just simple; it is aggressively optimized. &lt;/p&gt;

&lt;h3&gt;
  
  
  Content-Based Fingerprinting
&lt;/h3&gt;

&lt;p&gt;Traditional build systems rely on file timestamps. If you &lt;code&gt;touch&lt;/code&gt; a file, they rebuild it, even if the content hasn't changed. &lt;code&gt;rbot&lt;/code&gt; uses &lt;strong&gt;content-based fingerprinting&lt;/strong&gt;. It hashes the file contents. If the hash hasn't changed, &lt;code&gt;rbot&lt;/code&gt; skips the compilation entirely. &lt;/p&gt;

&lt;p&gt;In our benchmarks, this makes &lt;code&gt;rbot&lt;/code&gt; up to &lt;strong&gt;60x faster&lt;/strong&gt; than standard Make/Ninja setups in "touch" scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory-First Serialization
&lt;/h3&gt;

&lt;p&gt;Generating &lt;code&gt;compile_commands.json&lt;/code&gt; can be slow if done via thousands of tiny &lt;code&gt;fprintf&lt;/code&gt; calls. &lt;code&gt;rbot&lt;/code&gt; uses a memory-first approach: it serializes the entire JSON structure into a pre-allocated memory buffer and writes it to disk in a &lt;strong&gt;single &lt;code&gt;fwrite&lt;/code&gt; syscall&lt;/strong&gt;. This reduces I/O overhead drastically, especially in containerized or emulated environments (like proot-distro).&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Honest Benchmarking
&lt;/h2&gt;

&lt;p&gt;I believe in intellectual honesty. &lt;code&gt;rbot&lt;/code&gt; is not a silver bullet that beats Ninja at &lt;em&gt;everything&lt;/em&gt;. Ninja is a low-level DAG executor and is incredibly fast at &lt;code&gt;noop&lt;/code&gt; (no-operation) builds. &lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;rbot&lt;/code&gt; excels where it matters most to developers: &lt;strong&gt;Cold builds, touch builds, and workspace orchestration.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Instead of hiding its weaknesses, &lt;code&gt;rbot&lt;/code&gt; includes a built-in &lt;code&gt;compare.sh&lt;/code&gt; script to benchmark itself against Make, Ninja, and CMake. If &lt;code&gt;rbot&lt;/code&gt; loses in a specific scenario, it's a signal to optimize the core, not to make excuses.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;rbot&lt;/code&gt; is built for developers who want to spend their time writing code, not debugging build scripts. It provides a modern, polyglot-ready (C/C++ currently, with more to come), and blazing-fast environment without the bloat.&lt;/p&gt;

&lt;p&gt;If you are looking for a breath of fresh air in your C/C++ workflow, give &lt;code&gt;rbot&lt;/code&gt; a try. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"A simple builder for you."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;📂 &lt;a href="https://github.com/aidomx/rbot" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
📄 &lt;a href="https://aidomx.github.io/rbot" rel="noopener noreferrer"&gt;&lt;strong&gt;Documentation&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you tried &lt;code&gt;rbot&lt;/code&gt;? Let me know your thoughts in the comments below!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>c</category>
      <category>cpp</category>
      <category>buildsystem</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
