Skip to content

Instantly share code, notes, and snippets.

@RigoLigoRLC
Created January 18, 2025 15:49
Show Gist options
  • Save RigoLigoRLC/a8bbb01d6254c739a18a5cd898af5e05 to your computer and use it in GitHub Desktop.
Save RigoLigoRLC/a8bbb01d6254c739a18a5cd898af5e05 to your computer and use it in GitHub Desktop.
New programming language idea: REvamped SHell, resh. Enjoy the best of both shell script and high level programming languages.
#!/bin/resh
# This is a Unix shell, what's fun about it?
HELLO='Hello,'
CURRENT_VERSION=4
# But here's a twist
# I know you hate C++ style lambda capture
resh [&] {
// But now you code in a high level scripting language
HELLO += ' World!';
// Now you do all the math inside
// Note: type coercion happens :P
CURRENT_VERSION = CURRENT_VERSION ** 4;
// Modify the stuff in outside world, with beloved string interpolation
let export FILENAME = "${HELLO}_${CURRENT_VERSION}";
}
// Enjoy the best of both worlds...?
curl -o $FILENAME https://example.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment