百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

slopc

> 编程语言
开源

一个 proc 宏,它使用幻觉机器在编译时编写函数体。

328 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个 proc 宏,它使用幻觉机器在编译时编写函数体。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustslop

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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