Live data from Hacker News

Cash: a cross-platform implementation of Unix shell commands in JavaScript

github.com

31–40 of 75 posts

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#31

Using a terminal in windows was a horrible experience when I had to do it for a (fortunately brief) project a couple of years ago. But I think the real problem isn't the lack of a decent shell; there are already several shells out there that, while not as nice as their modern Unix equivalents, are at least usable. The bigger problem for me was the terminal emulator. Awful fonts, worse rendering, crappy copy/paste, li…

I have one word to say to that bet... no, wait... five... um... how many words is "]]]~3H^\x0b]]"?

But I suppose at least you only had to press one key to type it ;)

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#32

I absolutely love msys2: http://msys2.github.io/ It comes with an easy to use installer and `pacman` package manager. Their repositories have lots of stuff already compiled to windows usage (the silver surfer, gnu global, etc). Also, sshd works mostly out of the box. Ability to ssh to Windows box into a functional shell (not crippled cmd.exe) is a killer feature for me.

Awesome! I don't use Windows except for gaming, but its good to know something like this exist. Just to fill up last information gap, is there any good terminal emulator on windows? I remember using something that came with Cygwin long time ago, and it was slow (I think I used Vim on that).

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#33

I absolutely love msys2: http://msys2.github.io/ It comes with an easy to use installer and `pacman` package manager. Their repositories have lots of stuff already compiled to windows usage (the silver surfer, gnu global, etc). Also, sshd works mostly out of the box. Ability to ssh to Windows box into a functional shell (not crippled cmd.exe) is a killer feature for me.

Awesome! I don't use Windows except for gaming, but its good to know something like this exist. Just to fill up last information gap, is there any good terminal emulator on windows? I remember using something that came with Cygwin long time ago, and it was slow (I think I used Vim on that).

mintty comes with cygwin and msys2. It's the one I use. Other people have recommended other terminal emulators like ConEmu, but those have varying (subpar) levels of Unicode/color support.

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#34
post #27

