Modern declarative EDSL for graphic user interface in C++? Not QML or XAML.
Hello everyone,
I have been investigating lately (after using NiceGUI for a real project) and learning Jetpack Compose (not writing any real code with it, would do it with Jetpack Multiplatform if ever).
I am really impressed by Jetpack Compose approach, especially UDF.
I thought there could possibly not be a better way than MVVM tbh, after using it for years.
But after seeing how declarative composition inside the language, not with XAML or QML can be done, I am sold in the amount of boilerplate that can be saved, plus the better integration when the dsl is in the host language.
So I wanted to mention I found this, which I think could be a good start for some experiments, on top of wxWidgets: https://github.com/rmpowell77/wxUI
I think it has a talk in CppCon2025 here: https://www.youtube.com/watch?v=xu4pI72zlO4
Kudos to the author for bringing something like this to C++! Definitely useful.
I would like to hear your opinions on this style of EDSL GUI embedding and pros/cons you find for those of you who do GUI programming all the time.
Also, wild idea: with the power of compile-time C++ programming and C++26 reflection, it would be possible to get existing xaml interfaces and convert it into regular C++ at compile-time via #embed or #include and not even changing the EDSL itself and making it directly embedded and reusable in C++? That would be plenty useful.
https://redd.it/1ry51fg
@r_cpp
Hello everyone,
I have been investigating lately (after using NiceGUI for a real project) and learning Jetpack Compose (not writing any real code with it, would do it with Jetpack Multiplatform if ever).
I am really impressed by Jetpack Compose approach, especially UDF.
I thought there could possibly not be a better way than MVVM tbh, after using it for years.
But after seeing how declarative composition inside the language, not with XAML or QML can be done, I am sold in the amount of boilerplate that can be saved, plus the better integration when the dsl is in the host language.
So I wanted to mention I found this, which I think could be a good start for some experiments, on top of wxWidgets: https://github.com/rmpowell77/wxUI
I think it has a talk in CppCon2025 here: https://www.youtube.com/watch?v=xu4pI72zlO4
Kudos to the author for bringing something like this to C++! Definitely useful.
I would like to hear your opinions on this style of EDSL GUI embedding and pros/cons you find for those of you who do GUI programming all the time.
Also, wild idea: with the power of compile-time C++ programming and C++26 reflection, it would be possible to get existing xaml interfaces and convert it into regular C++ at compile-time via #embed or #include and not even changing the EDSL itself and making it directly embedded and reusable in C++? That would be plenty useful.
https://redd.it/1ry51fg
@r_cpp
GitHub
GitHub - rmpowell77/wxUI: C++ header-only library to make declarative UIs for wxWidgets.
C++ header-only library to make declarative UIs for wxWidgets. - rmpowell77/wxUI
I stripped TDLib from 400k to 104k lines to fix a memory leak in Telegram crawlers
https://github.com/vnikme/autoproto
https://redd.it/1ry6bos
@r_cpp
https://github.com/vnikme/autoproto
https://redd.it/1ry6bos
@r_cpp
GitHub
GitHub - vnikme/autoproto: C++ MTProto layer
C++ MTProto layer. Contribute to vnikme/autoproto development by creating an account on GitHub.
Made a simple neural network in C implementing Stochastic Gradient Descent algorithm
Repo: https://github.com/aadityansha06/DL-C/blob/main/stochastic-gradient-descent.c
So I mostly code in C, yesterday I thought of trying doing DL though I never did any course or something on DL, I have basic understanding of what neuron is, what forward propagation means etc... just these basic terms.
Thus I tried to create very small neural network or a single layer neuron which get trained on single dataset to find the optimal weight for it. Like if yre input is 2 and expected output is 4. Thus optimal weight i got was around 4.000002 in 300 epochs
After doing this I tried to do it for multiple dataset like {2,4} {3,9} {4,16} but I wasn't able to do. Thus I asked Ai what's the issue it said that I have implemented Stochastic Gradient Descent algorithm which work for single dataset meanwhile for multiple dataset, I needed to find the gradient for each of the dataset and the it's mean value or something and then optimizing it (today studying about gradient maths tbh on yt )..
The whole reason I'm sharing this because I never knew something like Stochastic Gradient Descent algorithm exist and unknowingly I implemented it rather getting into tutorial hell or something and learnt a lot more other stuff..
https://redd.it/1rynx7r
@r_cpp
Repo: https://github.com/aadityansha06/DL-C/blob/main/stochastic-gradient-descent.c
So I mostly code in C, yesterday I thought of trying doing DL though I never did any course or something on DL, I have basic understanding of what neuron is, what forward propagation means etc... just these basic terms.
Thus I tried to create very small neural network or a single layer neuron which get trained on single dataset to find the optimal weight for it. Like if yre input is 2 and expected output is 4. Thus optimal weight i got was around 4.000002 in 300 epochs
After doing this I tried to do it for multiple dataset like {2,4} {3,9} {4,16} but I wasn't able to do. Thus I asked Ai what's the issue it said that I have implemented Stochastic Gradient Descent algorithm which work for single dataset meanwhile for multiple dataset, I needed to find the gradient for each of the dataset and the it's mean value or something and then optimizing it (today studying about gradient maths tbh on yt )..
The whole reason I'm sharing this because I never knew something like Stochastic Gradient Descent algorithm exist and unknowingly I implemented it rather getting into tutorial hell or something and learnt a lot more other stuff..
https://redd.it/1rynx7r
@r_cpp
GitHub
DL-C/stochastic-gradient-descent.c at main · aadityansha06/DL-C
Deep-learning practice repo in C. Contribute to aadityansha06/DL-C development by creating an account on GitHub.
How do you reduce branch mispredictions?
I was looking into it recently and realized how many algorithms work together in order to predict branches, so I was wondering how performance engineers even figure out what will make a certain branch more predictable
https://redd.it/1ryrjsq
@r_cpp
I was looking into it recently and realized how many algorithms work together in order to predict branches, so I was wondering how performance engineers even figure out what will make a certain branch more predictable
https://redd.it/1ryrjsq
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
splice: a C++26 reflection-based hook and signal library
I’ve been experimenting with static reflection in the gcc16 trunk. I’ve built a library that lets you annotate class/struct methods and inject behavior through attributes.
You mark methods as hookable with
It also has a wire system for signal/slot connections. Slots declare which signal they handle via reflection attributes, and you can connect specific, or all signals on a listener. Listeners can also be paused, resumed, and they automatically disconnect when destroyed via RAII. If you want to wire a listener to for example, an on_click method on a class, you just add an attribute:
This currently requires GCC 16 (built from a snapshot) and the
GitHub: https://github.com/FloofyPlasma/splice
Curious if anyone else is experimenting with the reflection coming in C++ 26.
https://redd.it/1rxj838
@r_cpp
I’ve been experimenting with static reflection in the gcc16 trunk. I’ve built a library that lets you annotate class/struct methods and inject behavior through attributes.
You mark methods as hookable with
[[=splice::hook::hookable{}]], then you can inject before/after/return hooks at runtime through a registry. You can cancel calls, override return values, rewrite arguments and control execution order by changing the priority of your hooks, all without touching the original class.It also has a wire system for signal/slot connections. Slots declare which signal they handle via reflection attributes, and you can connect specific, or all signals on a listener. Listeners can also be paused, resumed, and they automatically disconnect when destroyed via RAII. If you want to wire a listener to for example, an on_click method on a class, you just add an attribute:
[[SPLICE_WIRE_SLOT(.signal = ^^MyClass::on_click)]]This currently requires GCC 16 (built from a snapshot) and the
-freflection compiler flag. Still early, but all the tests pass and the API feels simple to use. Eventually, I want to use the same reflection machinery to generate FFI bindings for Lua, and maybe other scripting languages too.GitHub: https://github.com/FloofyPlasma/splice
Curious if anyone else is experimenting with the reflection coming in C++ 26.
https://redd.it/1rxj838
@r_cpp
GitHub
GitHub - FloofyPlasma/splice: A header-only C++26 reflection-based hook and mixin library
A header-only C++26 reflection-based hook and mixin library - FloofyPlasma/splice
CppCon 2025 More Speed & Simplicity: Practical Data-Oriented Design in C++ -- Vittorio Romeo
https://isocpp.org/blog/2026/03/cppcon-2025-more-speed-simplicity-practical-data-oriented-design-in-cpp-vit
https://redd.it/1rxda1g
@r_cpp
https://isocpp.org/blog/2026/03/cppcon-2025-more-speed-simplicity-practical-data-oriented-design-in-cpp-vit
https://redd.it/1rxda1g
@r_cpp
Reddit
From the cpp community on Reddit: CppCon 2025 More Speed & Simplicity: Practical Data-Oriented Design in C++ -- Vittorio Romeo
Posted by Ecstatic_Horror_4058 - 27 votes and 13 comments
C++26: Span improvements and freestanding.
Given the freestanding remarks at https://www.sandordargo.com/blog/2026/03/18/cpp26-span-improvements blog post.
> As freestanding environments generally cannot support exceptions, parts of these facilities cannot be included. Specifically, span::at() (since it throws std::outofrange) and all overloads of std::expected::value() are excluded from the freestanding subset.
It appears that once again, even with C++26 hardening runtime, there were some security improvements that were left out of the table when targeting freestanding environments.
Like possibly having some
At least looking at the proposed
https://redd.it/1rwznpr
@r_cpp
Given the freestanding remarks at https://www.sandordargo.com/blog/2026/03/18/cpp26-span-improvements blog post.
> As freestanding environments generally cannot support exceptions, parts of these facilities cannot be included. Specifically, span::at() (since it throws std::outofrange) and all overloads of std::expected::value() are excluded from the freestanding subset.
It appears that once again, even with C++26 hardening runtime, there were some security improvements that were left out of the table when targeting freestanding environments.
Like possibly having some
try_at() that would return std::optional or std::expected result types.At least looking at the proposed
std::span I am not able to find such alternatives.https://redd.it/1rwznpr
@r_cpp
Sandor Dargo’s Blog
C++26: Span improvements
A while back, we talked about how using std::span instead of C-style arrays makes your code safer and easier to reason about. std::span, added in C++20, is a non-owning view over a contiguous sequence of objects - think of it as a string_view, but for arrays.…
What open source projects in C++ have the highest code quality?
My understanding of the characteristics of quality code are the conventional ones.
* operations on an object that are allowed in a particular object state do not put the object into an invalid state.
* it's prioritized to organize the implementation of each object into the smallest possible number of sub-objects.
* no cryptically abbreviated names are used, except possible in very small scopes.
With the program(s)/executable(s) themselves, as well as modules with corresponding namespaces, being considered singleton objects.
Fair dinkum if you want to name projects that score well under a different understanding of code quality.
https://redd.it/1rwokuj
@r_cpp
My understanding of the characteristics of quality code are the conventional ones.
* operations on an object that are allowed in a particular object state do not put the object into an invalid state.
* it's prioritized to organize the implementation of each object into the smallest possible number of sub-objects.
* no cryptically abbreviated names are used, except possible in very small scopes.
With the program(s)/executable(s) themselves, as well as modules with corresponding namespaces, being considered singleton objects.
Fair dinkum if you want to name projects that score well under a different understanding of code quality.
https://redd.it/1rwokuj
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Parallel C++ for Scientific Applications: Distributed Parallelism with HPX (1st Part)
https://www.youtube.com/watch?v=DA_a0XDpp20
https://redd.it/1ryx2cp
@r_cpp
https://www.youtube.com/watch?v=DA_a0XDpp20
https://redd.it/1ryx2cp
@r_cpp
YouTube
CSC4700-Distributed Parallelism with HPX (1st Part)
This lecture introduces distributed parallelism using the HPX framework. Single program multiple data (SPMD) and Communicating Sequential Processes (CSP) models are discussed, then the focus shifts on practical implementation using HPX, including point…
Draft idea: constructor member designators
I’ve been experimenting with a small idea to make constructor initializer lists a bit clearer and less error‑prone. The idea actually came from a dilemma I had when trying to settle on naming conventions for member variables. Prefixes like m_ or _name help avoid shadowing, but they also feel like a workaround for something the language could express more directly.
I wrote a short draft exploring “constructor member designators” - a `.member` syntax for constructor initialization.
https://github.com/richardcervinka/cpp-constructor-member-designators
This is just an experiment, but maybe someone will find it interesting.
https://redd.it/1ryyizp
@r_cpp
I’ve been experimenting with a small idea to make constructor initializer lists a bit clearer and less error‑prone. The idea actually came from a dilemma I had when trying to settle on naming conventions for member variables. Prefixes like m_ or _name help avoid shadowing, but they also feel like a workaround for something the language could express more directly.
I wrote a short draft exploring “constructor member designators” - a `.member` syntax for constructor initialization.
https://github.com/richardcervinka/cpp-constructor-member-designators
This is just an experiment, but maybe someone will find it interesting.
https://redd.it/1ryyizp
@r_cpp
GitHub
GitHub - richardcervinka/cpp-constructor-member-designators: Exploring a possible syntax for member initialization in C++ constructors.
Exploring a possible syntax for member initialization in C++ constructors. - richardcervinka/cpp-constructor-member-designators
Looking at Unity finally made me understand the point of C++ coroutines · Mathieu Ropert
https://mropert.github.io/2026/03/20/unity_cpp_coroutines/
https://redd.it/1rz08da
@r_cpp
https://mropert.github.io/2026/03/20/unity_cpp_coroutines/
https://redd.it/1rz08da
@r_cpp
mropert.github.io
Looking at Unity finally made me understand the point of C++ coroutines · Mathieu Ropert
I had seen many talks about coroutines but it never really clicked where I could use them outisde of async IO. Until I looked at how Unity uses them in C#.
C++/sys - A Standard Library Projection to Facilitate the Verification of Run-time Memory Safety
Hi all,
A while ago I was looking for a relevant C++ conference to demonstrate the capabilities of C++/sys. A pure C++ mechanism which offers a new approach to memory safety via debug-time verification.
My talk was accepted into C++Online 2026 which concluded a couple of weeks ago. The discussions were great, I received some really useful feedback (and the little 2D gather town was pretty fun!).
The slides are available here and the release video should appear on YouTube in the following weeks.
Excited to share the tech with the wider community. Much of it is discussed in the slides; some highlights:
Offers improvements over AddressSanitizer in terms of C++ error detection rate
Tracks access lifespan rather than blocks of data
Has contextual knowledge of C++ objects and containers so generally quite performant
100% detection rate for executed paths
Memory pinning and locking mechanism tracks dangling 'this' and references
Zero overhead in release builds
Compatible with any standard C++ compiler (from hosted C++98 running on MS-DOS to freestanding C++${LATEST} on Zephyr)
Doesn't interfere with C code/libraries. Just like Java, Rust, Python thin-bindings, these are treated as unchecked.
Some of the above sounds like magic but the core mechanism allowing for this is quite simple. Temporaries created by operator->, operator* and operator[\] lock memory for the lifetime of access and pointers are entirely prevented from dangling in a coarse-grained manner. Obviously this has an impact on what designs are possible with some discussion in the slides.
Link to the open-source (BSD 3-clause) reference implementation is here.
https://codeberg.org/kpedersen/sys\_public
https://research.thamessoftware.co.uk/sys
Very happy to discuss further. It has some rough areas but I personally love the tech and find it makes writing and testing C++ considerably more satisfying knowing that there is virtually zero chance of a memory error lurking in the tested branches.
https://redd.it/1rz3df4
@r_cpp
Hi all,
A while ago I was looking for a relevant C++ conference to demonstrate the capabilities of C++/sys. A pure C++ mechanism which offers a new approach to memory safety via debug-time verification.
My talk was accepted into C++Online 2026 which concluded a couple of weeks ago. The discussions were great, I received some really useful feedback (and the little 2D gather town was pretty fun!).
The slides are available here and the release video should appear on YouTube in the following weeks.
Excited to share the tech with the wider community. Much of it is discussed in the slides; some highlights:
Offers improvements over AddressSanitizer in terms of C++ error detection rate
Tracks access lifespan rather than blocks of data
Has contextual knowledge of C++ objects and containers so generally quite performant
100% detection rate for executed paths
Memory pinning and locking mechanism tracks dangling 'this' and references
Zero overhead in release builds
Compatible with any standard C++ compiler (from hosted C++98 running on MS-DOS to freestanding C++${LATEST} on Zephyr)
Doesn't interfere with C code/libraries. Just like Java, Rust, Python thin-bindings, these are treated as unchecked.
Some of the above sounds like magic but the core mechanism allowing for this is quite simple. Temporaries created by operator->, operator* and operator[\] lock memory for the lifetime of access and pointers are entirely prevented from dangling in a coarse-grained manner. Obviously this has an impact on what designs are possible with some discussion in the slides.
Link to the open-source (BSD 3-clause) reference implementation is here.
https://codeberg.org/kpedersen/sys\_public
https://research.thamessoftware.co.uk/sys
Very happy to discuss further. It has some rough areas but I personally love the tech and find it makes writing and testing C++ considerably more satisfying knowing that there is virtually zero chance of a memory error lurking in the tested branches.
https://redd.it/1rz3df4
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Measuring stack headroom at runtime in C++
https://medium.com/@yair.lenga/how-much-stack-space-do-you-have-estimating-remaining-stack-in-c-on-linux-3c9513beabd8
https://redd.it/1rz7kl7
@r_cpp
https://medium.com/@yair.lenga/how-much-stack-space-do-you-have-estimating-remaining-stack-in-c-on-linux-3c9513beabd8
https://redd.it/1rz7kl7
@r_cpp
Medium
How Much Stack Space Do You Have? Estimating Remaining Stack in C on Linux
Practical techniques for estimating remaining stack space at runtime on Linux systems.
A matter of style or is it?
Which one do you prefer (the constructor does some work and sets
or
On the caller side:
or
https://redd.it/1rz8gq5
@r_cpp
Which one do you prefer (the constructor does some work and sets
valid_):class A {
public:
explicit operator bool() const { return valid; }
private:
bool valid_ = false;
}
or
class A {
public:
bool is_valid() const { return valid; }
private:
bool valid_ = false;
}
On the caller side:
A a{};
if (a) {
// is valid
}
or
A a{}
if (a.is_valid()) {
// is valid
}
https://redd.it/1rz8gq5
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Common Package Specification is Out the Gate
https://www.kitware.com/common-package-specification-is-out-the-gate/
https://redd.it/1rzdr6u
@r_cpp
https://www.kitware.com/common-package-specification-is-out-the-gate/
https://redd.it/1rzdr6u
@r_cpp
Kitware
Common Package Specification is Out the Gate
After years of development and community collaboration, a major milestone has been reached in CMake’s packaging story: the Common Package Specification (“CPS”) is no longer experimental. What began as an effort to modernize and standardize how build systems…
Should assertions be used frequently in software development? And in what general scenarios are they typically applied?
https://redd.it/1rzfy9i
@r_cpp
https://redd.it/1rzfy9i
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Last C++26 meeting in Croydon is about to begin
Since not everyone is aware and confusion often arises regarding privated GitHub repos, let's inform people on Reddit this time: The last meeting for C++26 is about to begin. Some quick facts:
- The meeting lasts from 2026-03-23 (Mon morning) to 2026-03-28 (Sat afternoon). See also <https://isocpp.org/std/meetings-and-participation/upcoming-meetings>
- Until the meeting ends, <https://github.com/cplusplus/papers/> is private. The repos usually become visible again immediately after the meeting ends.
- The papers published during and after the meeting all go into the April mailing 2026-04-20. This includes the final working draft.
- All remaining NB (national body) comments should be resolved during this meeting. The working draft is then sent off to ISO for review and national bodies vote on the C++26 standard as a whole (yes/no/abstain).
- Any C++26 work takes priority, but once that is completed, time is spent on C++29 papers.
https://redd.it/1rzjovp
@r_cpp
Since not everyone is aware and confusion often arises regarding privated GitHub repos, let's inform people on Reddit this time: The last meeting for C++26 is about to begin. Some quick facts:
- The meeting lasts from 2026-03-23 (Mon morning) to 2026-03-28 (Sat afternoon). See also <https://isocpp.org/std/meetings-and-participation/upcoming-meetings>
- Until the meeting ends, <https://github.com/cplusplus/papers/> is private. The repos usually become visible again immediately after the meeting ends.
- The papers published during and after the meeting all go into the April mailing 2026-04-20. This includes the final working draft.
- All remaining NB (national body) comments should be resolved during this meeting. The working draft is then sent off to ISO for review and national bodies vote on the C++26 standard as a whole (yes/no/abstain).
- Any C++26 work takes priority, but once that is completed, time is spent on C++29 papers.
https://redd.it/1rzjovp
@r_cpp
Kristian Ivarsson: Casual, an open-source SOA platform
https://youtu.be/2c-I7fzKPWY
https://redd.it/1rzn5p9
@r_cpp
https://youtu.be/2c-I7fzKPWY
https://redd.it/1rzn5p9
@r_cpp
YouTube
Kristian Ivarsson: Casual, an open-source SOA platform
Casual is a modern distributed application server for building large-scale systems with minimal configuration. Written in C++, it provides an application and transaction manager, automatic service discovery, built-in queues, and asynchronous service calls…
How to understand modern C++ features in practice? Let's create a compiler! - Boguslaw Cyganek - Meeting C++ 2025
https://www.youtube.com/watch?v=_uuUw8N0qQ0
https://redd.it/1rzwojc
@r_cpp
https://www.youtube.com/watch?v=_uuUw8N0qQ0
https://redd.it/1rzwojc
@r_cpp
YouTube
How to understand modern C++ features in practice? Let's create a compiler! - Boguslaw Cyganek
How to understand modern C++ features in practice? Let's create a compiler! - Boguslaw Cyganek - Meeting C++ 2025
Slides: https://slides.meetingcpp.com
Survey: https://survey.meetingcpp.com
Recent C++ standards have introduced many new features. We often…
Slides: https://slides.meetingcpp.com
Survey: https://survey.meetingcpp.com
Recent C++ standards have introduced many new features. We often…
Standard LLMs hallucinate on large C++ codebases. I built an open-source MCP server using tree-sitter to fix that.
I’ve been experimenting heavily with AI agents for legacy modernization, but I kept hitting a massive wall when dealing with C++.
If you just dump a bunch of intertwined C++ files into Claude or an open-source model, it loses context. It tries to refactor a function without knowing what upstream dependencies rely on it, or it gets tangled in circular references and breaks the build. Regex-based parsers also constantly miss the nuances of C++ macros and templates.
So, I built **LegacyGraph-MCP**, an open-source Model Context Protocol (MCP) server that turns "spaghetti code" into a queryable Knowledge Graph for AI Agents.
**How it works under the hood:** Instead of forcing the LLM to read raw text and guess relationships, the agent queries the structure.
1. **AST Parsing:** It uses `tree-sitter-cpp` for 100% accurate parsing (no regex hacks).
2. **Graph RAG:** It loads the codebase into a NetworkX directed graph.
3. **Agent Interaction:** The LLM uses MCP tools to ask specific questions like:
* *“Which functions call* `process_client()`\*?”\*
* *“Are there any circular dependencies here?”*
* *“What are the orphan functions?”*
**Features:**
* **Omni-Ingestion:** It can clone a GitHub repo, apply a patch, scan a local directory, or accept raw file uploads.
* **Hybrid Deployment:** You can run it locally (`stdio`) directly tied to your IDE/Claude Desktop, or deploy it to the cloud (`HTTP`/`SSE`) with ephemeral `/tmp/` clones.
* **Token-Safe Visuals:** It dynamically generates bounded Mermaid.js graphs inline so the LLM can visually map out the dependencies it is working on.
**The Ask:** The core graph logic is working well (I’ve got an end-to-end verifier passing 100% on test data), but I’m looking for feedback from people who work with *really* messy, real-world legacy code.
Specifically:
1. Does the cycle detection logic hold up against your worst circular dependencies?
2. Are there specific query tools (besides `get_callers`, `get_callees`, `detect_cycles`, etc.) that would make your life easier when using an AI coding assistant?
**Repository:** [LegacyGraph-MCP](https://github.com/RohitYadav34980/LegacyGraph-MCP)
*(If you are using Smithery or Claude Desktop, I included the quick-start configs in the README).*
What else can we build with this?
I am open to all ideas! Could we use this for automated test scaffolding for isolated subgraphs? Dead-code pruning pipelines? Vulnerability blast-radius analysis? Drop your ideas in the comments.
Whether you are a backend engineer optimizing graph algorithms, or someone pushing the limits of AI agents, there is a place for you here. Let’s build the ultimate open-source legacy modernization engine together.
Would love to hear your thoughts or see if this breaks on your weirdest legacy code!
https://redd.it/1rzws51
@r_cpp
I’ve been experimenting heavily with AI agents for legacy modernization, but I kept hitting a massive wall when dealing with C++.
If you just dump a bunch of intertwined C++ files into Claude or an open-source model, it loses context. It tries to refactor a function without knowing what upstream dependencies rely on it, or it gets tangled in circular references and breaks the build. Regex-based parsers also constantly miss the nuances of C++ macros and templates.
So, I built **LegacyGraph-MCP**, an open-source Model Context Protocol (MCP) server that turns "spaghetti code" into a queryable Knowledge Graph for AI Agents.
**How it works under the hood:** Instead of forcing the LLM to read raw text and guess relationships, the agent queries the structure.
1. **AST Parsing:** It uses `tree-sitter-cpp` for 100% accurate parsing (no regex hacks).
2. **Graph RAG:** It loads the codebase into a NetworkX directed graph.
3. **Agent Interaction:** The LLM uses MCP tools to ask specific questions like:
* *“Which functions call* `process_client()`\*?”\*
* *“Are there any circular dependencies here?”*
* *“What are the orphan functions?”*
**Features:**
* **Omni-Ingestion:** It can clone a GitHub repo, apply a patch, scan a local directory, or accept raw file uploads.
* **Hybrid Deployment:** You can run it locally (`stdio`) directly tied to your IDE/Claude Desktop, or deploy it to the cloud (`HTTP`/`SSE`) with ephemeral `/tmp/` clones.
* **Token-Safe Visuals:** It dynamically generates bounded Mermaid.js graphs inline so the LLM can visually map out the dependencies it is working on.
**The Ask:** The core graph logic is working well (I’ve got an end-to-end verifier passing 100% on test data), but I’m looking for feedback from people who work with *really* messy, real-world legacy code.
Specifically:
1. Does the cycle detection logic hold up against your worst circular dependencies?
2. Are there specific query tools (besides `get_callers`, `get_callees`, `detect_cycles`, etc.) that would make your life easier when using an AI coding assistant?
**Repository:** [LegacyGraph-MCP](https://github.com/RohitYadav34980/LegacyGraph-MCP)
*(If you are using Smithery or Claude Desktop, I included the quick-start configs in the README).*
What else can we build with this?
I am open to all ideas! Could we use this for automated test scaffolding for isolated subgraphs? Dead-code pruning pipelines? Vulnerability blast-radius analysis? Drop your ideas in the comments.
Whether you are a backend engineer optimizing graph algorithms, or someone pushing the limits of AI agents, there is a place for you here. Let’s build the ultimate open-source legacy modernization engine together.
Would love to hear your thoughts or see if this breaks on your weirdest legacy code!
https://redd.it/1rzws51
@r_cpp
GitHub
GitHub - RohitYadav34980/LegacyGraph-MCP: MCP Server for analyzing C++ legacy codebases
MCP Server for analyzing C++ legacy codebases. Contribute to RohitYadav34980/LegacyGraph-MCP development by creating an account on GitHub.