Live data from Hacker News

CoreUtils implemented in pure JavaScript

github.com

61–70 of 128 posts

Re: CoreUtils implemented in pure JavaScript

#61

>Huh? Okay - think Cygwin, except: Oh boy, another one of these. Cygwin is useful because it provides a POSIX C API on Windows. It is not useful because of its shell and coreutils. And saying it uses "pure ES6" is stretching it - it's using the plain ES5 Node.js require/export patterns instead of ES6 modules. >1/15th of the size [of Cygwin] Haha, and 1/100th the functionality

Is this indicative of what's going on in the JS world today, with all the churn of packages and libs? Does it boil down to being sucky and not useful if it isn't written in ES6/TypeScript/Whatever and not invented by your team? Why do the other things suck because they're not this? EDIT: I've said it on other threads- I like the creativity and exuberance in the JS community. I'm not putting it down. There's just a lo…

[deleted]

Re: CoreUtils implemented in pure JavaScript

#62

>Huh? Okay - think Cygwin, except: Oh boy, another one of these. Cygwin is useful because it provides a POSIX C API on Windows. It is not useful because of its shell and coreutils. And saying it uses "pure ES6" is stretching it - it's using the plain ES5 Node.js require/export patterns instead of ES6 modules. >1/15th of the size [of Cygwin] Haha, and 1/100th the functionality

Is this indicative of what's going on in the JS world today, with all the churn of packages and libs? Does it boil down to being sucky and not useful if it isn't written in ES6/TypeScript/Whatever and not invented by your team? Why do the other things suck because they're not this? EDIT: I've said it on other threads- I like the creativity and exuberance in the JS community. I'm not putting it down. There's just a lo…

The same thing has happened in the Python/Java/Ruby/etc. world. There's a reason "written in pure Foo" was an expression even before Node.js.

Re: CoreUtils implemented in pure JavaScript

#63
post #60

Earlier quoted context omitted.

Because JavaScript is the most widely used language in the world. As a web developer, I know JavaScript very well. I have already encountered thousands of its idiosyncrasies and I am very good at making it work for me. Therefore any tool written in JavaScript is automatically easy for me to understand and modify. If that tool could have been more elegantly written in another language, that's awesome for people who kn…

I'm not talking necessarily about elegance, but performance, safety, the ability to run on embedded devices, a widely-available toolchain and so on. Apart from that, it's great to have a favorite language, but choosing a hammer for every task does not seem like the mark of a great craftsman for me.

I believe most people in every profession are not/do not aspire to be great craftsmen. And in the end, if their tools work, nobody cares outside of their immediate colleagues.

Re: CoreUtils implemented in pure JavaScript

#66
post #55
post #51

Earlier quoted context omitted.

> Unix shells are notoriously not user friendly. The commands and their interfaces are full of insonsistencies and often really strange. Reading man pages is horror. They're not that bad (GNU coreutils is generally pretty good) and you usually remember the edge cases fairly quickly (eg `dd`). Sadly you get inconsistencies in all coding frameworks, whether it's semantic, function names in the core libraries or whateve…

> They're not that bad (GNU coreutils is generally pretty good) and you usually remember the edge cases fairly quickly (eg `dd`). Sadly you get inconsistencies in all coding frameworks, whether it's semantic, function names in the core libraries or whatever. Generally this is all awful and low-level. Just see the UI interface difference between 'dd' and 'Copy File' on a Lisp Machine. The UI is worlds away. > UNIX she…

I suspect your argument is now more about personal preference than anything. So I'll just address a few specific points you've raise:

> Generally this is all awful and low-level. Just see the UI interface difference between 'dd' and 'Copy File' on a Lisp Machine. The UI is worlds away.

Well yeah, I did already example `dd` as an inconsistency. :)

> You can do that on a Lisp Machine, too. With the difference that no pipelining of text is necessary. Just reuse the objects. The data is all fully object-oriented and self identifying.

Indeed you can. As you can also with DOS, Powershell and so forth. I wasn't suggesting that UNIX shells were unique (though I can see how it might read that way), but that it was UNIX shells which pioneered that concept. For all their faults and the technology that might have superseded it: the idea of pipelining reusable blocks of code was a genius idea for its era.

