Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Nixar – New design of Linux command line (nixar.work)
130 points by askucher on Nov 16, 2015 | hide | past | favorite | 62 comments



I am a developer. I have experience of working in different programming languages like C#, Haskell and Javascript. I noticed that all of them has similar library. Prelude for Haskell, Linq for C# and Undercore for Javascript. A lot of functions are common: map, filter, concat, join and so on. In daily life I need work linux shell and got the understanding that this kind of library can be applied in shell as well. So I rolled my sleeves and implemented the prototype. It would be great to read your comments. Thank you


Sorry to be pedantic but I presume you're not a native English speaker? 'Joyable' is not an English word, but rather the name of a startup company[1]. Perhaps you're looking for 'joyful'. 'Checkout' when spelt as one word refers to the place in a supermarket where you pay for the things in your basket. When you ask people to look at something, it's usually spelt as two words (as in 'check this out').

[1]: https://joyable.com/


It was probably 'enjoyable'. That was one fault that didn't stop me reading on. While we're at it though, 'Checkout' used incorrectly did stop me, however, because in the software context 'checkout' could refer to more than just supermarkets. I'd fix that one. Especially on a call to action. I'd also fix 'fine file'.

Scoring grammar points could be seen as nitpicking, but I think in a Show HN situation, where fair criticism is welcome, it's helping to improve presentation and conversion rates. If some kind of 'foreign bias' kicks in for some visitors you might lose the conversion completely. Copy counts. In any language.


>'Joyable' is not an English word

I honestly just assumed it was some new piece of web development jargon (like "RESTful") that I had somehow missed, and kept reading assuming it would somehow explain itself.


Nice exercise. But for utility - I have been doing the same things 15 years ago with the standard shell tools: awk, grep, sort, tail, head, cat, tac. Nothing wrong with old tech.


Interesting. I am gonna try it in the coming days.


In same directory

time ls -al | awk '{print $1,$3}' real 0m0.008s user 0m0.000s sys 0m0.004s

time ls -al | col 1 3 real 0m1.690s user 0m1.143s sys 0m0.173s

While I appreciate the effort, it seems to me that this decreases the snappiness of the unix terminal experience for not much gain.


Maybe I'm just old hat, but all the examples given I immediately thought of their *NIX equivalent. This doesn't appear to do anything above and beyond what our current tooling gives us (except perhaps 30 years less development).


As the old saying goes, those who don't know unix are destined to reimplement it ... poorly :-)


I think I agree with you for most of them. However I'm not sure how to pull off 'turn'. And if you don't know bash extremely well I'm sure there's a readability win here.

Not sure if it's enough to get node installed everywhere I go, though.


Most of these could be written as bash aliases, so not really a great win for node...


