Live data from Hacker News

Gonix – Unix tools written in Go

github.com

81–85 of 85 posts

Re: Gonix – Unix tools written in Go

#81

Earlier quoted context omitted.

I'd love some help. I'm juggling 3 side projects right now, and it's hard making time for all of them. :)

I linked it in the readme so all those people visiting my project will see yours. I can't help much myself (you are way ahead of me), but more people should visit your project now.

Thank you! That's very generous of you.

Re: Gonix – Unix tools written in Go

#82

Earlier quoted context omitted.

I linked it in the readme so all those people visiting my project will see yours. I can't help much myself (you are way ahead of me), but more people should visit your project now.

Thank you! That's very generous of you.

No problem.

Re: Gonix – Unix tools written in Go

#83

Earlier quoted context omitted.

I'm curious: what was your main motivation? I can understand it as a worthy challenge, but it would probably have led to a worse performance than the C-based utilities, no?

Simplicity mainly, memory management. while ( ) print; makes for a pretty simple core of cat. At the time I had written a source management system (nselite, morphed into teamware) almost entirely in perl except for one C program that was performance sensitive. And I just really liked perl4 at the time.

Thanks for answering. I guess then what you had in mind was a change in the syntax of the shell itself, right? I'm a casual user of POSIX utilities and the typical shells, and have yet to try Perl! In any event, your last sentence pretty much validates what I had in mind. Thanks again.

Re: Gonix – Unix tools written in Go

#84

Earlier quoted context omitted.

I'm curious: what was your main motivation? I can understand it as a worthy challenge, but it would probably have led to a worse performance than the C-based utilities, no?

It would be pretty cool if all applications on your system were written as scripts, especially if they are very simple scripts, as it means you can open any of them in a text editor and see what they do. It means you can modify any of them just as easily. I remember one time when I needed information about how much CPU usage a program was using, I could see it in the output from `top`. So to figure out how `top` was…

Thanks for your reply. Yes, the ready availability of the code would be a plus. In my mind utilities like grep or sort are very sensitive in terms of performance, but that's just an impression.

Re: Gonix – Unix tools written in Go

#85

Earlier quoted context omitted.

It would be pretty cool if all applications on your system were written as scripts, especially if they are very simple scripts, as it means you can open any of them in a text editor and see what they do. It means you can modify any of them just as easily. I remember one time when I needed information about how much CPU usage a program was using, I could see it in the output from `top`. So to figure out how `top` was…

Thanks for your reply. Yes, the ready availability of the code would be a plus. In my mind utilities like grep or sort are very sensitive in terms of performance, but that's just an impression.

Oh yes, absolutely. That is the big tradeoff.

One could hope that with many of these utils they're mostly IO bound, and so a scripting language wouldn't change that much. I know at one point I actually had a python based md5sum that was faster than the regular gnu one for big files - as it loaded the data off the disk in huge chunks.

I believe ack-grep was written in perl? And that's pretty fast.

Also - how fast does it Actually need to be? It's not high-frequency-trading or a 60fps game... A computer these days can probably load perl, run a script, and display the output faster than a computer from 20 years ago could run the original c util... And if everything is written in it, then a lot will be already in memory. If your shell is written in it too, then you could just call the utils from within there, rather than having to fork/exec it anyway.

For most higher level scripting languages (such as perl, python, ruby, etc). Things like regexps and hash tables are written in c underneath anyway.

With a lot of shell scripting, you call many many utils many times - which would slow everything down hugely if you needed the scripting language startup costs each time. However, if you use the same higher-level scripting language to write all your scripts in - rather than writing SH scripts that call your utilities, then you might even get faster than SH calling external utils (possibly). (If that makes sense...)

Post reply on HN