Discover and explore top open-source AI tools and projects—updated daily.
shorwoodAI-powered compile-time code generation for Rust
New!
Top 88.1% on SourcePulse
A Rust procedural macro, shorwood/slopc, automates function body generation at compile time using large language models (LLMs). It targets developers seeking to delegate implementation details to AI, aiming to accelerate development by synthesizing code based on function signatures and documentation.
How It Works
The #[slop] macro captures function signatures, doc comments, and context from Cargo.toml, feeding this information to a configured LLM API. It then attempts to generate a valid function body. If compilation fails, slopc feeds the rustc errors back to the LLM for iterative refinement and retries generation up to a specified limit. Generated code can be cached to reduce LLM API costs and build times.
Quick Start & Requirements
slopc as a dependency in your Cargo.toml.OPEN_ROUTER_API_KEY, MISTRAL_API_KEY) or a slop.toml file.#[slop] attribute to functions with todo!() bodies.nocache), doctest execution (run_doctests), and providing additional context files.Highlighted Details
rustc compiler errors.slop.toml.target/slop-cache/ to reduce LLM API costs and build times.Maintenance & Community
No specific details regarding maintainers, community channels (Discord/Slack), or roadmaps are provided in the README.
Licensing & Compatibility
Limitations & Caveats
The project's AGPL-3.0-only license presents significant copyleft obligations. Its reliance on external LLM APIs incurs costs and potential unreliability. The satirical tone of the README suggests the project may be experimental or intended for niche use cases rather than robust production environments. Generation success is not guaranteed, and the system may "give up" after retries.
3 weeks ago
Inactive
PLSysSec
ezelikman
algorithmicsuperintelligence