Live data from Hacker News

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

github.com

41–50 of 75 posts

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

#41
post #37

Earlier quoted context omitted.

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 pr…

What exactly are you imagining is happening? People just want to use the languages they're familiar with. It does not harm you in any way. You're not going to be forced to start using JS in Bash.

"Why do we insist on using the same one language everywhere?" Who is this "we" you're talking about? Where is this "insistence"? It's not like there is some cabal out there that is organizing a campaign to rewrite everything in JS and also delete everything else. What does it matter to you that people started a new project, that re-implements functionality of a dear, favorite project of yours, without taking resources away from that dear, favorite project? These people, who are only wasting their own time, who would have never worked on your dear, beloved project anyway? If you don't want to use JS, just don't. Stop reading posts about JS.

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

#44
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…

Do you know what specs I used to write Cash? ^ look at the link two parents up.

Do you know how long I spent working on getting the specs right in Cash? Cash isn't perfect, but it took me months of "discipline" before I would let myself do even the initial release, which is `v0.1.0` btw.

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

#46
post #37

Earlier quoted context omitted.

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 pr…

https://github.com/uutils/coreutils - in Rust.

https://github.com/aisola/go-coreutils - in Go.

https://github.com/search?l=Nimrod&q=coreutils&type=Reposito... - in Nim (didn't seem to take off)

You know how people write a to-do list, or a forum, or a blog to better learn a language? Some people write coreutils.

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

#47

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…

Things are changing:

* https://blogs.windows.com/buildingapps/2014/10/07/console-im...

* http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-%28...

* http://www.hanselman.com/blog/Windows10GetsAFreshCommandProm...

No, it's not perfect, and PuTTY isn't always the answer, but who'd have thought https://github.com/PowerShell/Win32-OpenSSH would ever be a thing.

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

#48
well you are just replacing your dependency from cygwin to node.js

think of it, what is the utility to implement shell commands in a cross-platform way ?

only for Windows

You don't need an ES6 implementation of `ls` on Linux and Mac OS X, the tools are already there and yeah they are "ugly" compiled to native executable, but it is exactly what you want for shell commands

so you are basically trying to solve a Windows problem, but sorry you're doing it wrong

Windows problem is not about lacking shell commands, it's about lacking a POSIX environment

sure you want command line utilities like `ls`, but those are mainly useful when run inside a POSIX environment, and that is exactly the problem that cygwin have solved.

Now about some statements

"No ugly DLLs":

try to do a `ldd /bin/ls` on a Linux system you will see dependencies on `libc.so`, `libselinux.so`, etc. having tool like `ls` being dependent on `cygwin.dll` etc. is perfectly normal, nothing ugly about it

"Works in any terminal":

all the cygwin binaries can work inside a `CMD.exe` prompt, just add the "C:\cygwin\bin" path to your environment variables.

when you run Bash shell like Mintty, you also have access to the `CMD.exe` environment on top of the POSIX environment, for ex: you can call powershell scripts.

"Let's mix some Windows & Unix commands together"

`$ ipconfig | grep IPv4 | sort` works perfectly fine under Cygwin with bash

"but I only want certain commands"

maybe use package management, for ex you could use apt-cyg with cygwin, and do things like `$ apt-cyg install ncurses` or `$ apt-cyg remove ncurses`

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

#49

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.

doing about the same here but using only cygwin and cygrunsrv to run sshd

it work quite well, and yeah ssh to a windows box with a real shell is definitively something you want :)

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

#50
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.

I have no problems with powershell wanting to pipe "objects" but I still want a POSIX environment under Windows.

And about why POSIX deserve to win ?

For me it's about cross-platform command-line, I need to be able to run command-line tools that just behave the same under Windows, Mac OS X and Linux.

So far, Windows has ignored the command-line for years, and when they don't ignore it they change it every couple of years, from scripting hosts WSH to PowerShell to whatever else ...

Just sayin' it's hard to take Windows seriously when it come to the command-line environment, it is a huge mess.

Post reply on HN