6 ms·
Zuo: A tiny Racket for scripting
- nisa 4y agoThere is also Otus Lisp (ol) - http://yuriy-chumak.github.io/ol/ http://yuriy-chumak.github.io/ol/
- soegaard 4y ago> You should use Racket to write scripts. > But for the case where you need something much smaller than > Racket for some reason, or the case you’re trying to script > the build of Racket itself, Zuo is a tiny Racket with > primitives for dealing with files and running processes.
- deleted 4y ago[deleted]
- newaccount2021 4y ago
- butterisgood 4y agoA long time ago I used to really enjoy scsh (https://scsh.net https://scsh.net), for writing scripting applications with scheme. You can get a lot done with it once you get the feel. The last release was 2006 however, and though some folks have ported it to work 64bit, I've completely lost track of how to set that up. Wondering how Zuo and Gerbil stack up to scsh or if anyone here has any opinions to share.
- all2 4y agoGerbil's docs are incomplete right now, which makes starting out for the uninitiated Schemer rather difficult.
- anentropic 4y ago...and been that way for a couple of years at least
- GeoffKnauth 4y agoI just set up scsh again (64 bit macos). First re-installed scheme48, then re-installed scsh. Took 5 minutes. Now I have to re-learn scsh.
- Graziano_M 4y agoIf I want to write scripts in lisp (and I do!) I use babashka. https://babashka.org/ https://babashka.org/. If I'm working on one project for some time I'll write a throwaway bb.edn with tasks for things I need to do often, for example to monitor a kubernetes pod, log it, and hit certain API endpoints. Then when I'm in the project directory I can just run `bb tsj` (e.g. test sign job).
- DonaldPShimoda 4y agoI don't understand this brand of comment, which seem to be fairly prevalent here on HN. Are you saying that you prefer babashka to zuo? Have you actually used zuo? Or did you only want to pontificate on another project with a potentially related goal, but without actually connecting those dots for readers of your comment? My issue (not quite the right word, but close enough) with this kind of comment is it's kind of rude, in my opinion? Like, imagine if you were standing around with some people, and somebody said "I just learned about Zuo! It's this neat Racket alternative that's very small. It's a super cool project, and I've really enjoyed it!" And you reply with "When I want a small Lisp, I use babashka." And you don't connect it to the conversation at hand, and it's up to the other people to figure out what your point is. It's like... it's almost a non sequitur, in some sense. And comments like these seem super common here for some reason. It just kinda rubs me the wrong way, though I guess judging by their prevalence they are not seen this way by most people here, so perhaps my perception is in the wrong.
- jjnoakes 4y agoNot the commenter you replied to, but I see where you are coming from. I see things differently though, I like comments like the above because if I'm interested in Zuo or scripting lisp/scheme in general, I like finding related projects in the comments. I guess I read comments like those as if they started with an implicit "if the topic interests you, here are related things".
- DonaldPShimoda 4y ago> I guess I read comments like those as if they started with an implicit "if the topic interests you, here are related things". Hmm maybe I should try to read them that way and I'd be less bothered. Still, I wish they would actually explicitly say as much. It's only a few words, but (in my opinion) it feels like it completely shifts the tone from "the tool this article is about is useless, use this other tool instead" to an educational/helpful thing, which is much nicer.
- soegaard 4y agoWhat makes zuo easy to use for other projects: Compile "zuo.c" from the Zuo sources with a C compiler. No additional are files needed for compilation, other than system and C-library headers. No compiler flags should be needed, although flags like -o zuo or -O2 are a good idea.
- JonChesterfield 4y agoSource is https://github.com/racket/zuo/blob/main/zuo.c https://github.com/racket/zuo/blob/main/zuo.c - skimmed through it, looks like fairly straightforward C. Quite short implementation.
- homarp 4y agoprevious discussion https://news.ycombinator.com/item?id=31017057 https://news.ycombinator.com/item?id=31017057
- dang 4y agoThanks! Macroexpanded: Zuo: A Tiny Racket for Scripting - https://news.ycombinator.com/item?id=31017057 https://news.ycombinator.com/item?id=31017057 - April 2022 (31 comments)
- ryanianian 4y agoAny examples that would help to compare against other forms of scripting (e.g. bash)?
- strenholme 4y agohttps://github.com/racket/zuo/blob/main/local/tree.zuo https://github.com/racket/zuo/blob/main/local/tree.zuo is a pretty good example. It’s nothing like Bash; it’s a Lisp dialect. The obvious comparison is Lua, which is generally the standard embedded language people use when a scripting language needs to be tiny. I compared its size; Zuo is 55% the size of Lua, so apples to apples, Zuo is only a little over half the size of Lua. On the other hand, Lua uses a Pascal like syntax which is a good deal more Bash like than Zuo.
- cheaprentalyeti 4y agoZua?
- strenholme 4y agoIs Zua a Lua variant the size of Zuo? I like the idea. Going back to the Bash comparison, Bash is huge but the subset ash is pretty small, somewhat smaller than Zuo. Busybox’s AWK is, as I recall, about half the size of Zuo. We can have a POSIX compliant scripting setup (ash + AWK) using around the same amount of space Zuo takes up.
- tekknolagi 4y agoThere's minilua (https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/host/minilua.c https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/host/minilua....) which is used to build LuaJIT (dynasm, etc)
- 0cf8612b2e1e 4y agoAs always with lisps, you’ve got quite a bit of competition in the space of minimal implementations. I like Fennel or Janet. Fennel transpiles to Lua, giving you a pretty big ecosystem for free. Janet was built to be a “modern” tiny Lisp that can run interpreted or AoT compiled.
- LAC-Tech 4y agoFor something scheme like, my mind immediately goes to chibi-scheme. Larger than this for sure, but still statically linkable. If you're willing to dynamically link, guile seems like a good choice. Almost 30 years old at this point, and seems to be getting a bit of a revival with guix.
- LAC-Tech 4y agoSingle C source file. Very cool, it's one of those "let make the decision easy for you" moves, where you might be hesitant to include a scripting lang in your project. The docs mention you can embed Zuo almost as an afterthought, but surely that's the main point of it?
- nerdponx 4y agoThe main purpose seems to be something that you can use in the bootstrap/build process for a bigger application. I believe that's what Racket itself uses Zuo for. A lot more robust than a shell script and just as portable, if not moreso.