Show HN: Query your Rust codebase and generate types for anything
Show HN (score: 5)Description
As a long-time professional Rust developer. I've always been frustrated by the difficulty and "hackiness" of producing bindings to other languages, whether a frontend, an FFI library, etc.
Not just in Rust but in any language.
After many years of trying existing solutions and trying to make my own, I've finally developed a solution I'm very happy with.
RTK (aka Rust Type Kit) allows you to write Lua scripts that perform queries on your code, such as method calls to Axum's `.route`, function definitions, and more, and then receive rich type information including all argument types, function paths, proc macro attributes, and more.
Your Lua script can then read this information and emit an output file in any language of your choosing. Or, you can emit compiler errors and use it as a linter of sorts. You can even directly re-emit Rust code itself and use this as a richer proc macro solution!
The code example is a bit verbose, so I encourage you to take a look at the repo's README. I look forward to hearing your thoughts, or any usecases you may come up with!
More from Show
Show HN: Wienerdog – memory and self-improving skills for Claude Code/Codex
Show HN: Wienerdog – memory and self-improving skills for Claude Code/Codex The idea of Wienerdog was born out of my experience setting up my own simple but effective system of memory, self-improving skills and hooks for Claude Code and Codex. As I was teaching my friends and colleagues how to set up their own I found myself automating more and more of my system setup and finally I decided to publish it on GitHub to help others get more out of their AI usage.<p>So what is Wienerdog? Simply put, it is just files — no daemon, no server, no telemetry: a collection of instructions and skills that you can install by pasting just one line (npx wienerdog@latest init) and it will give your Claude Code / Codex:<p>- a proper base information CLAUDE.md / AGENTS.md file created by doing a simple, friendly interview with you (existing files are respected — Wienerdog only writes inside its own clearly-marked block). - a persistent, markdown-based memory vault following the PARA convention, similar to the Obsidian vaults many folks use. Already have a vault? No problem, you can just point it to it. - automated ‘hooks’ that will pull in key information (who you are, what you do, etc.) into each session and detect and save critical new information into your persistent memory. - automated daily ‘dreaming’ runs that digest the previous day’s sessions and store their key information into memory. If your computer is off or asleep at that time, the dreaming run will catch up when you're back. - repeating task patterns are identified and turned into reusable skills which can be further improved automatically. - if you are using both Claude Code and Codex (like I do) they will be able to read from and contribute to the same memory vault. You are not locked in to any vendor. - a basic (and optional) integration with the Google suite to give your AI access to your Gmail, Calendar and Drive — read-only and draft-only by default.<p>Everything Wienerdog does can run on your existing Anthropic / OpenAI subscription, in line with their terms. The project is open-source on GitHub and free forever under the MIT license. I do this for fun and to give a little something back.<p>I have put quite a bit of work into Wienerdog already and am happily using it myself for its own development (dogfooding — get it?). In fact, most of Wienerdog's code was written by AI agents following its own spec system, using the memory vault that lives in the repo. With that said, it is still early and a work in progress that could use more eyes. I'd love for you to try it out and ask questions, request new things to add or even contribute on GitHub if you have the time and capacity.<p>P.S. Why the name Wienerdog? Because I love these little tube-shaped snouty sausage clowns :)
No other tools from this source yet.