fmtlib Roadmap: C++23 Conformance, Compile-Time Formatting, and Cross-Language Support

TLDR: The fmtlib roadmap focuses on achieving full C++23 std::format and std::print compliance, expanding zero-runtime-overhead compile-time formatting via FMT_STATIC_FORMAT, and stabilizing a C11-compatible API, while advancing SIMD-accelerated floating-point performance and universal Unicode handling.

The {fmt} library serves as the reference implementation for C++20's <format> and C++23's <print> standards, with active development ongoing in the fmtlib/fmt repository. The roadmap prioritizes moving more formatting work to compile time, broadening platform support through a stable C API, and maintaining performance leadership through SIMD optimizations. Recent changelogs indicate a strategic shift toward zero-overhead abstractions that maintain safety across language boundaries.

C++ Standard Integration and Conformance

Recent releases have introduced full C++20 std::format compatibility and extensive C++23 std::print support. According to the source code in include/fmt/format.h and its implementation in src/format.cc, the library tracks the standard closely, with active work on color and style API overloads.

The roadmap targets finalizing C++23 conformance, including complete std::format_to overloads and seamless import std integration for module users. Future development will align the library's behavior exactly with the C++23 specification while maintaining backward compatibility for existing codebases.

Compile-Time Formatting and Zero-Runtime Overhead

A primary roadmap priority is extending compile-time formatting capabilities for embedded and high-frequency applications. The include/fmt/compile.h header provides FMT_STATIC_FORMAT and user-defined literals for constexpr string generation.

The implementation enables format string parsing entirely at compile time without runtime overhead:

#include <fmt/compile.h>
using namespace fmt::literals;

constexpr auto greeting = "Hello, {}"_cf;          // compile-time format string
constexpr std::string_view msg = fmt::format(greeting, "world");
// msg == "Hello, world"

Future work aims to expand constexpr support to more standard library types and enable full static allocation for environments that prohibit dynamic memory. The roadmap also includes exposing more granular compile-time diagnostics through enhanced const-eval checks in the core formatting engine.

Cross-Language Support with the fmt-c API

The library now provides a C11-compatible API that enables type-safe formatting from C code using _Generic dispatch. Implemented in src/fmt-c.cc and declared in include/fmt/fmt-c.h, this interface opens fmtlib to language ecosystems beyond C++.

#include <fmt/fmt-c.h>

int main() {
    fmt_print(stdout, "Pi ≈ {:.5}\n", 3.1415926535);
    // Output: Pi ≈ 3.14159
}

The roadmap prioritizes stabilizing this C API for production releases, adding optional UTF-8 handling for C callers, and distributing a lightweight header-only variant for pure C projects. This expansion positions the library as a universal formatting backend while maintaining the performance characteristics of the C++ implementation.

Unicode, Localization, and Platform Support

Unicode handling is transitioning from opt-in to default behavior across all platforms. Recent modifications in include/fmt/os.h provide correct formatting for std::filesystem::path objects containing Unicode characters, particularly on Windows with MSVC.

Future roadmap items include full Unicode normalization, locale-aware numeric grouping, and optional ICU integration. The library will maintain Unicode as the default while providing FMT_UNICODE flags and other mechanisms for low-footprint embedded builds that require restricted character sets.

Performance Optimizations and SIMD

Performance remains central to the fmtlib roadmap, with ongoing enhancements to the Dragonbox algorithm for floating-point formatting. The implementation in src/format.cc includes cache optimizations and bulk-append strategies that reduce allocation overhead.

Upcoming development targets SIMD-based floating-point formatting, further reduction of allocation overhead through smarter buffer management, and optional -ffast-math pathways for compute-intensive applications. Range and container support will extend to native C++23 ranges integration and concepts-driven formatter selection, improving iterator performance as evidenced by recent optimizations to fmt::join.

Build System and Ecosystem Improvements

The build system roadmap emphasizes supply-chain security and universal package manager support. Recent CMake configurations provide separate targets for fmt-module, fmt-doc, and core components, with improved Conan and Bazel integration.

Future releases will introduce SLSA provenance attestation for all binaries, optional pkg-config files for system-wide installations, and standardized distribution formats. The documentation in doc/api.md will continue to serve as the authoritative reference as the public API surface expands to accommodate C++23 features.

Summary

  • Full C++23 compliance targets complete implementation of std::format, std::print, and ranges formatting specifications.
  • Compile-time formatting via include/fmt/compile.h expands constexpr support for embedded systems requiring zero dynamic allocation.
  • C API stabilization in src/fmt-c.cc enables cross-language adoption through C11 _Generic type safety without runtime overhead.
  • Universal Unicode becomes the default behavior while retaining opt-out mechanisms for constrained environments.
  • SIMD acceleration and Dragonbox algorithm refinements maintain fmtlib's performance lead in floating-point and string formatting.

Frequently Asked Questions

Will fmtlib support asynchronous formatting for C++23 executors?

The roadmap includes architectural support for asynchronous formatting compatible with C++23 executor models. Current buffer management strategies in src/format.cc are being adapted for coroutine integration, though the immediate priority remains synchronous performance optimization and standard conformance.

How does the C API handle type safety compared to standard printf?

The C API leverages C11 _Generic selection to provide compile-time type checking without runtime overhead, implemented in src/fmt-c.cc. Unlike traditional printf, which parses format strings at runtime, fmtlib's C interface validates types during compilation while using the same high-performance Dragonbox formatting engine as the C++ implementation.

Is FMT_STATIC_FORMAT suitable for bare-metal embedded development?

Yes, FMT_STATIC_FORMAT and the utilities in include/fmt/compile.h are specifically engineered for bare-metal environments. These features generate constant expressions at compile time, eliminating heap allocation and enabling formatting in contexts where dynamic memory is prohibited or unavailable.

What is the current status of C++ modules support?

C++20 modules are fully supported through the fmt-module CMake target and import fmt syntax. The roadmap includes deeper integration with import std to minimize compilation times, with module interface definitions maintained alongside traditional headers in include/fmt/.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →