From 2919d75f143c18db516e00116c616682a7c1bb82 Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 18 Feb 2024 16:18:57 +0000 Subject: [PATCH] Add README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..056bd97 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# 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, + +```rs +fn main() { + println!("{}", add(1, 2)); +} + +#[perl { + $_ =~ s/populate/a + b/g; +}] +fn add(a: isize, b: isize) -> isize { + populate +} +``` + +...will compile to... + +```rs +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.