qroc 0.1.0

Perl for procedural macros
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 244.77 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • JellyWX

Qroc

Perl for procedural macros

Have you ever...

  • Thrown a fit over Rust's type system not allowing you to write truly awful code?
  • Really wanted to just generate a tonne of code without having to learn how to correctly write proc macros?

Qroc

Qroc allows you to write Perl directly into procedural macros. For instance,

fn main() {
    println!("{}", add(1, 2));
}

#[perl {
    $_ =~ s/populate/a + b/g;
}]
fn add(a: isize, b: isize) -> isize {
    populate
}

...will compile to...

fn main() {
    println!("{}", add(1, 2));
}

fn add(a: isize, b: isize) -> isize {
    a + b
}

Considerations

This package should be carefully considered before use. The cognitive dissonance of writing Perl alongside Rust is probably too much for even the greatest 10xer to handle. Also, this is blatant developer-environment RCE etc. as a feature. Hence, this package is perfectly safe in SOC2-compliant environments.

Correctness

No effort made.

Compatibility

No effort made. Probably won't work on non-UNIX systems.