[HN Gopher] Show HN: Gat - cat alternative written in Go
___________________________________________________________________
Show HN: Gat - cat alternative written in Go
Author : koki-develop
Score : 32 points
Date : 2023-04-04 17:15 UTC (5 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| noughtme wrote:
| I've been using ccat (colorized cat) for a while, but this looks
| good too.
|
| https://github.com/owenthereal/ccat
| hhh wrote:
| I always stay strapped with Gat.
| nawgz wrote:
| If I read the command `gat myfile` I would definitely assume you
| were trying to delete it with prejudice.
|
| I would be surprised to see it print to my terminal.
|
| Edit: why downvotes? You can't use words as commands that invoke
| a completely different set of connotations than the commands
| execution does
| __MatrixMan__ wrote:
| Given that a `gat` has both an input-side and an output-side, I
| think it resembles `cat` reasonably well. I'd expect some kind
| of buffering difference so that the output is "faster" than the
| input in some way.
| netsharc wrote:
| Looks like the connotation in your head is really obscure,
| because the downvoters (I'm guessing), a sibling commenter, and
| I are wondering why "gat" could mean "delete"?
| nawgz wrote:
| The dictionary definition of "gat" is "revolver", does that
| really qualify as "obscure"?
|
| Anyways, in terms of usage I've heard, it is almost
| exclusively implying you'll brandish and/or apply your gun,
| maybe this part is more obscure, but if I wrote "stab myfile"
| I don't think you'd expect me to put the contents in a
| buffer.
| netsharc wrote:
| Well I had to check the dictionary to see what you mean.
|
| "stab" would be obvious, but maybe someone needs to go out
| and ask 100 or a 1000 people on the street what they think
| of when they hear the word "gat", and maybe then you can
| congratulate yourself for being in an exclusive minority.
| nawgz wrote:
| Perhaps it's not fully mainstreamed, but looking at the
| current conversation it looks to me like the idea is
| widespread. Really though, I also see no other other
| usages of the term online, it surprises me you would not
| simply type in "gat" to a search engine and easily
| understand my point.
| t-3 wrote:
| I assure you, gat is a common slang, most Americans on
| the street would be able to tell you that it's a gun.
| morelisp wrote:
| It's slang, but it is well-known slang (and there's not
| really some other common meaning).
|
| https://en.wiktionary.org/wiki/gat#Verb
| jwilk wrote:
| Why delete?
| cosmojg wrote:
| "gat" is slang for "shoot and kill (with a gun)"
| bilinguliar wrote:
| U-root implementation:
| https://github.com/u-root/u-root/blob/main/cmds/core/cat/cat...
| Simplicitas wrote:
| Great to have alternatives, but wish there was a "Why" section in
| readme
| imoverclocked wrote:
| Right, does it do things faster? Or somehow more efficiently?
|
| It seems that this is probably slower and consumes far more
| resources than cat. It also does pretty printing and syntax
| highlighting. From a Unix standpoint, I would say this is not a
| cat replacement but a pretty replacement.
| 5e92cb50239222b wrote:
| I just tried both gat and bat to see if they could really
| replace cat (spoiler: they cannot -- unlike cat they soak up
| all input before outputting anything, and crash with out of
| memory very quickly).
|
| A cat alternative would have to handle this correctly:
| $ </dev/zero cat >/dev/null
|
| or it's not really a _cat_ alternative. (Yes, variations on
| this theme are very useful in scripts and daily shell
| hacking).
| morelisp wrote:
| That's wild given that Go makes it harder to read a whole
| file than read a block at a time.
| nasretdinov wrote:
| Oh, absolutely not! ioutil.ReadFile and you're done!
| skulk wrote:
| Here is where the file is read in its entirety.
| https://github.com/koki-
| develop/gat/blob/c16dbf999b89b46ed17...
| awestroke wrote:
| I'll stick to bat
| johndoe0815 wrote:
| They should have called the tool "gato" (Spanish for "cat")...
| ccoreilly wrote:
| "Gat" is catalan for "cat"
| AzzieElbab wrote:
| and the rust version of cat should have been called "rat"
| instead of "bat"
| forty wrote:
| The go version could also be called "fat", given the size of
| go binaries ;)
| jpe90 wrote:
| I would be curious to see how it compares to similar tools:
| https://github.com/sharkdp/bat/blob/master/doc/alternatives....
| rascul wrote:
| Nitpick about bat: it bothers me that they call it a drop in
| cat replacement. It is not.
|
| But it's a very useful tool that I use often.
|
| I'm not familiar with ccat but at a quick glance it does not
| appear to be a drop in cat replacement either.
| przemub wrote:
| Both gat and bat seem more like a replacement for less, not cat
| to me!
| knoebber wrote:
| Has anyone made a "cat" like tool that uses treesitter under the
| hood?
| [deleted]
| [deleted]
| coffee-- wrote:
| Similar to https://github.com/sharkdp/bat but Go instead of Rust
| badrabbit wrote:
| What is the terminal or share they use in screenshots at that
| readme?
| fabrixxm wrote:
| Looks like any terminal with a ">" as prompt. The rest is the
| output from bat.
| qbasic_forever wrote:
| Looks like fira code font https://github.com/tonsky/FiraCode
| and the color scheme is similar to the soft default Alacritty
| terminal uses https://alacritty.org/
| nesarkvechnep wrote:
| A missed opportunity to name it `rat`.
| vlugorilla wrote:
| gat is cat in Catalan: https://lingva.ml/ca/en/gat
| HopenHeyHi wrote:
| Flying rat > Earthbound rat
|
| Besides, this way I can type 'man bat' and scowl.
___________________________________________________________________
(page generated 2023-04-04 23:02 UTC)