Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Make backend js ecosystem future better #6532

Closed
loynoir opened this issue Oct 16, 2023 · 4 comments
Closed

[feat] Make backend js ecosystem future better #6532

loynoir opened this issue Oct 16, 2023 · 4 comments
Labels
question Further information is requested

Comments

@loynoir
Copy link

loynoir commented Oct 16, 2023

Feature Request

Make backend js ecosystem future better.

What changed?

Program language like rust and zig, leads to new backend js/ts runtime like deno and bun.

What is the problem?

npm is awesome.

To use awesome npm package for backend, usually need Node.js core module.

But, currently, because three runtime not able to share same Node.js core module, when use deno or bun with npm packages, there are compatibility issues.

Because Node.js deno bun does not able to share same Node.js core module and spec and test, deno bun reinvent the not-fully-compact wheel individually, and not reinvent-once-use-forever.

What maybe the solution?

Node.js deno bun all support napi.

Extra

I don't know if override core module is needed for solution.

If it does, I guess Node.js loader and deno importmap should works.

What is the feature request?

  • Rewrite Node.js core module using napi

  • Rewrite Node.js core module test using javascript, so Node.js deno bun browserify-XXX can share SAME test

  • Publish napi version of Node.js core module to npm

  • Maybe publish to npm under a new organization @backend-javascript-core-module-standard-committee/http

Related

@Electroid
Copy link
Contributor

Bun supports napi and we continue to implement more Node.js APIs. We also use tests from Node.js to validate that our implementation is correct. We're working on making it better!

@loynoir
Copy link
Author

loynoir commented Oct 16, 2023

I really appreciate all efforts on Node.js deno bun.

All Node.js deno bun devs are so awesome.

But currently, for example,

Same wheel have to reinvent repeatedly, in now and in future.

Which require time for now and future.

But in fact, the reinvented wheel currently still have many compatibility problems.

So, I think, if

  • all Node.js deno bun devs setup a backend-javascript-core-module-standard-committee

  • write core module with napi

This will provide at least one backend-isomorphic way, which have zero compatibility problem.

@Electroid
Copy link
Contributor

It's understandable to be frustrated about differences in compatibility among the runtimes. We're all trying to make it better.

The challenge with this proposal is that each of these runtimes are implemented in different languages, with different engines, and using different trade-offs. Under this theory, it would also make sense for Safari, Chrome, and Firefox to re-write large swaths of their code to have a unified backend — it's just not feasible.

Despite this, it's worth reiterating that Bun aims to be Node.js-compatible, and we will continue to relentlessly prioritize that goal, as well as fix the issues like the ones you mentioned.

@Electroid Electroid added the question Further information is requested label Oct 16, 2023
@glensc
Copy link

glensc commented Feb 6, 2024

What would work, in the long term, and every party is going for, is standard and implementing a standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants