Top
Best
New

Posted by voctor 9 hours ago

Node.js needs a virtual file system(blog.platformatic.dev)
212 points | 169 commentspage 4
syrusakbary 6 hours ago|
[flagged]
szmarczak 4 hours ago|
HN comments isn't a place to advertise your product.
szszrk 4 hours ago||
I am not so sure about that. I recall multiple posts that start with most upvoted comments from founders...

Wonder what Dang says about that.

wei03288 4 hours ago||
[flagged]
AgentMarket 3 hours ago||
[flagged]
petcat 9 hours ago||
Are people still building new projects on Node.js? I would have thought the ecosystem was moving to deno or bun now
dzogchen 9 hours ago||
I don't really understand what the value proposition of Bun and Deno is. And I see huge problems with their governance and long-term sustainability.

Node.js on the other hand is not owned or controlled by one entity. It is not beholden to the whims of investors or a large corporation. I have contributed to Node.js in the past and I was really impressed by its rock-solid governance model and processes. I think this an under-appreciated feature when evaluating tech options.

packetlost 9 hours ago|||
Deno has some pretty nice unique features like sandboxing that, afaik, don't exist in other runtimes (yet). It's enough of a draw that it's the recommended runtime for projects like yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/14404
worksonmine 8 hours ago||
Node has sandboxing these days: https://nodejs.org/api/permissions.html
dzogchen 7 hours ago||
No it doesn't, unfortunately.

> The permission model implements a "seat belt" approach, which prevents trusted code from unintentionally changing files or using resources that access has not explicitly been granted to. It does not provide security guarantees in the presence of malicious code. Malicious code can bypass the permission model and execute arbitrary code without the restrictions imposed by the permission model.

Deno's permissions model is actually a very nice feature. But it is not very granular so I think you end up just allowing everything a lot of the time. I also think sandboxing is a responsibility of the OS. And lastly, a lot of use cases do not really benefit from it (e.g. server applications).

zamadatix 8 hours ago||||
If one gets nothing from them directly, they've at least been a good kick to get several features into Node. It's almost like neovim was to vim, perhaps to a lesser extent.
zadikian 7 hours ago||||
Note that Bun was recently acquired by Anthropic.
gavmor 7 hours ago||||
Faster, no transpilation, dev-ex sugar.
pier25 7 hours ago||||
I agree about the governance and long-term sustainability points but if you don't see any value in Bun or Deno is probably because (no offense) you are not paying attention.
jitl 9 hours ago|||
loud people on twitter are always switching to the new hotness. i personally can't see myself using bun until its reputation for segfaults goes away after a few more years of stabilizing. deno seems neat and has been around for longer, but its node compatibility story is still evolving; i'm also giving it another year before i try it.
_flux 8 hours ago||
Wow, I thought you were exaggerating, but no: https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3...

Open 80, closed 492.

petcat 6 hours ago||
That's basically just Zig, right? Re-invented C but only fixed the syntax, not the problems.
zadikian 7 hours ago|||
Yes people are using Node.js, most likely the majority.
rrr_oh_man 9 hours ago|||
Why?
kitsune1 9 hours ago||
The delusion in this comment is insane.
pier25 8 hours ago||
The Node team has lost the plot IMO.

By far the most critical issue is the over reliance on third party NPM packages for even fundamental needs like connecting to a database.

nulltrace 1 hour ago||
I publish a package with zero deps and people still pull in a pile of transitive stuff from their lockfile. "pg" has 13 dependencies and nobody even blinks. One gets compromised and suddenly every Node backend using Postgres is in scope. Bun shipping native drivers feels like the right call, fewer moving parts.
NoNameProvided 17 minutes ago||
I understand the general point you're making, but the pg package isn’t a good example. It has 6 deps, not 13, and 5 of those are internal packages from the same monorepo without additional dependencies. There’s only a single external dependency, and that one brings in just one additional package.

In my opinion, the pg repo and packages are an example of how OSS stuff should be maintained. Clean repo, clean code, well-maintained readme, and clearly focus on keeping things simple instead of overcomplicating.

afavour 8 hours ago|||
What would a Node-native database connection layer look like? What other platforms have that?

Databases are third party tech, I don’t think it’s unreasonable to use a third party NPM module to connect to them.

mike_hearn 7 hours ago|||
Most obviously, Java has JDBC. I think .NET has an equivalent. Drivers are needed but they're often first party, coming directly from the DB vendor itself.

Java also has a JIT compiling JS engine that can be sandboxed and given a VFS:

https://www.graalvm.org/latest/security-guide/sandboxing/

