bun
bun copied to clipboard
Bun's priorities
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:
-
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) -
Improve Node.js compatibility. Express needs to work. Popular packages like
chalk
,debug
,discord.js
need to work.child_process
andnet
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. - Simplify contribution. The vast majority of Bun's code was written by me. More people need to be involved.
- 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
how much time do you think this is gonna take?
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.
As a user, I'd want:
- no crashes
- complete Node.js drop-in replacement
- 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.
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?
How high of a priority do you consider expanded documentation and community outreach to be?
I like to use bun in Termux but it didn't worked.
@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/*
)
@halffunction
I like to use bun in Termux but it didn't worked.
Facing Same issue here!
Does Bun instead to expose all apis via the Bun
global like how it is currently, if so, it could get disorganized very quickly.
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
- ...
Will process.stdin
and process.stdout
ever be implemented?
I guess they might be added for support with chalk
@Perodactyl There is a not a feature request regarding that so feel free to create it.
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
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 ^_^
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
SegmentationFault issues:
SegmentationFault at 0
when benchmarkinggraphql
#180SegmentationFault at 3
when parsing a large JSON file #188- SegmentationFault at 0 when adding entry to
[install.scopes]
inbunfig.toml
#190- SegmentationFault at 24 #216
- Dynamic import segfault #219
- SegmentationFault at 188 when running
bun add bun-framework-next
#220- BusError at 5100912640/SegmentationFault at 10 #242
bun install
error #410- Segmentation Fault after any async work reading headers #489
- Segmentation Fault #499
- Segmentation Fault while doing "bun install" in npm project #532
- Segmentation fault on a particular env variable with Apple Silicon #554
- Assigning process.env.NODE_ENV -> "SyntaxError: Left side of assignment is not a reference" #556
- bug: GC Seg Faults with Websockets Consumer #644
- Bun + Open Runtimes integration issue #684
- 0.1.4 upgrade fails on macOS Mojave #689
- Unable to run Next.js app with
bun dev
#723- bun a react-scripts -d get return SegmentationFault at 0 #791
- [ffi] Segmentation fault passing String buffer as char* #801
- Segmentation fault with EJS running under Mitata for benchmarking #811
- MINOR: Segmentation fault instead of useful error message when there are too many nested loops #817
- SegmentationFault at 26 when parsing json #826
- Segfault with built in modules + bun-utilities #840
- Crashing (SEGV) when using
JSON.stringify
#868- Segmentation Fault when installing packages #892
- SegmentationFault when using Honojs on Bun and testing using Hoppscotch. #915
Why not give them a label "segfault"?
I have done so, thanks for the advice.
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
I am totally agree with you in 4, I tried install bun but it fail coz my old cpu
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?
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 thatnet
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
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
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
async_hooks
Node.js polyfill is also missing, required for Prisma.
async_hooks
is required for @sequelize/core@7
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...
It looks like prisma uses only AsyncResource
, which is not deprecated based on this docs - https://nodejs.org/api/async_context.html#class-asyncresource
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
lstatSync: { fn: "lstatSync", length: 1 },
i.e. the TODO means it doesn't support the options argument which has only one property (bigint
)
fixed
I like the project!
Can't wait to run my JS code in based Zig instead of cringe Rust.
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 :)