Skip to main content
This page is a concise reference for the remaining language ecosystems rbs supports. Each follows the same pattern as Python and the JVM: declare a hermetic toolchain in WORKSPACE.rbs, then define targets in BUILD.rbs.

C

C builds use Zig as the hermetic compiler (zig cc) — no system clang or gcc required. Rules produce real dependency wiring: headers propagate to dependents, shared libraries are linked and made discoverable at runtime.

Toolchain

Keep the default name c_toolchain — the C rules resolve the compiler by that name.

Rules

Shared attributes:
Binaries that depend on shared libraries get a launcher that sets the library search path automatically, so rbs run works without any environment setup.
The C rules cover compiling, linking, and shared-library workflows within your workspace. There is no dedicated c_test rule and no external package registry integration for C — dependencies are targets you define in the workspace.

C++

The C++ rules are the direct counterpart of the C rules, backed by zig c++.

Toolchain

Keep the default name cxx_toolchain — the C++ rules resolve the compiler by that name.

Rules

cxx_binary, cxx_library, and cxx_shared_library take the same attributes as their C equivalents, with cxxflags in place of cflags:
As with C, there is no dedicated test rule or external package registry for C++ yet.

.NET

rbs downloads the .NET SDK and builds C# applications through dotnet publish, wrapping the resulting DLL in a runnable launcher.

Toolchain

Supported on macOS and Linux (amd64/arm64). Windows is not supported by this toolchain. Keep the default name dotnet — the rules resolve the SDK by that name.

Rules

dotnet_binary

Builds a .NET application from C# sources plus a project file. The build runs dotnet publish (Release configuration), so NuGet PackageReference entries in your .csproj are restored as part of the build.

dotnet_library

Packages C# sources (and optionally a .csproj) so binaries can depend on them; the sources are compiled as part of the consuming binary’s publish.
.NET support is early. There is no dotnet_test rule yet and no standalone NuGet dependency rule — package dependencies are declared in your .csproj and restored during the build.

Protocol Buffers

Proto support is split into a shared toolchain, a language-neutral proto_library rule, and per-language code-generation rules.

Toolchain

Declare it once in WORKSPACE.rbs. It downloads protoc (v27.0) for every supported platform along with the gRPC code-generation plugins for Java, Kotlin, Python, and Go:

proto_library

Declares a set of .proto files. Other proto libraries can be listed as deps, and their files become available as imports. Load it from @rbs//java/proto.rbs (the rule itself is language-neutral):

Language bindings

Each language has a generation rule that consumes a proto_library and produces source code plus the runtime dependencies your targets need — the protobuf runtime is always included, and the gRPC libraries are added when enable_grpc = True: All three share the same attributes: A complete example — proto definitions, generated code, and an application using them:
Go bindings also exist (go_proto_library from @rbs//go/proto.rbs); they are covered with the Go rules.