Skip to content

Add C++ Bindings#3544

Merged
JasonAtClockwork merged 70 commits intomasterfrom
jlarabie/bindings-cpp
Feb 7, 2026
Merged

Add C++ Bindings#3544
JasonAtClockwork merged 70 commits intomasterfrom
jlarabie/bindings-cpp

Conversation

@JasonAtClockwork
Copy link
Contributor

@JasonAtClockwork JasonAtClockwork commented Oct 30, 2025

Description of Changes

This adds C++ server bindings (/crate/bindings-cpp) to allow writing C++ 20 modules.

  • Emscripten WASM build system integration with CMake
  • Macro-based code generation (SPACETIMEDB_TABLE, SPACETIMEDB_REDUCER, etc)
  • All SpacetimeDB types supported (primitives, Timestamp, Identity, Uuid, etc)
  • Product types via SPACETIMEDB_STRUCT
  • Sum types via SPACETIMEDB_ENUM
  • Constraints marked with FIELD* macros

API and ABI breaking changes

None

Expected complexity level and risk

2 - Doesn't heavily impact any other areas but is complex macro C++ structure to support a similar developer experience, did have a small impact on init command

Testing

  • modules/module-test-cpp - heavily tested every reducer
  • modules/benchmarks-cpp - tested through the standalone (~6x faster than C#, ~6x slower than Rust)
  • modules/sdk-test-cpp
  • modules/sdk-test-procedure-cpp
  • modules/sdk-test-view-cpp
  • Wrote several test modules myself
  • Quickstart smoketest [Currently in progress]
  • Write Blackholio C++ server module

@JasonAtClockwork JasonAtClockwork marked this pull request as ready for review January 21, 2026 15:57
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this at least with the basic quickstart doc and everything seems to be working. I also looked back and did another pass on the comments that I put down - let me know if you need me to take another look at anything.

I have not done a nit-pick review on the code here since there is quite a lot but I have skimmed it and haven't found anything too concerning. I think it would be better to do a UX review when we go through the follow-up docs PRs anyway. Please request my review when those are ready as well.

Thanks Jason, this is great 👍

Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only looked at the procedure-related stuff in here, but it looks great - much better than I expected, to be honest. Thanks for all your hard work on this!

Copy link
Collaborator

@joshua-spacetime joshua-spacetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view code looks correct. sender is a method in the 2.0 rust module api. But as I understand it, this is not meant to be 2.0 compliant. Also this does not include the query builder which will be added separately.

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the changes to tools/upgrade-version and the new versioning change, everything looks good here - just a reminder to make sure everything is tested before merging 🙂

Thanks Jason!

@JasonAtClockwork JasonAtClockwork added the enhancement New feature or request label Feb 6, 2026
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving my code owned files. Left one comment.

@JasonAtClockwork JasonAtClockwork added this pull request to the merge queue Feb 7, 2026
Merged via the queue into master with commit 52b6c66 Feb 7, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants