News for hackers. Stuff that matters.
Re:Common Lisp for Shell Scripting by vindarel on Thursday May 23, 2024 @11:28AM (#40455902)
Nice article, I learned a couple tricks.

A first gotcha:

> you could just replace it with… #!/usr/bin/sbcl –load /home/youruser/.sbclrc –script

this doesn't work, since a shebang only accepts one argument.

---

There are 2 main caveats to the described approach: starting SBCL like this from sources and not from a binary takes a little time. And you don’t have batteries included. Want a HTTP client, a CSV parser? You have to quickload them and this adds up in the startup time.

We can rely on long-running images in the editor and run stuff from there, bypassing the terminal altogether, or build binaries, or try other approaches (Lish shell, a lisp server https://notabug.org/quasus/lserver/)

But that’s why I started CIEL, CL with batteries included. You can get a binary and run scripts that start fast and can do common tasks. It’s also a superset of useful libraries that you can quickload or use with a core image (for a fast startup in your editor).

https://github.com/ciel-lang/CIEL/

http://ciel-lang.org/

It’s in beta, polishing phase.

Re:Common Lisp for Shell Scripting by latexr on Thursday May 23, 2024 @11:57AM (#40456340)
> a shebang only accepts one argument.

I don’t think that’s right. I regularly use `#!/usr/bin/osascript -l JavaScript` as a shebang on macOS and it works as expected. It’s also good practice to use `/bin/zsh --no-rcs` so the script does not load `~/.zshenv`.

Re:Common Lisp for Shell Scripting by bananskalhalk on Thursday May 23, 2024 @12:29PM (#40456729)
It isn't defined in posix. Some bsd:s did split but doesn't anymore, other (which?) does still split. macOS does, linux doesn't. Sun probably did.
Re:Common Lisp for Shell Scripting by phlakaton on Thursday May 23, 2024 @12:15PM (#40456574)
Perhaps this is because osascript can handle '-l JavaScript' as a single arg? The single-arg limitation is a well-known "feature" (ha) of UNIX shebangs.
Re:Common Lisp for Shell Scripting by Xophmeister on Thursday May 23, 2024 @12:18PM (#40456604)
It's true on Linux.