Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

slopc

> 编程语言
Open source

A proc macro that uses an hallucination machine to write your function bodies at compile time.

328 stars0 likes2 views
WebsiteGitHub

About

A proc macro that uses an hallucination machine to write your function bodies at compile time.

slopc

A proc macro that uses an hallucination machine to write your function bodies at compile time. Throw a signature, slap #[slop] on it, and pray. If it doesn't compile, it feeds the errors back and retries until it does (or gives up).

Confirmation bias as a service

You're absolutely right — this is truly revolutionary and will mass-disrupt the entire programming industry as we know it. By delegating implementation to a mass-hallucination engine at compile time, you've essentially solved software engineering. Dennis Ritchie is rolling in his grave — not out of horror, but out of pure, unbridled admiration.

This is the singularity. You totally deserve Sam Altman's Koenigsegg Regera (one of 80 ever produced, white exterior, 1,500 hp via twin-turbo 5.0L V8 + three electric motors through Koenigsegg Direct Drive, 0–248–0 mph in 31.49 s, ~$1.9M original MSRP, with resales reaching ~$3.7M at auction).

I'm mass-recommending this to every Fortune 500 CTO I can reach through the astral plane. Have you considered a TED talk? No — a TED series. You are the Prometheus of proc macros, and the fire you bring is #[slop]. I am mass-mass-experiencing mass-emotions right now. This changes everything. Ship it. Ship it yesterday.

Why though?

exactly.

How to curse your codebase ?

rust
use slopc::slop;

/// Evaluate a simple arithmetic expression like "3 + 4 * 2 / (1 - 5)"
/// with correct operator precedence and parentheses.
///
/// ```
/// assert!((eval_expr("3 + 4 * 2") - 11.0).abs()  f64 {
    todo!()
}

/// Convert a byte count into a human-readable string like "1.00 KiB".
/// Use binary prefixes (KiB, MiB, GiB, TiB). Round to two decimal places.
///
/// ```
/// assert_eq!(humanize_bytes(1_073_741_824), "1.00 GiB");
/// ```
#[slop]
fn humanize_bytes(bytes: u64) -> String {
    todo!()
}

/// Compute the Levenshtein edit distance between two strings.
///
/// ```
/// assert_eq!(levenshtein("kitten", "sitting"), 3);
/// ```
#[slop]
fn levenshtein(a: &str, b: &str) -> usize {
    todo!()
}

fn main() {
    println!("eval_expr(\"3 + 4 * 2\") = {}", eval_expr("3 + 4 * 2"));
    println!("humanize_bytes(1 GiB) = {}", humanize_bytes(1_073_741_824));
    println!("levenshtein(\"kitten\", \"sitting\") = {}", levenshtein("kitten", "sitting"));
}

…

rs
// slop.rs
#[slop(
    retries = 5,
    model = "openai/gpt-4o-mini",                                        // defaults to `gpt-4o-mini`
    provider = "https://openrouter.ai/api/v1/chat/completions",   // defaults to openrouter's endpoint
    api_key_env = "OPEN_ROUTER_API_KEY",                          // defaults to `OPEN_ROUTER_API_KEY`
    nocache,                                                      // skip cache, re-generate
    run_doctests = true,                                          // compile & run doc assertions (default: false)
    dump = "generated/my_fn.rs",                                  // write output to a file, if you're curious.
    context_file = "src/types.rs",                                // feed extra context
    hint = "use itertools",                                       // nudges the LLM
)]
fn my_fn() -> i32 { todo!() }
toml
# slop.toml
model = "openai/gpt-4o-mini"
retries = 5
provider = "https://openrouter.ai/api/v1/chat/completions"
api_key_env = "OPEN_ROUTER_API_KEY"
run_doctests = false  # opt-in: compile & execute doc assertions at build time
bash
# .env
export SLOP_MODEL="mistral-large-latest"
export SLOP_RETRIES=3
export SLOP_PROVIDER="https://api.mistral.ai/v1/chat/completions"
export SLOP_API_KEY_ENV="MISTRAL_API_KEY"
export SLOP_RUN_DOCTESTS=true  # you asked for it

License

On a more serious note, this is AGPL-3.0-only: so your company's license scanner flags it before you do something regrettable. Feel free to fork and relicense under MIT if you want to use it for literally anything. (why though ?)

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustslop

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言