Back to directory

sigil-stitch

A Rust library for type-safe, multi-language code generation that tracks imports, resolves naming conflicts, and produces width-aware formatted output.

Visit website (opens in a new tab)rust-codegen-group.github.io
sigil-stitch

sigil-stitch generates source code for multiple target languages from Rust. It combines a JavaPoet-style builder and CodeBlock model with Wadler-Lindig pretty printing, so generated code is automatically formatted and import-aware: type references written with the %T specifier are tracked automatically, and naming conflicts are resolved for you.

The library offers two ways to build code: a programmatic builder API for dynamic generation, and a sigil_quote! macro for writing target-language code inline with $T/$S/$N/$L/$C/$V/$W interpolation markers. The macro also supports structural annotations, type-name joins, splicing of code blocks, meta-conditionals, compile-time iteration, and language-aware handling of paren-delimited blocks such as Go's const(), var(), and import().

It targets Rust edition 2024 and MSRV 1.88.0, and depends on pretty for formatting, serde for JSON/YAML round-tripping of specs, and snafu for structured errors.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.