effekt
effekt copied to clipboard
Shebang support
I think it's fun to have scripts written in Effekt that are directly invokable.
To that end, we might want to strip the first few lines starting with #! from source files...
Here's an example:
#!/usr/bin/env effekt
def main() = println("hello")
Here's a different example using effekt-nix:
#!/usr/bin/env nix
#!nix run github:jiribenes/effekt-nix
def main() = println("hello")
rustc seems to just skip lines starting with #! at the beginning of the file:
https://github.com/rust-lang/rust/blob/f9c15f40fbd7b4ba1baea6fb89551274047e17b3/compiler/rustc_parse/src/lexer/mod.rs#L49-L59
This would be even more useful if we wouldn't recompile the standard library every time :)