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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Prig – like AWK, but uses Go for “scripting”

77 点作者 benhoyt大约 3 年前

7 条评论

Brian_K_White大约 3 年前
I don&#x27;t like the go requirement when compared to awk which is essentially no requirement at all.<p>And I generally don&#x27;t like reimplementations of things that already exist without a significant justification. (for real I mean, vs for the fun of it or just experimenting or as an excersize to use a new language)<p>Don&#x27;t care much either way about the verbosity because the extra verbosity <i>can</i> also be more consistent and easier to read because of fewer special implicit things to have to just know and resolve mentally.<p>But the execution time is undeniable, and it&#x27;s probably a lot more convenient for typical awk-ish jobs to use something like this than to make a dedicated little c or go program, not to mention, this still lets you treat your code as an interpreted, readable, hackable script, vs an actual c or go program that would have to be an executable.<p>All in all, walking in the door I was predisposed to find this pointless and annoying that some number of people might buy into it and eventually I&#x27;d have to care because something I want some day will require it.<p>But in fact I find it not pointless at all. Nice.<p>And I actually like and use awk. I&#x27;m comfortable and productive with it for the occasional jobs that fit naturally. So comfortable I&#x27;ve accidentally written things that ended up becomming mostly just a big END{} block which could have been done exactly the same way in bash or anything else.
andrewzah大约 3 年前
I don’t really see the proposition value other than runtime. For most awk commands the syntax is succinct and works well. This unnecessarily makes it much more tedious and verbose to… save time not learning basic awk syntax?<p>The awk manual is a pretty light read.
评论 #30519283 未加载
评论 #30519204 未加载
评论 #30517381 未加载
thinkingkong大约 3 年前
Its probably a familiarity thing, but to me the beauty of tools like awk and sed are that theyre relatively simple, compact, and usually everywhere. The DSL is tricky to get past the basics with and I usually reach for another tool at that point anyway.<p>But, whatever language you know already is probably the fastest.
philosopher1234大约 3 年前
I like this because I don&#x27;t have to learn AWK to use it, and I already know Go. Even if AWK is simple, I use it so rarely and every time i do its a return to the manual. With this, I won&#x27;t be so hard for me to use.
评论 #30518917 未加载
evacchi大约 3 年前
I put together a script using JBang (Scripts in Java <a href="https:&#x2F;&#x2F;jbang.dev" rel="nofollow">https:&#x2F;&#x2F;jbang.dev</a>)<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;evacchi&#x2F;7fb37056d92f72ae88157adcbb2f6bea" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;evacchi&#x2F;7fb37056d92f72ae88157adcbb2f...</a>
评论 #30519129 未加载
alex_muscar大约 3 年前
That&#x27;s a nice project idea. Made me try it in common lisp which comes with a compiler built in. It&#x27;s fairly doable. The only downside is the big executable sizes for SBCL and CCL, and the relatively slow startup times for ECL.
评论 #30519570 未加载
评论 #30516231 未加载
tedunangst大约 3 年前
Next in the trilogy: awk2go, like awk2c.
评论 #30516242 未加载
评论 #30516220 未加载