bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun's priorities

Open Jarred-Sumner opened this issue 2 years ago • 27 comments

Bun is a large project and it is early days. I think Bun needs to do a better job communicating what is a priority right now and what isn't.

Bun's top priorities:

  1. Improve stability. Bun should not segfault. bun install should not get stuck. fetch should be more reliable. We need to be running Address Sanitizer regularly and possibly Valgrind as well. Async HTTP responses should not cause crashes under heavy load. We need to do fuzz testing. bun dev's file watcher needs to be more reliable (particularly on Linux)
  2. Improve Node.js compatibility. Express needs to work. Popular packages like chalk, debug, discord.js need to work. child_process and net need to be implemented. We need more tests. These packages should be supported via implementing the lower-level Node.js APIs and not by hacking in compatibility layers. Longer-term, Bun might want to implement Express in native code, but today lets just get the primitives working well.
  3. Simplify contribution. The vast majority of Bun's code was written by me. More people need to be involved.
  4. Make Bun work on older CPUs. This is the simplest one: Bun shouldn't require AVX2-compatible CPUs. We just need another build of Bun which does not require the CPU target

PRs that fit in the scope of top priorities will be reviewed ASAP. PRs that do not fit in this scope may take awhile to be reviewed

Jarred-Sumner avatar Jul 20 '22 06:07 Jarred-Sumner

how much time do you think this is gonna take?

umararshad4 avatar Jul 20 '22 08:07 umararshad4

how much time do you think this is gonna take?

It depends! @ohsnap4. It's very hard to predict when these priorities can get done in an open-source environment. Everyone is contributing in their spare time. But I think @Jarred-Sumner has a time-goal set up for this, the only thing we can do is to contribute meaningfully to this project.

PatrickPrakash avatar Jul 20 '22 10:07 PatrickPrakash

As a user, I'd want:

  1. no crashes
  2. complete Node.js drop-in replacement
  3. complete npm/yarn install replacement

2 > 3 since user experience > developer experience. 2 excites me most since it'll immediately speed up a lot of web apps. A good target should be to get Bun.js working with top 100 npm packages without changes to the packages themselves. This opens up an incremental adoption strategy for everyone to switch from node → bun and then optionally translate compat APIs for Node.js to even faster Bun.js equivalents if present.

KishanBagaria avatar Jul 20 '22 12:07 KishanBagaria

I would love to help but feel like I'm to unexperienced yet, any pointers from a more experienced dev as to what to learn to be a little useful?

SHIMER-jpg avatar Jul 20 '22 19:07 SHIMER-jpg

How high of a priority do you consider expanded documentation and community outreach to be?

factoidforrest avatar Jul 20 '22 23:07 factoidforrest

I like to use bun in Termux but it didn't worked.

halffunction avatar Jul 21 '22 07:07 halffunction

@Jarred-Sumner firstly great project 👍 love it.

Im wondering how I could help.

My first thoughts was to structure the documentation a bit more concisely, is that something that would be of interest + inline with priorities?

Feels like a wall of text at the moment, maybe as a starting point:

  • Group related things under one heading
  • Split up README.md into multiple files (that reside in ~/docs/*)

jooj123 avatar Jul 21 '22 08:07 jooj123

@halffunction

I like to use bun in Termux but it didn't worked.

Facing Same issue here!

EAGLE1309 avatar Jul 24 '22 15:07 EAGLE1309

Does Bun instead to expose all apis via the Bun global like how it is currently, if so, it could get disorganized very quickly.

ariesclark avatar Jul 25 '22 02:07 ariesclark

Crash issues:

  • #188
  • #554
  • #556
  • #684
  • #723
  • #817
  • #826
  • #887
  • #888
  • #1084
  • #1087
  • #1088
  • #1167
  • #1211
  • #1257
  • #1266
  • #1305
  • #1312
  • #1323
  • #1330
  • #1331
  • #1342
  • #1345
  • #1360
  • #1361
  • ...

Nugine avatar Jul 25 '22 02:07 Nugine

Will process.stdin and process.stdout ever be implemented? I guess they might be added for support with chalk

Perodactyl avatar Jul 25 '22 21:07 Perodactyl

@Perodactyl There is a not a feature request regarding that so feel free to create it.

sno2 avatar Jul 25 '22 23:07 sno2

Chokidar is an extremely popular package that is core to other extremely popular packages. It currently does not work because fs.watch is not implemented: https://github.com/oven-sh/bun/issues/832

robogeek avatar Jul 28 '22 19:07 robogeek

Wow, I see so much work and progress going on here, I wish bun the best. I believe it's going to be a breakthrough (if I'm not exaggerating) or at least game changer ^_^

FrameMuse avatar Jul 28 '22 20:07 FrameMuse

Stability/SegFault improvement update -- #644 appears markedly improved from 1.3.0 -> 1.5.0

More notes in the issue. Incredibly impressive delta in such a short time.

Great work @Jarred-Sumner

ryanrussell avatar Jul 30 '22 19:07 ryanrussell

SegmentationFault issues:

Why not give them a label "segfault"?

I have done so, thanks for the advice.

sno2 avatar Jul 30 '22 22:07 sno2

node.js/polyfill issues:

  • https://github.com/oven-sh/bun/issues/267
  • https://github.com/oven-sh/bun/issues/288
  • https://github.com/oven-sh/bun/issues/349
  • https://github.com/oven-sh/bun/issues/401
  • https://github.com/oven-sh/bun/issues/429
  • https://github.com/oven-sh/bun/issues/455
  • https://github.com/oven-sh/bun/issues/478
  • https://github.com/oven-sh/bun/issues/479
  • https://github.com/oven-sh/bun/issues/595 (in progress by @sno2)
  • https://github.com/oven-sh/bun/issues/832
  • https://github.com/oven-sh/bun/issues/894
  • https://github.com/oven-sh/bun/issues/901
  • https://github.com/oven-sh/bun/issues/960
  • https://github.com/oven-sh/bun/issues/962
  • https://github.com/oven-sh/bun/issues/963
  • https://github.com/oven-sh/bun/issues/173

xhyrom avatar Aug 04 '22 05:08 xhyrom

I am totally agree with you in 4, I tried install bun but it fail coz my old cpu

ws-rush avatar Aug 10 '22 22:08 ws-rush

I'd love to help, but don't want to jump in and duplicate work. Are there directly responsible individuals for these 4 items? Perhaps there's a team/squad working on these that I could get in touch with?

joeyguerra avatar Aug 13 '22 22:08 joeyguerra

Key modules/features that I see missing from Node.js are:

  • fs.watch required by Chokidar
  • dns, tls required by various network tools. I see above that net is missing, but I haven't seen that in my testing
  • child_process required by Commander which is a very popular framework for CLI applications

robogeek avatar Aug 16 '22 20:08 robogeek

Hello, If you need more person involved, I guess you need to create cheat sheet for Zig because it's not popular language or example folder where you can add example about how to add a new Api also how to interact with deps that you choose and code style for better maintenance

marvelbark2 avatar Sep 04 '22 20:09 marvelbark2

Hello, If you need more person involved, I guess you need to create cheat sheet for Zig because it's not popular language or example folder where you can add example about how to add a new Api also how to interact with deps that you choose and code style for better maintenance

You can take a look https://github.com/oven-sh/bun/pull/1115

xhyrom avatar Sep 27 '22 04:09 xhyrom

async_hooks Node.js polyfill is also missing, required for Prisma.

izznatsir avatar Dec 12 '22 09:12 izznatsir

async_hooks is required for @sequelize/core@7

wenerme avatar Jan 12 '23 11:01 wenerme

From https://nodejs.org/api/async_hooks.html:

Please migrate away from this API, if you can...We strongly discourage the use of the async_hooks API. Other APIs that can cover most of its use cases...

vjpr avatar Jan 12 '23 13:01 vjpr

It looks like prisma uses only AsyncResource, which is not deprecated based on this docs - https://nodejs.org/api/async_context.html#class-asyncresource

Zhomart avatar Jan 21 '23 15:01 Zhomart

A good target should be to get Bun.js working with top 100 npm packages without changes to the packages themselves.

After #​1266 fix, I cursorily tested these:

  • 1 lodash ✓
  • 2 chalk ✓
  • 3 request ✓
  • 4 commander ✓
  • 6 express ✓
  • 7 debug ✓
  • 8 async ✓
  • 9 fs-extra ✗ (a TODO popped up for copySync)
  • 10 moment ✓
  • 14 underscore ✓

During the process, I had some Integrity check failed that required to call bun install twice. Apart from the fs-extra hiccup, it looks almost stable.


offtopic
After some digging it seems to be related to
lstatSync: { fn: "lstatSync", length: 1 },

i.e. the TODO means it doesn't support the options argument which has only one property (bigint) fixed

Mouvedia avatar Feb 25 '23 13:02 Mouvedia

I like the project!

Majoramari avatar Jul 05 '23 14:07 Majoramari

Can't wait to run my JS code in based Zig instead of cringe Rust.

alexgleason avatar Sep 07 '23 18:09 alexgleason

Would really love to see some love for Koa as well and not just express as I happened across bun and would love to see if I can get it to work with https://github.com/strapi/strapi as I'm quite interested in the performance increases.

Who knows, maybe one day we would see Strapi rewritten in bun instead of Node :)

derrickmehaffy avatar Sep 08 '23 20:09 derrickmehaffy