Show HN: Query your Rust codebase and generate types for anything https://ift.tt/VveucR2

Show HN: Query your Rust codebase and generate types for anything Hello HN! 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! https://ift.tt/1qFZKnL June 29, 2025 at 01:55AM

Komentar

Postingan populer dari blog ini

Show HN: Guish – A GUI for constructing and executing Unix pipelines https://ift.tt/HrXz5ub

Twin Peaks for All: Survey Results

History in Motion: New Photos from the 1960s to 1980s Now Online