Live data from Hacker News

Malicious code in the purescript NPM installer

harry.garrood.me

81–90 of 279 posts

Re: Malicious code in the purescript NPM installer

#81
post #80

The real issue the Balkanization of JavaScript programs. The `rate-map` package is essentially one line of code: start + val * (end - start); https://github.com/shinnn/rate-map/blob/90c234c9/index.mjs#L...

I honestly don't understand why people use packages like this. If I need this functionality, I will simply write my own. Plus, I will never able to find this specific package. I guess PureScript uses this because its author is also the author of rate-map.

Re: Malicious code in the purescript NPM installer

#82
post #80

The real issue the Balkanization of JavaScript programs. The `rate-map` package is essentially one line of code: start + val * (end - start); https://github.com/shinnn/rate-map/blob/90c234c9/index.mjs#L...

...wow. I literally did not believe that until I clicked the link. JavaScript has gone too far.

Re: Malicious code in the purescript NPM installer

#86
NPM gets a lot of hate for it's dependency managemnet, but I'm not sure what a solution would be to this problem.

- They can't currate packages, or else that friction will drastically slow down the ecosystem (1000's of packages get published everyday).

- They can't remove/disable packages (most of the time), or dependencies will no longer be strictly immutable.

- They can't disable sub-dependencies, or else this would greatly reduce code reuse and increase redundancy and complexity of packages (every package may have to roll there own X, or compile their package dependencies into bundled JS with no dependencies).

I think the problem is simply; it's a low friction dependency management solution -> which made it so popular -> which is making it a target for malicious actors.

Re: Malicious code in the purescript NPM installer

#87
post #80

The real issue the Balkanization of JavaScript programs. The `rate-map` package is essentially one line of code: start + val * (end - start); https://github.com/shinnn/rate-map/blob/90c234c9/index.mjs#L...

...wow. I literally did not believe that until I clicked the link. JavaScript has gone too far.

The problem is clearly due to vanity metrics like number of packages motivating people to publish an insane number of useless packages to fluff their contributions.

Re: Malicious code in the purescript NPM installer

#88
post #80

The real issue the Balkanization of JavaScript programs. The `rate-map` package is essentially one line of code: start + val * (end - start); https://github.com/shinnn/rate-map/blob/90c234c9/index.mjs#L...

The real issue is most JS programmers are not smart enough to write it so they have to find packages to do anything.

Re: Malicious code in the purescript NPM installer

#89
post #24

Earlier quoted context omitted.

Mostly because the vast majority of JS developers don't seem to be aware of the rest of the software universe, and so seem to reinvent the wheel, rediscover the worst of software's history, and discard the most useful of software findings with shocking regularity. NPM tends to reinforce the worst of the JS world's tendencies.

Perl (cpan), Python (pip or conda), Ruby (gem), and Rust (cargo) all behave as NPM does, so that doesn't seem to be the explanation here.

That is why I cited the behaviour and culture of JavaScript-only devs as the primary explanation, with NPM's model reinforcing those issues - issues that do not exist in the same manner in those other languages' ecosystems and cultures.

Re: Malicious code in the purescript NPM installer

#90

Another reminder of how annoying it is for a package system to have unqualified package names. Having to ask someone to gift a `purescript` package shouldn't even be a thing. It should've been `@shinn/purescript` and the compiler developers just create their own `@whatever/purescript`. This is something Elm and many others got right. https://package.elm-lang.org/ It's just infinitely, obviously better. You see all so…

Java got this right with reverse domain names over a decade ago. To use a namespace you have to own the URL. Simple and effective abuse resistant package naming.
Post reply on HN