23 ms·
CoreUtils implemented in pure JavaScript
- xbdhdhd 11y agoFor what purpose?
- pygy_ 11y agoThat would come in handy for cross-platform npm 'run' scripts.
- unexistance 11y agoI hope the goals are - short-term : POSIX compliant - long-term : runs *nix binary / programs p/s: love anything CLI, so I may be biased
- ne0phyte 11y agoHow would they run *nix binaries in a node.js environment if they call it "Cross-platform Linux without the suck"? You are talking about Cygwin here which is what these guys hate for some reason.
- unexistance 11y agowell, I mean what's the point of the project if it's JUST to run linux commands? we already have Bellard's JS VM for that OR maybe I didn't see their long-term goal?
- umanwizard 11y agoCygwin can't run binaries compiled for non-Windows systems, can it?
- cyphar 11y agoAs 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".
- karmabadger 11y agoI 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?
- cyphar 11y ago> 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.
- viraptor 11y agoSome 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 handling, almost-real-arrays, fail-and-continue by default, and many many other reasons you'll fail by accident one day is why they absolutely suck for almost anything past basics.
- Already__Taken 11y agoIf someone were to make a distro with powershell instead of the unix shell I'd lose my mind.
- wohlben 11y agoi haven't really used PS, but from what i understand you'd also need to rewrite every other program to adhere to its rules. as - if i understood it correctly - the real benefit of powershell is that they all use the same output format. this decreases the trouble of handing output from one command to the next significantly.
- dvh 11y agoIt is easier to port shell than shell script.
- elcapitan 11y agoI'll wait for GNU/Windows.
- Sir_Cmpwn 11y ago>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
- TickleSteve 11y agoCant upvote you enough.... Also... Node... Huh? seriously? replace a siongle DLL with Node.JS is simplifying it??
- Smudge 11y agoSimpler 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 like every language gets at least one coreutils implementation, so why not? So much negativity around here. Honestly I find it pretty neat that JS has come this far.
- throwaway2048 11y agonode.js is not simple or even simpler
- iuyoynp 11y agohow cli tools implemented in node is "without suck" is beyond me. fucken hipsters
- TickleSteve 11y agoAbsolutely... Replacing a single DLL with Node is "simplifying" it.... Jeez...
- TickleSteve 11y agoI never understood the hatred for Cygwin, its a (set of) DLLs that form a POSIX->Windows translation layer. All the bulk is just the utilities that people want to provide once they've got that layer (i.e. CoreUtils).
- mbrownnyc 11y agoI'm sitting here wondering why no one ever talks about PowerShell. It supports .NET reflection, which allows direct .NET API access. It's basically c# shell.
- rhinoceraptor 11y agoIt's always mind blowing how when someone makes a neat project like this and the comments are nothing but complaining, vitriol, etc.
- na85 11y agoLots of vitriol because it's yet another "I took something that works and rewrote it to be slower, less functional, and JavaScript" Making computing worse, one fork at a time.
- rhinoceraptor 11y agoThis is the attitude that drives people away from working on open source.
- gherkin0 11y agoIt's better to say nothing so people can be happy with what they've just done and continue to make the same mistakes in the future?
- rhinoceraptor 11y agoSo I guess no one should write a toy kernel again the future, because it won't be perfect? What kind of logic is that?
- na85 11y agoToy kernels are usually presented as such. This is presented as Unix Without the Suck, when in fact it's almost 100% suck.
- eknkc 11y agoSo..., just don't use it? If it's useful for just one person, it's useful.
- soundwave106 11y ago
- Wintamute 11y agoWriting cross platform build scripts for web projects can be a pain when you want to rely on commands like cat, rm etc. This looks like it could relieve a lot of that. Nice job. P.S. I'm constantly amazed by the number of non-JS developers that pile onto JS-related HN threads to tell us how much JS sucks. I'd like there to be less of it, it's getting a bit old. It seems like any amount of familiarity with the web, or the fact that someone once wrote a JS function sometime makes people feel entitled to weigh in on modern JS development. Look after your own communities and let us plough our own furrow ... we think lots of small modules is an interesting approach, and we'd like to see where we can get with it.
- faaef 11y agoApart from this being of questionable usability, why do people feel the need to solve every problem with (Node)JS? I can think about a ton of languages better suited for systems programming at the top of the hat.
- callumlocke 11y agoBecause 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 know that other language, but it's irrelevant to me. Even if I kind of know my way around the other language, I'm never going to be as effective with it as the language I use every day. And a lot of people use JavaScript every day. This is the reason why people feel the need to solve problems in JavaScript.
- striking 11y agoBut 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?
- callumlocke 11y ago> 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
- randommodnar 11y agoWhat the fuck I don't even
- dang 11y agoPlease post civilly and substantively, or not at all. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newswelcome.html
- emdog4 11y agoMongo(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.
- debacle 11y agoI was very interested in contributing to this project, but the code quality of some of the commands seems prohibitively low.
- ascotan 11y agoMore validation of the Atwood principle. http://blog.codinghorror.com/the-principle-of-least-power/ http://blog.codinghorror.com/the-principle-of-least-power/
- solenoids 11y agoI understand why you'd use Node.js for I/O intensive tasks like web development and scraping, but for a cross-platform program meant to do everything? None of Node.js's benefits shine. Sure, Node.js has a big community with lots of (mostly linux-only) packages, but you get a mediocre language and pretty crap cross-platform support. This doesn't matter as a web development language, but seriously gets in the way when you're developing a program designed to do literally everything. A more useful project might be coreutils in rust, which several projects are already doing.