Powershell also supports passing objects like Lisp does. Personally I prefer the dumb approach; however in all other aspects of programming I do prefer strongly typed languages. This is just personal preference.

> The shell does not know the various options the command takes. The shell does not know what the types and the syntax of the options is. The shell does not know which options can be combined and which not. It can't prompt for shell options. It can't check the command syntax before calling it. It can't provide any help when the syntax is wrong. It can't deal with errors during command execution. There is no in-context help. It can't reusing prior commands other that just editing them on a textual base. The output of the command is just text and not structured data. There are really really zillions of problems.

This part isn't accurate. The original Bourne shell cannot but bash, zsh and fish can all do all of the above. Albeit sometimes (particularly with Bash) you need to install additional helper routines that aren't always shipped / configured with the default package. I believe csh also supports most if not all of the above too.

I'm sure lisp does it better, but I was never arguing that UNIX shells are better Lisp to begin with. Just that I believe Bash et al to have a lower barrier of entry than Lisp. I think on that specific point we might have to agree to disagree - but I don't see many non-programmers using Lisp and this is why I think Bash has a lower barrier of entry (to go back to my original point).

I can completely understand and relate to why you enjoy working inside a Lisp REPL shell though.

Re: CoreUtils implemented in pure JavaScript

#67
Mongo(DB) shell interprets JS and it's very useful. Modifying documents, reorganizing scheme, processing queries.

I can see the usefulness in a JS shell mainly because JS is a popular scripting language.

Running this on Linux will be difficult because node runs with a very limited set of permissions.

Re: CoreUtils implemented in pure JavaScript

#68

Earlier quoted context omitted.

Because JavaScript is the most widely used language in the world. As a web developer, I know JavaScript very well. I have already encountered thousands of its idiosyncrasies and I am very good at making it work for me. Therefore any tool written in JavaScript is automatically easy for me to understand and modify. If that tool could have been more elegantly written in another language, that's awesome for people who kn…

But JS can't solve every problem, nor can it solve certain problems well. I understand people feel the need to solve problems in JS because they're scared or inconvenienced by learning a new programming language. But why not learn a new language? Having a working knowledge of C won't kill you. edit: could you explain how JS is the most widely used language in the world?

> Having a working knowledge of C won't kill you.

I do have some knowledge of C, and I could learn more. But unless I change career, I'll always be faster and more effective in JavaScript because I think in it all day, so I'll almost always choose JS over C. I'm not disparaging anyone who uses C, just answering @faaef's question about why people "feel the need" to make everything in JavaScript – because they can, they happen to know JS very well, and because there's automatically a huge potential contributor base.

> could you explain how JS is the most widely used language in the world?

I don't know, but I assumed it's the most widely used because websites :) Also it's the most popular language on GitHub

Re: CoreUtils implemented in pure JavaScript

#69
post #38

Earlier quoted context omitted.

Simpler is better. Cygwin is overkill unless you are trying to mimic your exact non-Windows environment, and it doesn't mix well with Windows' vanilla CMD environment. For those of us who want to be working with more Windows than UNIX, but who are used to standard coreutil commands, 1/100th the functionality of cygwin actually sounds kind of great! Not saying that the commands need to be written in JS, but it seems l…

node.js is not simple or even simpler

However, I already have it.

Re: CoreUtils implemented in pure JavaScript

#70

>Huh? Okay - think Cygwin, except: Oh boy, another one of these. Cygwin is useful because it provides a POSIX C API on Windows. It is not useful because of its shell and coreutils. And saying it uses "pure ES6" is stretching it - it's using the plain ES5 Node.js require/export patterns instead of ES6 modules. >1/15th of the size [of Cygwin] Haha, and 1/100th the functionality

For my purposes, I don't need a POSIX C API. What I need are the shell commands that I commonly use as my IDE to be available on Windows without a massive hack.

Cash seems to be right up my alley, and I'm excited for this.

Post reply on HN