diplomat-runtime
Common runtime utilities used by diplomat codegen
0.16.0
5.4M downloads/mo
#4363 most downloaded on crates.io
rust-diplomat/diplomat
What this package is like to depend on
Last release 19 days ago
04 Aug 2026
Release timing varies
gaps range from 8 days to 5 months
Rarely documented
notes for 5 of 24 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
25 releases · first in 2021
8 releases in the last 12 months
see the full history below
Release timeline
25 releases · Aug 2021 to Aug 2026Releases
latest 25-
0.16.031 Jul 2026Release notes
Open source →Diplomat 0.16.0
synv3We've upgraded to
synv3 to stay up to date with newer minor releases ofsyn(#1228).NET backend
Diplomat used to have a .NET backend with the old AST representation. This was removed since we transitioned to the HIR representation, and existing users have been on an old fork of the AST-based backend. Thankfully, first-time contributor irvingoujAtDevolution has been hard at work implementing the new HIR-based .NET backend:
#1164 (co-authored with Claude Code), #1180, #1186, #1191, #1189, #1194, #1195, #1193 (co-authored with Claude Sonnet 4.6), #1201, #1216, #1214, #1213, #1215, #1226, #1225, #1230, #1231
File/Line information in AST Errors
Diplomat Core's MSRV is now 1.88, which enables support for procedural macro locations, which are used in new AST error reports. These new reports highlight line/file information instead of panicking with minimal context. There's a pretty printer that uses annotate-snippets (enabled by default in the tool, enabled elsewhere with the feature flag "pretty-print"), and an ugly printer (uses no extra dependencies, enabled by default in the macro).
This was accomplished in two steps: first, we added
proc_macro2::Spaninformation to AST. Subsequently, we made five PRs to replace existingpanic!,.expect, andassert!calls in the AST parser with these more detailed reports:#1172, #1177, #1183, #1206, #1208
Other New Features
Diplomat Core
- Added
#[diplomat::include]for including macro definitions from other files (#917) - Added support for partial comparisons (#1103)
- Added support for tuplable structs (#1101)
- Added Opaque slice support (#1088)
Diplomat Runtime
- Added no_std support for wasm32-unknown-unknown targets (First-time contribution by Brennan Kinney)
C++
Nanobind
- Expanded default arguments support to Nanobind
- Added support for docstrings and stubgen (First-time contribution by twantonie)
Dart
- Added support for null-aware Dart syntax
- Updated backend to use RecordUse syntax (Contributed by mosuem)
Bugfixes
Diplomat Macro
Diplomat Tool
JS Backend
- JS now does not generate mutable slices (which it does not support)
- diplomat_runtime's JS implementation now uses updated WASM target linkage
- JS now calls enum constructors from within struct fields
C++ Backend
- diplomat_runtime.hpp now compiles with Solaris (First-time contribution by Makoto Kato)
- Fixed struct references failing to compile with non-unit types
- Struct references now compile with references of opaques
- UTF-16 string slices now generate correctly (Contributed by Mark Molinaro, Manish Goregaokar and Claude Opus 4.6)
- Callbacks now accept unique_ptr
- Fixed Result<Option, Err> generation
- Fixed function pointer assignment mismatch on embedded toolchains (First-time contribution by obsking2000)
- Fixed returning references of opaques in callbacks
Nanobind Backend
- Fixed overloaded named constructors failing to build in Nanobind (First-time contribution by Mark Molinaro and AI tools)
- Fixed compiler error on fallible structure constructors that return opaques
- Nanobind backend now always defines struct references as mutable
- Enforce
IndexErrorable indexing operations - Fixed check that bound vector exists in memory
- Fixed overloading issue for const methods and empty arguments
- Fixed include generation info for callbacks
- Fixed stub type for
diplomat::result(Contributed by Mark Molinaro and Claude Opus 4.6) - Fixed compiler issue with string_view_for_slice not generating properly in overrides
- Fixed bound vectors with partial comparisons not compiling
- Properly generate out structs
- Fixed taking opaque references in callbacks
- Fixed lifetime annotations absent on read only properties (First-time contribution by Yazan-Reactor and Claude Fable 5)
Dart Backend
- Made DiplomatFfiUse final
- Agent Driven: Fixed fallible struct constructor compilation
- Agent Driven: Fixed Dart structs borrowing opaques
The Book
- C++ and Nanobind now have typing information and how types connect to the C ABI.
- Improved book organization and links within
- Added documentation on async Nanobind and workarounds
- Added documentation for the new .NET backend (Contributed by irvingoujAtDevolution)
Misc
- Added
-
0.15.204 Aug 2026 -
0.15.108 Apr 2026 -
0.15.031 Mar 2026 -
0.14.027 Oct 2025Nothing published for this version
-
0.13.106 Oct 2025 -
0.13.023 Sep 2025Nothing published for this version
-
0.12.019 May 2025Nothing published for this version
-
0.11.006 May 2025Nothing published for this version
-
0.10.025 Feb 2025Nothing published for this version
-
0.9.023 Nov 2024Nothing published for this version
-
0.8.306 Oct 2025Nothing published for this version
-
0.8.225 Jun 2024Nothing published for this version
-
0.8.120 Jun 2024 withdrawnNothing published for this version
-
0.8.024 May 2024Nothing published for this version
-
0.7.015 Nov 2023Nothing published for this version
-
0.6.021 Sep 2023Nothing published for this version
-
0.5.228 Apr 2023Nothing published for this version
-
0.5.113 Apr 2023Nothing published for this version
-
0.5.017 Jan 2023Nothing published for this version
-
0.4.228 Oct 2022Nothing published for this version
-
0.4.120 Oct 2022Nothing published for this version
-
0.4.026 Sep 2022Nothing published for this version
-
0.3.029 Apr 2022Nothing published for this version
-
0.2.002 Aug 2021Nothing published for this version