by subset on 11/25/23, 12:22 PM with 33 comments
by themk on 11/25/23, 4:05 PM
My main use for this is incremental migration away from bash. I'm not saying this is the best way to do scripts, but it's a pretty great stepping stone. Just following the cargo culting guide [0] can already uplift a bash script without changing the logic too much. From there you can start adding structure.
My secondary use case is little scripts in NixOS/nixpkgs. There are some helpers in there that make it quite convenient.
[0] https://github.com/luke-clifton/shh/blob/master/docs/porting...
by cole-k on 11/25/23, 1:25 PM
It seems a lot less full-featured than https://xon.sh/, but maybe you don't need a lot of bells and whistles for regular usage. I mostly run build, execute, and install commands.
I'm somewhat enticed at the possibility of being able to wrap common executables into forms that are typed (like nushell or elvish) and manipulate them in a way that leverages the type checker.
by sshine on 11/25/23, 4:18 PM
https://hackage.haskell.org/package/turtle/docs/Turtle-Tutor...
https://hackage.haskell.org/package/shelly
shh's "Alternatives" section summarises nicely some of the differences between these:
https://github.com/luke-clifton/shh#alternatives
shh has a neat [fmt| ... |] macro that gets you around escaping strings.
shh generally has more Template Haskell support; you may or may not like this.
I am personally leaning towards shh because of its "native pipe style".
by fuzztester on 11/25/23, 1:30 PM
by ben0x539 on 11/25/23, 5:51 PM
by ekiauhce on 11/25/23, 3:50 PM
Yes, you came up with a nice syntax for your Haskell scripts, but what it cost to install all required dependencies on, for example, newly created Ubuntu server?
by williamcotton on 11/25/23, 6:24 PM
https://github.com/williamcotton/fs_playground/blob/main/Scr...
Thanks for this, I’m going to borrow a lot of your concepts, especially the added infix operators, those are slick!