But they are not written in cool languages therefore should be rewritten :( In all seriousness, I am struggling a bit to see a point in porting everything to JS (beyond a weekend project because why not, let's learn something). I might be a bit out of the loop since it's been a while that I worked on Windows (and have been using msys2 instead of cygwin back then), but how come DDL and native compiling are the issues…

Well if Cygwin weren't a terrible mess, maybe we'd be using it more? It's universally reviled by most folks actually on the Windows platform. The value of this is that it works easily, portably, and with minimal overhead. By bigger question is, why does posix sh deserve to win? It's plaintext pipes approach is really frustrating in 2016.

> why does posix sh deserve to win? It's plaintext pipes approach is really frustrating in 2016.

I think that in many aspects plaintext has won. Many historical records of the last century will be or have already been lost, because of formats that nobody can read.

OTOH, plaintext is readable and supported by almost everything under the sun.

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#35
post #24

Cygwin is a GNU port, not a small, random, and non-compliant[1] subset of POSIX shell utilities. [1] http://pubs.opengroup.org/onlinepubs/009696699/utilities/con...

Utility trumps compliance.

That's not to say that standards are bad and shouldn't be followed. Just that, sometimes, you really don't need a 250 page committee-designed specification to get some basic shit done.

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#36
post #35
post #24

Cygwin is a GNU port, not a small, random, and non-compliant[1] subset of POSIX shell utilities. [1] http://pubs.opengroup.org/onlinepubs/009696699/utilities/con...

Utility trumps compliance. That's not to say that standards are bad and shouldn't be followed. Just that, sometimes, you really don't need a 250 page committee-designed specification to get some basic shit done.

> That's not to say that standards are bad and shouldn't be followed.

(Open) standards-compliance becomes essential if we want our work to outlast us. Yes, we all know design by committee is horrible and gets nothing done. The solution is get rid of specs completely though. I don't trust "javascript developers" to have any sort of discipline. I'm sorry if this sounds like stereotyping but it just seems like a trend that we can't ignore.

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#37
post #35

Earlier quoted context omitted.

Utility trumps compliance. That's not to say that standards are bad and shouldn't be followed. Just that, sometimes, you really don't need a 250 page committee-designed specification to get some basic shit done.

> That's not to say that standards are bad and shouldn't be followed. (Open) standards-compliance becomes essential if we want our work to outlast us. Yes, we all know design by committee is horrible and gets nothing done. The solution is get rid of specs completely though. I don't trust "javascript developers" to have any sort of discipline. I'm sorry if this sounds like stereotyping but it just seems like a trend t…

It does sound like stereotyping. It also sounds very hostile to new ideas. You're essentially telling "javascript developers" to get off of your lawn.

I do actually agree with your point about compliance. It would be really cool if we had a POSIX-conformant set of shell commands written purely in JS, as an alternative to having to find and install compiled binary ports that run on our particular non-Unix systems. At least, it's an interesting idea.

Instead whenever something like this comes up, we see a bunch of grumpy systems programmers waving their fists in the air, as if C is the only language powerful enough to manipulate basic strings in the shell. Seems a bit silly to me when you think about it.

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#38
post #37

Earlier quoted context omitted.

> That's not to say that standards are bad and shouldn't be followed. (Open) standards-compliance becomes essential if we want our work to outlast us. Yes, we all know design by committee is horrible and gets nothing done. The solution is get rid of specs completely though. I don't trust "javascript developers" to have any sort of discipline. I'm sorry if this sounds like stereotyping but it just seems like a trend t…

It does sound like stereotyping. It also sounds very hostile to new ideas. You're essentially telling "javascript developers" to get off of your lawn. I do actually agree with your point about compliance. It would be really cool if we had a POSIX-conformant set of shell commands written purely in JS, as an alternative to having to find and install compiled binary ports that run on our particular non-Unix systems. At…

Sorry, I actually despise C. When all is said and done, Javascript is not a horrible language but Javascript developers have a horrible track record. I know it sounds like saying ($my_country is good but foreach $person in $my_country->people are bad.

However, why do we need to write shell commands in java script? I keep hearing about this new fancy systems language called rust which should be good enough for most projects. Why do we insist on using the same one language everywhere?

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#39
I've used shelljs [0] a couple times now and it works great.

The big benefit is that you get cross platform support and anyone can contribute!

Overall, it just plays well with JS applications. If I have a bunch of domain-specific utils used in my application and I want to use em as I move some files around, using something like shelljs makes it very to mix and match.

I'm interested in giving cash a try, though. It's not immediately clear how it differentiates itself.

EDIT: I just scrolled to the bottom of the README and it has a section on the difference with shelljs. It appears that they have different goals.

[0] http://documentup.com/shelljs/shelljs

Re: Cash: a cross-platform implementation of Unix shell commands in JavaScript

#40
post #15

Earlier quoted context omitted.

http://babun.github.io/ is wonderful. ConEmu is a great container for a tabbed interface of Babun, PuTTY or powershell instances.

Babun seems to solve none of the issues that the original commenter mentioned. Awful fonts, worse rendering, crappy copy/paste, limited size, no split screen or tabs The screenshots on the Babun site show the same 90s-era looking shell container. ConEmu looks to have more features, but is similarly stuck in the Win-98 design aesthetic.

I have none of these issues. Fonts are nice and smooth (I'm using Consolas 10pt). Copy-paste works seamlessly. Limited size? In what regard? I can expand the window as I want vertically and horizontally and I have as much scrollback as I want (you configure it). ConEmu handles the splitting and/or tabs which works wonderfully.

Guess we're in opinion-mode at this point.

Can you provide an example of what you feel is a beautifully designed.. terminal container? We're still talking about the border of a shell are we not?

I must be missing something here.

Post reply on HN