Ahwoo.BRUTAL.Interop
2026.10.1
Prefix Reserved
dotnet add package Ahwoo.BRUTAL.Interop --version 2026.10.1
NuGet\Install-Package Ahwoo.BRUTAL.Interop -Version 2026.10.1
<PackageReference Include="Ahwoo.BRUTAL.Interop" Version="2026.10.1" />
<PackageVersion Include="Ahwoo.BRUTAL.Interop" Version="2026.10.1" />
<PackageReference Include="Ahwoo.BRUTAL.Interop" />
paket add Ahwoo.BRUTAL.Interop --version 2026.10.1
#r "nuget: Ahwoo.BRUTAL.Interop, 2026.10.1"
#:package Ahwoo.BRUTAL.Interop@2026.10.1
#addin nuget:?package=Ahwoo.BRUTAL.Interop&version=2026.10.1
#tool nuget:?package=Ahwoo.BRUTAL.Interop&version=2026.10.1
Brutal Interop
C/C++ parsing, AST representation, and layered interop code generation for the BRUTAL framework.
Brutal Interop provides the tools to parse C/C++ headers and generate managed ↔ native interop in a series of composable transformation steps. At the centre is Brutal.Ast: a language-neutral intermediate representation that models namespaces, types, fields, methods, expressions, and statements independently of any source language or output target. Brutal.Ast.CppAst populates that representation from C/C++ headers via libclang, and from there the AST can be walked and reshaped through as many stages as needed — for example, generating a C extern wrapper, then a C# PInvoke layer, then a user-facing C# API. Brutal.Interop provides the runtime handle and marshalling types consumed by generated code, while Brutal.Interop.NativeBuild integrates the CMake build of native libraries into the .NET build and pack pipeline.
Platform Support
- Windows (x64)
- Linux (x64)
- macOS (Apple Silicon)
Links
NuGet Packages
- RocketWerkz.Brutal.Ast - Language-neutral AST: declarations, types, expressions, statements, and tree traversal
- RocketWerkz.Brutal.Ast.CppAst - C/C++ header parser that produces a
Brutal.Astcompilation unit via libclang - RocketWerkz.Brutal.Ast.SourceGenerators - Roslyn analyzer that generates
ISyntaxnode boilerplate; bundled withRocketWerkz.Brutal.Ast - Ahwoo.BRUTAL.Interop - Runtime interop handle attributes and UTF-8 string marshalling types
- RocketWerkz.Brutal.Interop.SourceGenerators - Roslyn analyzer that generates handle marshalling code; bundled with
Ahwoo.BRUTAL.Interop - RocketWerkz.Brutal.Interop.NativeBuild - MSBuild targets and CMake tooling that build and package native libraries as part of the .NET pipeline
For Users
Prerequisites
- .NET SDK (version 10.0 or later)
Installation
To install the packages via NuGet, run the following commands in your project directory:
dotnet add package RocketWerkz.Brutal.Ast
dotnet add package RocketWerkz.Brutal.Ast.CppAst
dotnet add package Ahwoo.BRUTAL.Interop
dotnet add package RocketWerkz.Brutal.Interop.NativeBuild
The source generator packages are bundled with RocketWerkz.Brutal.Ast and Ahwoo.BRUTAL.Interop respectively and do not need to be installed separately.
Usage
Each module ships with a guided walkthrough next to its source — start at
src/Brutal.Ast/README.md for the core IR, or
jump straight to src/Brutal.Interop/README.md
for the runtime handle pattern. The code samples on those pages are
compiled and asserted at build time via
RocketWerkz.Brutal.DocTest,
so they stay in sync with the API.
samples/Brutal.Ast.Samples contains runnable end-to-end samples that demonstrate the full interop generation workflow:
- AutoInterop — The core workflow: parses a C++ API, generates a C extern wrapper, a C# PInvoke layer, and a user-facing C# wrapper in one pass.
- Comprehensive — Extends AutoInterop with custom AST manipulation and additional hand-written C# files, showing how auto-generated code can be augmented.
- FullGeneration — Demonstrates standalone code generation without a native compilation step.
- DocComments — Shows how C# doc comments can be authored using the DocComment tree
- CMakeParser — Investigates cmake parsing with the intention of informing how code should be parsed for generation
AutoInterop, Comprehensive, FullGeneration, and CMakeParser compile native libraries at runtime and require CMake and a platform C++ toolchain to be available on PATH (MSVC on Windows, GCC on Linux, Xcode Command Line Tools on macOS). DocComments has no native compilation step. libclang itself is bundled with RocketWerkz.Brutal.Ast.CppAst and does not need to be installed separately.
Please refer to the BRUTAL Documentation for more detailed usage instructions and examples.
For Developers
Prerequisites
- .NET SDK (version 10.0 or later)
Compilation and Testing
To build the solution locally, run the following command in the repository root:
dotnet build
To run the tests, run the following command in the repository root:
dotnet test
Contributing
If you find a bug or have a feature request, please open an issue on GitHub. If you'd like to contribute code, feel free to fork the repository and submit a pull request.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Ahwoo.BRUTAL.Core (>= 2026.10.1)
NuGet packages (13)
Showing the top 5 NuGet packages that depend on Ahwoo.BRUTAL.Interop:
| Package | Downloads |
|---|---|
|
Ahwoo.BRUTAL.ShaderC
Modern C# bindings for the shaderc API, a shader-compiling library. |
|
|
Ahwoo.BRUTAL.Sdl
Modern C# bindings for SDL3, enabling cross-platform windowing, input, and multimedia. |
|
|
Ahwoo.BRUTAL.RakNet
Modern C# bindings for the RakNet API, a low-level networking library. |
|
|
Ahwoo.BRUTAL.OpenAl
Modern C# bindings for OpenAL (OpenAL Soft), for cross-platform 3D and streamed audio. |
|
|
Ahwoo.BRUTAL.Jolt
Modern C# bindings for the Jolt Physics library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.10.1 | 3,141 | 10/15/2026 |
Builds with BrutalPackage.Sdk 2026.10.1 against the 2026.10.1 Brutal packages, so Brutal.T4 is no longer pulled in as a transitive dependency.
No public API changes.
**Full Changelog:** [v2026.10.0...v2026.10.1](https://github.com/RocketWerkz/brutal.interop/compare/v2026.10.0...v2026.10.1)