Hacker News new | past | comments | ask | show | jobs | submit login

While I'm cool with writing other language processors in a new language (Lisp written in Cobol anyone?) I'm missing the value of this past the bragging rights.

There was a similar article about writing the LuaVM in Go, to package it in bigger Go applications. I've done lots of C based systems and bolted Lua on, so the Go version makes sense.

But is imbedding Awk into a program that gets done on a regular basis?




I believe in this instance it is the author wanting to level up on AWK and Go. The value is learning and fun.

An AWK interpreter written in Go is unlikely to be an improvement, except, well here is another blog post you might be interested in that has a similar sense of adventurous tinkering (it's about improving on grep): https://ridiculousfish.com/blog/posts/old-age-and-treachery....

That's from 2006 and the tl;dr was graybeards did things a certain way for a reason. And yet nowadays with have things like rg (and ag and a bunch of others).


I think my GP has an objection to it being shared and being on top when there is nothing to learn from this in terms of ideas (which I share) and not to people hacking away.


But now other people who are interested in Go can learn from it. Seems pretty much the point of HN - finding interesting things to learn.


The performance optimization part of the article is very relevant to experienced Go programmers.

Also, pjw, the W in AWK is on the Go team at Google and Kernighan, the K, wrote the canonical Go book.


And Aho, the A co-wrote the most famous book on compilers. I like to think he'd approve of implementing programming languages.


This might be an avenue for programmers who are comfortable in Go but not C to extend a version of the Awk language.

For example I have wished for a long time that Gawk could parse gzipped files so that filenames could be used directly. I could take a run at implementing that in this interpreter where the C version would be more difficult personally.


Is there a reason you can't just use a pipe and process stdin?


That is what I do today. However in the case where metadata is part of the file name, the FILENAME variable is not populated without something else in the pipeline that passes it into the Awk script as a variable.


I look forward to reading this article when I have the time because I am a Go newbie, so a well explained example program will be useful to me. Also, I find language implementation interesting, and I've always admired the AWK language. I for one and glad he did it and wrote an article explaining it.

Finally, I think it is good to see C software being rewritten in more robust languages like Go and Rust, if people are inclined to do so. I don't think rewriting all the C software should be our top priority, especially high-quality programs like AWK, but it's a good overall direction to go when people are interested.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: