Live data from Hacker News

CoreUtils implemented in pure JavaScript

github.com

121–128 of 128 posts

Re: CoreUtils implemented in pure JavaScript

#121
post #62

Earlier quoted context omitted.

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.

Granted- I've only been actively developing for about 18-20 years (not being facetious, I was about 14 and wouldn't have been privy to or really involved enough to perceive the thrashing or lack there of with Java 1.0 or Python 1.0, etc) but I don't think they ever really thrashed like what we're seeing with JS, I don't think they could have.

You didn't have broadband, you couldn't really share entire libraries of code freely, and package managers were not around at the very beginning. In 1995/96 you certainly had message boards and forums, but there wasn't a StackOverflow/whatever like community that made it easy to find an answer to your problem AND/OR a lib to help solve it.

You needed to know how to write a linked list, because you had to write your own. Well maybe not, but you had to write a lot of your own things that just don't need to be written today. God I remember my StringUtils jar from when I was a teenager. That damn thing followed me through college, and I gave the source to friends who then iterated on it (or not). But I didn't have a GitHub to post it to and an NPM to announce, and make it available to anyone looking for a new StringUtils library. It was just mine, free to anyone who asked, but no one knew to ask.

Now your ideas and code and spread to millions of people instantly AND they can find it, which is letting people start from an idea and iterate on it rapidly. Everybody is announcing their StringUtil as the next best thing since taking vowels out of words became cool.

So, I guess yeah- we did thrash 20 years ago, but we thrashed silently and alone.

Re: CoreUtils implemented in pure JavaScript

#122
post #63

Earlier quoted context omitted.

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.

...and herein lies the problem.

What problem? I think we need a mixture of specialists and generalists

Re: CoreUtils implemented in pure JavaScript

#123
post #40

Earlier quoted context omitted.

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

i 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.

It should be noted that basically all tools use the same format: text. And badly behaving tools can be cooerced with a single line of awk.

Re: CoreUtils implemented in pure JavaScript

#124

Earlier quoted context omitted.

That's why it only works with ES6 imports. ES6 imports must be made at the top of the file, and aren't dynamic. You must explicitly import what you need. Additionally, this method only works with named imports. So for example, you can have two files: File a.js export a = 5; export b = 6; export c = 7; export d = 8; export default {a, b, c, d}; File b.js import {a, b} from "./a.js"; console.log(a); console.log(b); c/d…

That much makes sense, but if I understand GGGP's example properly, they are talking about pruning unused internal references within a module, but GGP's response implies that somehow Rollup will prune those out.

Ah, I understand the confusion now. I'm not 100% sure how that code works, but I do know it uses estree and that case is tested for, nearly verbatim. Here's a link to the source which handles that sort of stuff.

https://github.com/rollup/rollup/blob/6fc8631ba1aad718885151...

Re: CoreUtils implemented in pure JavaScript

#125

Earlier quoted context omitted.

I see. So you have these coreutils installed? Because if not, they're exactly as "simple" as cygwin, which is also not installed.

No, I don't. I have a vague recollection that cygwin was a huge and confusing monolith, but I haven't looked at it in years. This new javascript thing sounded more straight-forward. It's not really objectively supported. I don't even like javascript.

Cygwin is pretty simple to install and use. Download an .exe installer, click click click, open the Cygwin prompt shortcut.

Re: CoreUtils implemented in pure JavaScript

#126
post #33
post #16

Earlier quoted context omitted.

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…

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. The shell languages are not much better. There are some useful concepts, but in general Unix shells are used despite their user unfriendliness. The shells of the various Lisp Machines were quite different. The Symbolics shell, later called Dynamic Lisp Lis…

You are confusing terminology here. Typical UNIX commands like ls, grep, rm, and so on are not part of the shell.

Re: CoreUtils implemented in pure JavaScript

#127

I hope the goals are - short-term : POSIX compliant - long-term : runs *nix binary / programs p/s: love anything CLI, so I may be biased

How 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.

Cygwin can't run binaries compiled for non-Windows systems, can it?

Re: CoreUtils implemented in pure JavaScript

#128

Earlier quoted context omitted.

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…

In instances like this, there's no issue with it being ES5. However, in the web world, ES6 modules have a huge (pardon the pun) advantage that's just being realized. Because of the static nature of ES6 imports, you can eliminate unused code when you package it all together. The newest Webpack versions and Rollup are both taking advantage of this, and it can result in huge savings in filesize. For example, lodash is a…

Webpack 2 and Rollup don't support tree-shaking with Lodash yet. You'll need to use https://www.npmjs.com/package/babel-plugin-lodash.
Post reply on HN