
Resrap is a grammar-based code snippet generator designed to create endless, procedurally generated code using user-defined grammars. Rather than parsing existing code, it operates as a 'parser in reverse,' generating code snippets that adhere to the syntax rules specified in formal grammars. This approach enables the production of realistic-looking or intentionally nonsensical code, suitable for a range of purposes such as stress-testing linters, parsers, and syntax highlighters, generating sample code for display without copyright concerns, and exploring grammar theory.
The tool accepts grammars written in its custom ABNF (Awesome BNF) format, which builds on standard EBNF/BNF notation by introducing features like weighted probabilities and infinite generation. ABNF allows users to specify repetition operators, optional elements, grouping, and infinite loops, as well as assign probabilities to different grammar expansions for more nuanced and varied output. Resrap can generate code snippets deterministically using a seed or randomly, providing flexibility for both reproducible and unpredictable results. Its output is not limited to programming languages; any language that can be described with a formal grammar, including natural languages like English, can be targeted.
Resrap is accessible directly in the browser, allowing users to test and experiment with grammars interactively. The tool is positioned as useful for programmers seeking to generate unlimited code snippets, avoid copyright issues, or create a playground for experimenting with syntax, randomness, and procedural generation. It is made by Arnav and is associated with the OSDC Organization.
No information about pricing or licensing is stated in the provided evidence.
Resrap sits in PulseGate's Other dev tools category. It focuses on generating unlimited, realistic code snippets for testing, demos, and grammar exploration without copyright issues. Resrap is an open-source project aimed at developers. The project is open source (GPL-3.0). The product ships for the web and the command line, and it can be self-hosted.
Resrap first shipped in 2025. The project is developed in the open on GitHub with 12 stars. Among its 5 catalogued features are code generation, grammar support, and seedable output.
Latest indexed changes and source events
Other apps tracked under the same category.