5 ms·
For those unfamiliar with Common Lisp there is also Babashka which allows for Clojure shell scripting without the JVM startup time. https://github.com/babashka
by lambdaba 6y ago
For those unfamiliar with Common Lisp there is also Babashka which allows for Clojure shell scripting without the JVM startup time.
https://github.com/babashka/babashka https://github.com/babashka/babashka
- nerdponx 6y agoCommon Lisp itself has Roswell, which I am disappointed to see is not even mentioned in the article. https://github.com/roswell/roswell https://github.com/roswell/roswell
- Jach 6y agoIt's sort of mentioned indirectly at the beginning in that source-code scripts that use a shebang, or make use of exit, can introduce development barriers. I've not written many CL scripts but I like Roswell too, and haven't found those barriers significant/odd to work around. I agree Roswell is definitely worth checking out. (Plus at least for me it gets even more use by letting me trivially run my tests with alternate CL implementations...) Like, I didn't even consider including "some ugly reader macros" to handle the shebang issue, since my approach has been to comment it out while developing and uncomment once I was ready to use it as a script. But I think this simple macro I put just now in my $HOME/.sbclrc file should suffice: (set-dispatch-macro-character #\# #\! (lambda (stream subchar arg) (declare (ignore subchar arg)) (read-line stream nil (values) t) (values))) And in some programs (not scripts) where I make use of uiop:quit, I just don't call those paths during dev, but this is the same approach the article has differentiating calling run vs toplevel.
- vindarel 6y agoAbout uiop:quit, that sometimes are in the middle of a script: lately I have wrapped it around a check of the nature of the terminal: if the terminal is dumb ($TERM), we are very likely inside Emacs/Slime, so we don't quit. https://github.com/vindarel/termp https://github.com/vindarel/termp
- Kelamir 6y agoJudging from the logo, the name is derived from the Russian word Babushka, which stands for a granny.
- lambdaba 6y agoIndeed, it's a lovely name
- bmitc 6y agoA quote from that link: > Life's too short to remember how to write Bash code. Hard agree.
- idolaspecus 6y agoLife’s too short to not learn how to write bash code.
- exdsq 6y agoI love writing bash!
- deleted 6y ago[deleted]
- fctorial 6y agoI'm astonished that we haven't moved past bash.
- blacktriangle 6y agoI'm not. "Everything is a string" is an incredibly powerful worldview for tying systems together where those systems never put any thought into interoperability. Any realistic bash alternative would either need to rewrite the entire user land with a more structured exchange format like JSON or .NET objects, or ship with adapters for most every command line tool we use.
- JasonFruit 6y agoI really feel bad that I don't write more Bash, but every time I learn some, it's gone. I cannot retain that language, and I don't understand why: I'm a language gourmand, in general. But I throw Python, Scheme, or even Nim at little scripts every time, because I have to look everything up if I do it in Bash.
- azalemeth 6y agoI've always internally thought that there are some languages that our brains just _don't_ like. I used to think that there was "something wrong" with me for finding C++ verbose and C expressively dangerous, or to find myself reaching for multi-line awk, sed, and bash scripts that did _stupid_ things when I "knew" that a better solution existed but I didn't know how to _express_ that solution concisely. Perhaps a more concrete example would be this: I don't use python often and some of its syntactical quirks get me every time -- like, for example, None as a method to insert a new axis by convention in numpy (so much so that numpy define np.newaxis as an alias to it). It makes total sense but at the same time, the fact that the language likes having what almost looks like a C NULL as a method to insert a dimension seems...wrong, like it should be a syntax error. I've now just come to realise that hey: if you can't express this concept well in one language, and you _can_ in another, it's well worth prototyping the solution in the right domain and one could always write something in a "sensible" language later if it turns out to work.