top | item 14236830

FuncShell – A Haskell-based alternative to awk

141 points| _iostreamer_ | 8 years ago |github.com

38 comments

order

jaytaylor|8 years ago

Do any of you know how they got such a beautiful looking shell [0]? I'd love to know if there's a clean way to achieve such a nice result.

[0] https://github.com/iostreamer-X/FuncShell/raw/master/fsh.gif

EDIT

As an aside, FuncShell looks like a beautiful demonstration of how powerful Haskell can be. The source code is terse and clean.

The only oddity I noticed isthe rather large 68MB binary file committed into master in the repository [1]. Why do people do this? Especially on GitHub where there's support for cutting releases with a binary for each targeted platform...

[1] https://github.com/iostreamer-X/FuncShell/blob/master/fsh

_iostreamer_|8 years ago

>The only oddity I noticed isthe rather large 68MB binary file committed into master in the repository.

Thanks for bringing it to notice. I did this and later realized I can opt for the github release option[0]. I will fix this and the installation url asap.

[0] https://github.com/iostreamer-X/FuncShell/releases

_iostreamer_|8 years ago

Also, the font is Adobe source code pro.

splintercell|8 years ago

zsh + oh-my-zsh + agnoster zsh theme + powerline

tyingq|8 years ago

Similar idea, but uses sqlite to make an awk like utility with sql syntax: https://github.com/dbohdan/sqawk

ams6110|8 years ago

There's also q, which I've happily used for all sorts of data munging tasks:

https://harelba.github.io/q/

One example from that page:

   ps -ef | q -H "SELECT UID,COUNT(*) cnt FROM - GROUP BY UID ORDER BY cnt DESC LIMIT 3"

gregwebs|8 years ago

Nice! How do I bring new function into scope though? This looks very similar to hawk, which has documentation on how to add your custom code [1].

Also, there are some nice CLI tools for JSON [2] or CSV [3] specific data.

  [1] https://github.com/gelisam/hawk
  [2] https://stedolan.github.io/jq/manual/
  [3] https://github.com/BurntSushi/xsv/blob/master/README.md

codygman|8 years ago

I think hawk should steal the idea of aliasing "|]" personally ;)

baldfat|8 years ago

I always have mixed feelings on awk alternatives. I find awk to be one of the most underused tools in scripting. Awk has saved me numerous of times.

Now replacing latex with a modern syntax would be awesome!!!

RodericDay|8 years ago

I tried to explain to a historian with an open source textbook initiative the basics of latex. As soon as I opened the demo page that had looked nice enough, with him by my side, my heart sank. It's just so far away from being usable by non-technical users.

It's too bad, really.

codewithcheese|8 years ago

I like how you made this version use pipes instead of being a shell. Do you have any plans to create a new JS version of Awkward using pipes?

_iostreamer_|8 years ago

I understand that this caters to a very specific audience which knows haskell. Hence I plan to support JS as the inline language. I don't want to create a new JS version because I want to learn more of Haskell :p

ilurkedhere|8 years ago

In typical usage, do you need the type hints much? I saw ":: Float" in there for the df example, for instance.

_iostreamer_|8 years ago

Not really, in the example of df, I was filtering on the basis of size, which is not int usually but a decimal value, hence I had to provide the type hint.

rocqua|8 years ago

I'm amazed by the powerline-command prompt. Shiny things seem to draw my attention a bit too much.

c0achmcguirk|8 years ago

Haha, me too! I want to read an article on getting my zsh prompt to look like that.