TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Shh: Simple Shell Scripting from Haskell

199 点作者 subset超过 1 年前

7 条评论

themk超过 1 年前
Author here.<p>My main use for this is incremental migration away from bash. I&#x27;m not saying this is the best way to do scripts, but it&#x27;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.<p>My secondary use case is little scripts in NixOS&#x2F;nixpkgs. There are some helpers in there that make it quite convenient.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;luke-clifton&#x2F;shh&#x2F;blob&#x2F;master&#x2F;docs&#x2F;porting.md">https:&#x2F;&#x2F;github.com&#x2F;luke-clifton&#x2F;shh&#x2F;blob&#x2F;master&#x2F;docs&#x2F;porting...</a>
cole-k超过 1 年前
Those of you who use (or used) this as your shell: care to share your experience?<p>It seems a lot less full-featured than <a href="https:&#x2F;&#x2F;xon.sh&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;xon.sh&#x2F;</a>, but maybe you don&#x27;t need a lot of bells and whistles for regular usage. I mostly run build, execute, and install commands.<p>I&#x27;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.
评论 #38414370 未加载
sshine超过 1 年前
shh is a really cool package, and so is turtle and shelly:<p><a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;turtle&#x2F;docs&#x2F;Turtle-Tutorial.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;turtle&#x2F;docs&#x2F;Turtle-Tutor...</a><p><a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;shelly" rel="nofollow noreferrer">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;shelly</a><p>shh&#x27;s &quot;Alternatives&quot; section summarises nicely some of the differences between these:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;luke-clifton&#x2F;shh#alternatives">https:&#x2F;&#x2F;github.com&#x2F;luke-clifton&#x2F;shh#alternatives</a><p>shh has a neat [fmt| ... |] macro that gets you around escaping strings.<p>shh generally has more Template Haskell support; you may or may not like this.<p>I am personally leaning towards shh because of its &quot;native pipe style&quot;.
评论 #38418670 未加载
fuzztester超过 1 年前
Related: has anyone tried scheme shell (scsh) and what is your experiences with it?<p><a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Scsh" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Scsh</a>
评论 #38413716 未加载
评论 #38413632 未加载
评论 #38413536 未加载
评论 #38414134 未加载
评论 #38414103 未加载
评论 #38416605 未加载
评论 #38415683 未加载
ben0x539超过 1 年前
This seems fun! Far too few people who are all &quot;your bash scripts shouldn&#x27;t be 300 lines and have complex logic!&quot; address why people reach for bash scripts in the first place, so kudos for that.
ekiauhce超过 1 年前
You can’t really move away from bash, unless there would be alternative as widely available on different Unix systems as bash is.<p>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?
评论 #38414968 未加载
评论 #38414793 未加载
评论 #38414352 未加载
评论 #38414578 未加载
评论 #38414328 未加载
评论 #38414382 未加载
评论 #38414787 未加载
评论 #38414374 未加载
williamcotton超过 1 年前
Huh, I was just tinkering with the same sort of thing with the same motivations but with F#:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;williamcotton&#x2F;fs_playground&#x2F;blob&#x2F;main&#x2F;Scratchpad&#x2F;PltAwk.fsx">https:&#x2F;&#x2F;github.com&#x2F;williamcotton&#x2F;fs_playground&#x2F;blob&#x2F;main&#x2F;Scr...</a><p>Thanks for this, I’m going to borrow a lot of your concepts, especially the added infix operators, those are slick!