News for hackers. Stuff that matters.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by rhdunn on Tuesday March 31, 2026 @01:19PM (#47590585)
There are several issues with "Batteries Included" ecosystems (like Python, C#/.NET, and Java):

1. They are not going to include everything. This includes things like new file formats.

2. They are going to be out of date whenever a standard changes (HTML, etc.), application changes (e.g. SQLite/PostgreSQL/etc. for SQL/ORM bindings), or API changes (DirectX, Vulcan, etc.).

3. Things like data structures, graphics APIs, etc. will have performance characteristics that may be different to your use case.

4. They can't cover all nice use cases such as the different libraries and frameworks for creating games of different genres.

For example, Python's XML DOM implementation only implements a subset of XPath and doesn't support parsing HTML.

The fact that Python, Java, and .NET have large library ecosystems proves that even if you have a "Batteries Included" approach there will always be other things to add.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Groxx on Tuesday March 31, 2026 @01:46PM (#47590997)
"Batteries included" means "ossification is guaranteed", yah. "stdlib is where code goes to die" is a fairly common phrase for a reason.

There's clearly merit to both sides, but personally I think a major underlying cause is that libraries are trusted. Obviously that doesn't match reality. We desperately need a permission system for libraries, it's far harder to sneak stuff in when doing so requires an "adds dangerous permission" change approval.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by lokar on Tuesday March 31, 2026 @11:26PM (#47596445)
Golang seems to do a good job of keeping the standard library up to date and clean
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Groxx on Wednesday April 01, 2026 @12:19AM (#47596775)
Largely, yes.

But also everyone sane avoids the built-in http client in any production setting because it has rather severe footguns and complicated (and limited) ability to control it. It can't be fixed in-place due to its API design... and there is no replacement at this point. The closest we got was adding some support for using a Context, with a rather obtuse API (which is now part of the footgunnery).

There's also a v2 of the json package because v1 is similarly full of footguns and lack of reasonable control. The list of quirks to maintain in v2's backport of v1's API in https://github.com/golang/go/issues/71497 (or a smaller overview here: https://go.dev/blog/jsonv2-exp) is quite large and generally very surprising to people. The good news here is that it actually is possible to upgrade v1 "in place" and share the code.

There's a rather large list of such things. And that's in a language that has been doing a relatively good job. In some languages you end up with Perl/Raku or Python 2/3 "it's nearly a different language and the ecosystem is split for many years" outcomes, but Go is nowhere near that.

Because this stuff is in the stdlib, it has taken several years to even discuss a concrete upgrade. For stuff that isn't, ecosystems generally shift rather quickly when a clearly-better library appears, in part because it's a (relatively) level playing field.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by hu3 on Wednesday April 01, 2026 @08:22AM (#47599886)
This looks like an ad for batteries included to me.

Libraries also don't get it right the first time so they increment minor and major versions.

Then why is it not okay for built-in standard libraries to version their functionality also? Just like Go did with JSON?

The benefits are worth it judging by how ubiquitous Go, Java and .NET are.

I'd rather leverage billions of support paid by the likes of Google, Oracle and Microsoft to build libraries for me than some random low bus factor person, prone to be hacked at anytime due to bad security practices.

Setting up a large JavaScript or Rust project is like giving 300 random people on the internet permission to execute code on my machine. Unless I audit every library update (spoiler: no one does it because it's expensive).

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Groxx on Wednesday April 01, 2026 @10:00AM (#47601002)
Third party libraries have been avoiding those json footguns (and significantly improving performance) for well over a decade before stdlib got it. Same with logging. And it's looking like it will be over two decades for an even slightly reasonable http client.

Stuff outside stdlib can, and almost always does, improve at an incomparably faster rate.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by lokar on Wednesday April 01, 2026 @11:21AM (#47602106)
And I think the Go people seem to do a fairly good job of picking out the best and most universal ideas from these outside efforts and folding them in.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by hu3 on Wednesday April 01, 2026 @06:19PM (#47607267)
.NET's JSON and their Kestrel HTTP server beg to differ.

Their JSON even does cross-platform SIMD and their Kestrel stack was top 10/20 on techempower benchmarks for a while without the ugly hacks other frameworks/libs use to get there.

stdlib is the science of good enough and sometimes it's far above good enough.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by TheCoelacanth on Wednesday April 01, 2026 @10:24AM (#47601376)
Libraries don't get it right the first time, but there are often multiple competing libraries which allows more experimentation and finding the right abstraction faster.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by hoppp on Saturday April 04, 2026 @02:24PM (#47641798)
Rust is especially vulnerable witb Serde included in everything and maintained by 1 perso
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Yokohiii on Wednesday April 01, 2026 @08:25AM (#47599918)
Another downside of a large stdlib, is that it can be very confusing. Took my a while how unicode is supposed to work in go, as you have to track down throughout the APIs what are the right things to use. Which is even more annoying because the support is strictly binary and buried everywhere without being super explicit or discoverable.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by lokar on Wednesday April 01, 2026 @11:37AM (#47602322)
I'm not sure I understand. Why would a standard library, a collection of what would otherwise be a bunch of independent libraries, bundled together, be more confusing than the same (or probably more) independent libraries published on their own?
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by lokar on Wednesday April 01, 2026 @11:19AM (#47602084)
For me, the v2 re-writes, as well as the "x" semi-official repo are a major strength. They tell me there is a trustworthy team working on this stuff, but obviously not everything will always be as great as you might want, but the floor is rising.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Groxx on Saturday April 04, 2026 @04:03PM (#47642810)
yea, I like the /x/ repos a fair bit. "first-party but unstable" is an extremely useful area to have, and many languages miss it by only having "first-party stable forever" and "third party". you need an experimentation ground to get good ideas and seek feedback, and keeping it as a completely normal library allows people/the ecosystem to choose versions the same way as any other library.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by nazcan on Wednesday April 01, 2026 @11:17AM (#47602060)
100% to libraries having permissions. If I'm using some code to say compute a hash of a byte array, it should not have access to say the filesystem nor network.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by pjmlp on Thursday April 02, 2026 @06:55AM (#47612652)
> "Batteries included" means "ossification is guaranteed", yah. "stdlib is where code goes to die" is a fairly common phrase for a reason.

Except I rather have ossified batteries that solve my problem, even if not as convinient as more modern alternatives, than not having them at all on a given platform.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by hvb2 on Tuesday March 31, 2026 @01:50PM (#47591050)
The goal is not to cover everything, the goal is to cover 90% of the use cases.

For C#, I think they achieved that.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by zymhan on Tuesday March 31, 2026 @01:56PM (#47591124)
> They are going to be out of date whenever a standard changes (HTML, etc.)

You might want to elaborate on the "etc.", since HTML updates are glacial.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by rhdunn on Tuesday March 31, 2026 @03:05PM (#47591978)
The HTML "Living Standard" is constantly updated [1-6].

The PNG spec [7] has been updated several times in 1996, 1998, 1999, and 2025.

The XPath spec [8] has multiple versions: 1.0 (1999), 2.0 (2007), 3.0 (2014), and 3.1 (2017), with 4.0 in development.

The RDF spec [9] has multiple versions: 1.0 (2004), and 1.1 (2014). Plus the related specs and their associated versions.

The schema.org metadata standard [10] is under active development and is currently on version 30.

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... (New)

[2] https://web.dev/baseline/2025 -- popover API, plain text content editable, etc.

[3] https://web.dev/baseline/2024 -- exclusive accordions, declarative shadow root DOM

[4] https://web.dev/baseline/2023 -- inert attribute, lazy loading iframes

[5] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... (Baseline 2023)

[6] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/... (2020)

[7] https://en.wikipedia.org/wiki/PNG

[8] https://en.wikipedia.org/wiki/XPath

[9] https://en.wikipedia.org/wiki/Resource_Description_Framework

[10] https://schema.org/

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by cpill on Tuesday March 31, 2026 @05:51PM (#47593961)
please! nobody uses Xpath (coz json killed XML), it RDF (semantic web never happened, and one ever 10years is not fast), schema.org (again, nobody cares), PNG: no change in the last 26 years, not fast. the HTML "living standard" :D completely optional and hence not a standard but definition.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by yusaydat on Tuesday March 31, 2026 @10:20PM (#47596011)
Xpath is still used for e2e tests and things like scraping. Especially when there aren't better selectors available.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by thomasmg on Wednesday April 01, 2026 @01:32AM (#47597176)
The point is that you don't need the very latest version. The 20 years old version is enough.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by rhdunn on Wednesday April 01, 2026 @02:21AM (#47597498)
XPath 1.0 is a pain to write queries for. XPath 2.0 adds features that make it easier to write queries. XPath 3.1 adds support for maps, arrays, and JSON.

And the default Python XPath support is severely limited, not even a full 1.0 implementation. You can't use the Python XPath support to do things like `element[contains(@attribute, 'value')]` so you need to include an external library to implement XPath.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by thomasmg on Friday April 10, 2026 @06:37AM (#47716041)
The problem of XPath 3.1 is that it is very complex [1] - this is a long page. Compared to the 1.0 spec, it is just too complex in my view. For the open source project I'm working on, I never felt that the "old" XPath version is painful.

I think simplicity is better. That's why Json is used nowadays, and XML is not.

[1] https://www.w3.org/TR/xpath-31/ [2] https://jackrabbit.apache.org/oak/docs/query/grammar-xpath.h...

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by rhdunn on Wednesday April 01, 2026 @02:16AM (#47597462)
XPath is used in processing XML (JATS and other publishing/standards XML files) and can be used to proces HTML content.

RDF and the related standards are still used in some areas. If the "Batteries Included" standard library ignores these then those standards will need an external library to support them.

Schema.org is used by Google and other search engines to describe content on the page such as breadcrumbs, publications, paywalled content, cinema screenings, etc. If you are generating websites then you need to produce schema.org metadata to improve the SEO.

Did you notice that a new PNG standard was released in 2025 (last year, with a working draft in 2022) adding support for APNG, HDR, and Exif metadata? Yes, it hasn't changed frequently, but it does change. So if you have PNG support in the standard library you need to update it to support those changes.

And if HTML support is optional then you will need an external library to support it. Hence a "Batteries Included" standard library being incomplete.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by hoppp on Saturday April 04, 2026 @02:26PM (#47641813)
Its used plenty in legacy systems that are still around.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by mrits on Tuesday March 31, 2026 @01:58PM (#47591155)
glaciers change faster than HTML
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by zymhan on Tuesday March 31, 2026 @02:20PM (#47591435)
Oof, I honestly hadn't considered that.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by Yokohiii on Wednesday April 01, 2026 @08:27AM (#47599935)
because there is more human effort
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by CommonGuy on Tuesday March 31, 2026 @01:43PM (#47590958)
Why would they be out of date? The ecosystems themselves (for example .NET) receives regular updates.

Yes, they cannot include everything, but enough that you do not _need_ third party packages.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by mrits on Tuesday March 31, 2026 @01:57PM (#47591147)
Python, .NET, and Java are not examples of batteries included.

Django and Spring

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by spixy on Tuesday March 31, 2026 @02:31PM (#47591538)
comparing to Node, .NET is batteries included: built-in Linq vs needing lodash external package, built-in Decimal vs decimal.js package, built-in model validation vs class-validator & class-transformer packages, built-in CSRF/XSRF protection vs csrf-csrf package, I can go on for a while...
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by ytpete on Tuesday March 31, 2026 @03:00PM (#47591905)
And in fact wasn't a popular Python library just compromised very recently? See https://news.ycombinator.com/item?id=47501426.

So Python's clearly not "batteries included" enough to avoid this kind of risk.

Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by rhdunn on Tuesday March 31, 2026 @03:09PM (#47592021)
That's my point. You can have a large standard library like those languages I mentioned, but that isn't going to include everything nor cover every use case, so you'll have external libraries (via PyPi for Python, NuGet for .NET, and Maven for Java/JVM).
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by vovavili on Tuesday March 31, 2026 @04:36PM (#47593147)
Python's standard library is definitely much more batteries-included than JavaScript's.
Re:Axios Compromised on NPM – Malicious Versions Drop Remote... by la_fayette on Wednesday April 01, 2026 @08:01AM (#47599686)
depends, JavaScript in the Browser has many useful things available, which I miss with python, e.g., fetch, which in Python you need a separate package like requests to avoid a clunky API. Java had this issue for long time as well, since Java 11 there is the HttpClient with a convenient API.