Live data from Hacker News

CoreUtils implemented in pure JavaScript

github.com

11–20 of 128 posts

Re: CoreUtils implemented in pure JavaScript

#11
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Because the shell has a lot of room for improvement. Try powershell for a bit. Look at its design, look at the things it can do that the unix shell has problems with. Everything's an object. Instead of passing lines of text, you're passing objects, with properties, types, etc. This becomes important because of Library files are first class citizens. Because the shell is string based, you have to wrap everything up in…

Annoyingly they're "good enough". Default shell will always stay sh-compatible. Scripts will always default to bash. I'd love for something like powershell to take over the unix world (ok, not exactly powershell, it has its problems too), but I don't think that's going to happen for the next 20ish years.

Hybrids like ipython shell are quite interesting for personal use though.

Re: CoreUtils implemented in pure JavaScript

#12
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Because the shell has a lot of room for improvement. Try powershell for a bit. Look at its design, look at the things it can do that the unix shell has problems with. Everything's an object. Instead of passing lines of text, you're passing objects, with properties, types, etc. This becomes important because of Library files are first class citizens. Because the shell is string based, you have to wrap everything up in…

Powershell is a great programming language an not a bad shell in and of itself, but using it in the same manner as a shell is quite painful. I tried to rewrite some of my ksh stuff in Powershell after getting a job at a mostly Windows-only shop. Basically every ten-line function ended up into a fourty-line superthing that's subtly incomprehensible to anyone who doesn't know .net.

I get why Powershell is great for sysadmins (and especially on Windows, where so many system-level utils weren't built with the idea that you'd pipe their output in mind), but for me, it's a step back.

Re: CoreUtils implemented in pure JavaScript

#13
post #8
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Some people would agree with both statements. UNIX shells are amazing and the recent improvements in their UX and environment integration is great. (git repo status, programming environments, intelligent completion, the whole of oh-my-zsh, ...) But as soon as you want to do anything moderately interesting, it's better to grab a real programming language, because UNIX shells suck. Escaping failures, whitespace handlin…

If someone were to make a distro with powershell instead of the unix shell I'd lose my mind.

Re: CoreUtils implemented in pure JavaScript

#14
post #5

As far as I can see, what's been implemented is a shell in JavaScript, which emulates a bunch of coreutils by treating them as built-in keywords. It's kinda cool I guess (I don't use Windows), I just don't get why the tagline is "Cross-platform Linux without the suck". Apart from the phrase "cross-platform Linux" not making sense in this context, I don't see why other implementations inherently "suck".

I don't understand this at all. UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? Does the result suck so bad that it just wraps around becomes good again? Is the "way forward" recombining and rehashing the terrible technologies everyone is familiar with already, indefinitely?

Yes, I don't understand it either. "No ugly DLLs" but you have to run everything in Node.js. There are a few technologies that have tried to do something better than Unix shells, like Microsoft's PowerShell. It has a lot of failings, but it gets a lot of things right. I am always stunned when I see Windows folks stumbling around in cmd.exe when PowerShell has been installed standard for a while now.

There's still a lot of room for improvement.

Re: CoreUtils implemented in pure JavaScript

#15
post #8
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Some people would agree with both statements. UNIX shells are amazing and the recent improvements in their UX and environment integration is great. (git repo status, programming environments, intelligent completion, the whole of oh-my-zsh, ...) But as soon as you want to do anything moderately interesting, it's better to grab a real programming language, because UNIX shells suck. Escaping failures, whitespace handlin…

However, if you want to string programs together and script pre-written code, everything except UNIX shell sucks.

Re: CoreUtils implemented in pure JavaScript

#16
post #8
post #7

Earlier quoted context omitted.

> UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? What do you mean by "UNIX shells suck"? I'm fairly sure most people would consider UNIX shells to be one of the bigger revolutions in computing.

Some people would agree with both statements. UNIX shells are amazing and the recent improvements in their UX and environment integration is great. (git repo status, programming environments, intelligent completion, the whole of oh-my-zsh, ...) But as soon as you want to do anything moderately interesting, it's better to grab a real programming language, because UNIX shells suck. Escaping failures, whitespace handlin…

The next step up would then be a REPL shell. As much as I love the idea of us running Lisp machines, at least $SHELL has a moderate enough learning curve that both beginners and experts can exploit many of it's features. Plus while many (most?) of us are programmers, there are quite a number of administrators who don't enjoy coding or even can't code at all. $SHELL is entry level enough that even they can chain a few commands together where a fully featured programming language's REPL shell would just intimidate them away from the command line entirely.

This is, in my opinion, the beauty of UNIX shells. They're simply enough to use like DOS but powerful enough to use like a REPL. It's not perfect; far from it. But few other tools support such a wide demographic.

Re: CoreUtils implemented in pure JavaScript

#17

Earlier quoted context omitted.

I don't understand this at all. UNIX shells suck. Javascript sucks. How could one implement a UNIX shell in Javascript and have it not suck? Does the result suck so bad that it just wraps around becomes good again? Is the "way forward" recombining and rehashing the terrible technologies everyone is familiar with already, indefinitely?

Yes, I don't understand it either. "No ugly DLLs" but you have to run everything in Node.js. There are a few technologies that have tried to do something better than Unix shells, like Microsoft's PowerShell. It has a lot of failings, but it gets a lot of things right. I am always stunned when I see Windows folks stumbling around in cmd.exe when PowerShell has been installed standard for a while now. There's still a l…

I use cmd a lot more than PS because:

1. Win+R -> cmd enter is a lot faster than Win+R -> powershell enter

2. cmd starts faster than powershell

3. I seldom require all the power from powershell

Re: CoreUtils implemented in pure JavaScript

#18

Earlier quoted context omitted.

Because the shell has a lot of room for improvement. Try powershell for a bit. Look at its design, look at the things it can do that the unix shell has problems with. Everything's an object. Instead of passing lines of text, you're passing objects, with properties, types, etc. This becomes important because of Library files are first class citizens. Because the shell is string based, you have to wrap everything up in…

Powershell is a great programming language an not a bad shell in and of itself, but using it in the same manner as a shell is quite painful. I tried to rewrite some of my ksh stuff in Powershell after getting a job at a mostly Windows-only shop. Basically every ten-line function ended up into a fourty-line superthing that's subtly incomprehensible to anyone who doesn't know .net. I get why Powershell is great for sys…

I agree that Powershell for a large part doesn't feel like a shell. Yes, it has a CLI, and it has short commands (actually aliases for longer names), but using it feels more like programming, at least to me.

Having said that, I can't vouch for your scripts, but my 10 line shell scripts are unlikely to handle 'edge' cases such as spaces, quotes and backticks in file names.

Also, "incomprehensible to anyone who doesn't know .net" may be true, but your average shell script that builds on tools such as sort, grep, ls, cut, cat, sed, awk, etc. isn't that particularly comprehensible to people who don't know UNIX, either.

Finally, I think it is likely that people who grow up on Powershell feel differently about this.

Re: CoreUtils implemented in pure JavaScript

#19
post #15
post #8

Earlier quoted context omitted.

Some people would agree with both statements. UNIX shells are amazing and the recent improvements in their UX and environment integration is great. (git repo status, programming environments, intelligent completion, the whole of oh-my-zsh, ...) But as soon as you want to do anything moderately interesting, it's better to grab a real programming language, because UNIX shells suck. Escaping failures, whitespace handlin…

However, if you want to string programs together and script pre-written code, everything except UNIX shell sucks.

That's why perl never took off, right?
Post reply on HN