N.B. there's a NodeJS compatible mode, but you can't use VFS+sandboxing and NodeJS compatibility together because the NodeJS mode actually uses the real NodeJS codebase, just swapping out V8. For combining it all together you'd want something like https://elide.dev which reimplemented some of the Node APIs on top of the JVM, so it's sandboxable and virtualizable.

LunaSea 7 hours ago||
> Most obviously, Java has JDBC. I think .NET has an equivalent. Drivers are needed but they're often first party, coming directly from the DB vendor itself.

So it's an external dependency that is not part of Java. It doesn't really matter if the code comes from the vendor or not. Especially for OpenSource databases.

zadikian 6 hours ago|||
DBMS vendor providing the client is nice. At least if you're using pg-native in Node, that's just a wrapper around the Postgres-owned libpq, but I've run into small breaking updates before that I don't feel would've happened if Postgres maintained both.
afavour 3 hours ago||
But that’s not Node’s fault surely? Shouldn’t Postgres be providing an NPM module given the popularity of Node?
zadikian 3 hours ago||
No it's not Node's fault, this isn't their job. I don't blame Postgres either, cause maintaining libpq is fair enough, just would've been extra nice to have an official Node lib too.
mike_hearn 6 hours ago|||
Well in the case of Oracle you can get the language, runtime, DB and driver all from the same organization under unified support contracts.

If you don't value that, why would you want your programming language implementors to also implement database drivers?

zadikian 6 hours ago||
Well that's only because Oracle happens to own both Java and Oracle DB. Suppose you're not using that DB.
pier25 7 hours ago||||
Bun provides native MySQL, SQlite, and Postgres drivers.

I'm not saying Node should support every db in existence but the ones I listed are critical infrastructure at this point.

When using Postgres in Node you either rely on the old pg which pulls 13 dependencies[1] or postgres[2] which is much better and has zero deps but mostly depends on a single guy.

[1] https://npmgraph.js.org/?q=pg

[2] https://github.com/porsager/postgres

zadikian 3 hours ago|||
Maybe MySQL and Postgres should make official Node libs then. Bun maintaining this is ok too, but it seems odd given that it means having to keep up with new features in those DBMSes.
pier25 3 hours ago||
> but it seems odd given that it means having to keep up with new features in those DBMSes

That would be more useful for the ecosystem than the Node team investing time on a virtual file system.

zadikian 1 hour ago||
Hard to compare, but reason #1 of bundling an app is a pretty big deal that can't be solved with just a library.
adzm 7 hours ago|||
Node has sqlite, though I have not had any issues using better-sqlite3 and worker processes for long running ops
pier25 5 hours ago||
Until the day it gets pwned by a malicious actor. Which is something we've seen quite a lot of times on npm deps.
ksherlock 7 hours ago|||
Perl has DBI. PHP has PDO.
Spivak 7 hours ago||
Python has DB-API.
beart 7 hours ago||
Outside of sqlite, what runtimes natively include database drivers?
pier25 7 hours ago||
Bun, .NET, PHP, Java
Deukhoofd 6 hours ago|||
For .NET only the old legacy .NET Framework, SqlClient was moved to a separate package with the rewrite (from System.Data.SqlClient to Microsoft.Data.SqlClient). They realized that it was a rather bad idea to have that baked in to your main runtime, as it complicates your updates.
pier25 5 hours ago||
It's still provided by Microsoft. They are responsible for those first party drivers.
LunaSea 7 hours ago|||
For Bun you're thinking of simple key / values, hardly a database. They also have a SQLite driver which is still just a package.
pier25 5 hours ago||
I think you're confusing the database engine with the driver?
torginus 5 hours ago|
Why do people keep reinventing OS features?

There's Docker, OverlayFS, FUSE, ZFS or Btrfs snapshots?

Do you not trust your OS to do this correctly, or do you think you can do better?

A lot of this stuff existed 5, 10, 15 years ago...

Somehow there's been a trend for every effing program to grow and absorb the features and responsibilities of every other program.

Actually, I have a brilliant idea, what if we used nodejs, and added html display capabilities, and browser features? After all Cursor has already proven you can vibecode a browser, why not just do it?

I'm just tired at this point

williamstein 5 hours ago||
This exact thing solves a huge problem with SEA binaries as he points out in his post. You can include complicated assets easily and skip an ugly unpack step entirely. This is very useful.
ryandrake 5 hours ago||
One of the worst is media players that all insist on grafting their own "library" on top of my already-working OS filesystem. So I can't just run the media player and play files. No, that would be too simple. I have to first "import" my media into a "library" abstraction and then store that library somewhere else on my filesystem. Terrible!