sc [1], the venerable text mode spreadsheet, has `pt' (transpose) command.

And yes, it's a visual program, in that you operate on grid of cells.

[1] http://www.linuxjournal.com/article/10699


I agree. I could see this being, for lack of a better phrase, a gateway drug for some to the full power of the *NIX userland.


what is 'turn' ; their docs site is broken


'turn' is a fun way to get an out of memory error on a large input. Looking at the source, there are no options to limit line length or buffering amount. A naive implementation of an amateurish idea, like all the other commands, but with a greater potential for suffering.


rs(1)'s transpose


The Unix command line probably started off small and clean until the real world intruded and commands needed slight variations. Then arguments, parameters, redirections expansions, expressions, and all that other stuff was added as a necessary evil.


The earliest shell had most of these! [1][2]

Arguments, parameters, pattern matching, redirection, piping.

Surprisingly, this wasn't enough so Bourne became defacto in Unix v7.

Indeed, Thompson shell was small and clean, but it wasn't a spartan as you might think.

[1] https://en.wikipedia.org/wiki/Thompson_shell [2] http://man.cat-v.org/unix-1st/1/sh [3] https://en.wikipedia.org/wiki/Bourne_shell


The docs show the *nix equivalents before showing the nixar commands. In some cases they're simpler, but I don't think a seasoned shell user would gain much from using this.


This is node.js? no. Golang/C/C++ I can handle, but I'm NOT installing node.js just for this.


I don't know what it is with node.js but people seem to want to reinvent everything with it.


Hipster hubris? The "cool kids" crowd that jumped from PHP to RoR to node.js.

Please don't follow the hype: many of this tools will be abandoned when a new framework/language comes out and this will leave the Unix userspace more fragmented.


  npm install myproject
On mac, windows and anything nix + arm is a very compelling proposition. I'm not trying to say this is unique to node. It is what it is.


Maybe it's just that that's the tooling/language that the author knows. I've been guilty of writing a tool in the language I'm most familiar with whether the greater community thought it was a good idea or not.


It was the same thing with PHP back in the day.

Node is a better language, but not by much. And the fact that it's easy to get started means you'll see a lot of this.

My opinion? Node.js should only be used for streamed or evented data. It's just not built for other uses.


This xkcd comic seems relevant: https://xkcd.com/1508/


It's possible that if this were the case for some other platform, that would be seen as positive.


CV padding


Exactly my thought. Apart from the fact that it doesn't add anything to my existent Tool-chain at the moment.


Another example of Atwoods Law, 'any application that can be written in JavaScript, will eventually be written in JavaScript.'


These are all basic CLI and text processing tools, so it's not something all that grandiose to do in Node.


It would be far more reasonable if "nixar" was a set of aliases or just a bunch of bash scripts ...

something like

    alias count='wc -l'
or

    echo "#bin/sh\nsed \"1, \$1d\"" > drop
    chmod +x ./drop
    cat file | drop 5


Looks really nice from first glance, would need to give it a try for a week or so to see how it really fits in my workflow.

>In daily life I need work linux shell and got the understanding that this kind of library can be applied in shell as well. S

Then why not sticking to unix command names? For example my most used command on linux is "ls", which in nixar is "fs" for some reason. Am I missing something?

I would try to get it to be as close to unix commands as possible, if you really hoping to achieve linux shell feel. And it would be really easy to jump from linux machine to it.

What would be nixar's selling point? Why would users choose it instead of cygwin or minGW?


You probably don't want that. It's a namespacing issue. If you call some new command ls and it has a different API that is a serious affordance issue.


Then how can you have "cat" and not "ls"?


Oh wow, rewriting cat.. that's definitely a mapping/affordance issue.

I assumed cat was cat!


I don't see cat in the list of commands (https://github.com/askucher/nixar/tree/master/commands). cat is cat.


uniq is there, though


I don not understand this. My only question is why? This seems to be one of these tools the author thinks is really good, but in the end nobody will use a tool like this.


Not to mention dependencies it will make you install.


Tried to play my favourite game of "find the license" but couldn't. Anyone else found it?



This makes me excited for some kind of cljs shell. I sincerely dislike bash syntax. I've looked into scheme shell (scsh), but it wasn't that interesting. There's already Planck, which is a quick starting cljs repl. If closurescript can work in excel surely it can thrive as a shell replacement/enhancement.


Have you tried fish? I really like it, both to script and to use interactively.

Some examples:

http://fishshell.com/docs/current/tutorial.html#tut_loops

http://fishshell.com/docs/current/tutorial.html#tut_command_...


The problem for me is that everyone (on Linux/OSX at least) has a bash shell, so investing in learning any other scripting language seems a little futile. Would recomend ZSH + zprezto or Fish for day to day use though.


It's nice to get your thoughts into form in a decently ergonomic shell like Fish and then port it afterwards to nasty old Bash. So definitely worth learning a better scripting language.


"ergonomic" I'm fairly certain that word doesn't mean what you think it means. It's synonyms would be applicable though: well designed, usable, user-friendly; maybe even comfortable, although that seems like it'd be pushing it a bit.


This is true. I probably waste more time thinking about Bash than is useful


Written in node means that devs will be the main user-group ? I normally do not have node installed other then on my Mac (not on servers, not on win-machines).


Welcome to devops, where Node is the new Java.


It's more like:

Now that you learned to compile a BigJar / OneJar and deploying Java got easy, we got a new Tool for you: "nodejs and npm" now you could still try to get all the dependencies on the Production Machines.


I would really be interested in the Nixar commands beeing implemented as normal bash alias commands.


site down, found this: https://github.com/askucher/nixar


If you really want an shell written in Node, why not go all the way and choose both a shell and a terminal written in it. https://github.com/black-screen/black-screen


Interesting. It would be great if it can be integrated with bash/zsh without installing Node.js.

I think you opened up server's root access to HN. You should use sandbox environment for such experiments.


Seems a bit buggy. I just tried `show` on a plist file and got

    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleIconFile</key>
(Actual contents obviously are):

    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleIconFile</key>


I don't see anyone using this except people who want Javascript everywhere. It really doesn't provide anything for anyone else beyond what the established shells are doing that I can see.


I'd love to have some sort of spec to implement this in Go. I'll just go by the source but I love the simplicity compared to the standard Linux commands.


Well, they closed the terminal after echoing a file under /tmp :) That was a bad idea (to give internet a free terminal to "huck").


On the article: replace "Checkout all commands" with "Check out...". The first is a noun, the second is a verb.


grep cat df du ... not that complicated come on..


its really handy, great work




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

Search: