Jarred Sumner Profile picture
building @oven_sh. formerly: @stripe (twice) @thielfellowship. high school dropout 🌈
Mar 21, 2023 4 tweets 1 min read
added an automatic destructuring optimization to bun's new bundler function hey() {   const pr... tons of bailouts, like optional chaining, when targets of member expressions differ, computed properties, bindings which aren't identifiers etc etc

but it should be good for npm packages which were transpiled down to some very old JS target which didn't support destructuring
Mar 20, 2023 4 tweets 1 min read
Bun v0.5.8

The focus of this release: lots of Web & Node.js API bugfixes

also:
- expect(foo).toMatchSnapshot() in bun test
- bun install "workspaces" supports "packages/*" globs
- bun --preload makes it easy to use custom loaders in Bun

bun.sh/blog/bun-v0.5.8
Feb 3, 2023 6 tweets 1 min read
setTimeout & setInterval in Bun should return Currently, it returns a number. Some packages expect .ref() and .unref() to always exist though
Feb 3, 2023 4 tweets 1 min read
Bun v0.5.5:
- "node:http" module can send requests now (client)
- bug fixes for bun install, text encoding, and possible stack overflow in console.log(strong)

bun.sh/blog/bun-v0.5.5
Dec 23, 2022 7 tweets 2 min read
Introducing Bun v0.4.0

- bunx: auto-install & run npm executables
- bun pm ls: list pkg versions
- bun install bugfixes for package hoisting & empty folders
- bun:test gets jest lifecycle hooks
- node:util/types
- node:stream & process.stdin bugfixes

Read the the release notes for Bun v0.4.0

bun.sh/blog/bun-v0.4.0
Dec 22, 2022 4 tweets 1 min read
one bugfix away from bun v0.4.0 Hoisting bug in bun install me and @dylanconway111 spent much of today on.

bun install occasionally places the wrong package version in node_modules when multiple versions of the same package are installed. But the minimum case where this happens is difficult to narrow
Nov 13, 2022 7 tweets 1 min read
The many differences between reading pipes on macOS versus Linux macOS: everything is centered around kqueue

kevent tells you if you’ve reached the end, how much can be read, and how much can be written

the kernel hardcodes 64 KB as the max size but it starts at 16 KB
Aug 2, 2022 7 tweets 1 min read
Bun as a bundler/transpiler independent of the runtime was de-prioritized so the rest could ship, but it will be re-prioritized in the coming months Bun today isn’t a serious webpack/Babel/swc/esbuild/terser alternative because it lacks a minifier and it doesn’t optimize for production bundling — this will need to change

One of the goals of the project to fix this will be: on by default in bun’s runtime
Aug 2, 2022 4 tweets 3 min read
bun v0.1.6 is released!
- Fixes "Illegal instruction" error
- 396x faster TypedArray.from (thx @Constellation)
- 3.5x faster JSON.stringify (thx @darinadler)
- about 2% faster JS execution on Linux due to enabling libpas

github.com/oven-sh/bun/re… @Constellation @darinadler i forgot to mention

TypedArray.slice() gets around 25% faster too
Aug 1, 2022 5 tweets 2 min read
If you get "illegal instruction error" when loading bun, can you tell me if it still happens with these two builds?

macOS: github.com/oven-sh/bun/re…
linux: github.com/oven-sh/bun/re… I'm fairly confident this does fix it because I am now able to load bun via Rosetta on macOS x64 on that macOS build and Rosetta doesn't support AVX instructions which is the cause of the crash on old CPUs
Jul 5, 2022 4 tweets 2 min read
Introducing Bun - an incredibly fast all-in-one JavaScript runtime.

bun.sh One of the things i'm excited about is bun install.

For a simple next.js app, bun installs npm packages about 20x faster than yarn and 49x faster than npm install.
Jul 5, 2022 4 tweets 1 min read
Tomorrow, after more than a year of work, bun enters public beta.

I'm so excited. Here's one of the things I'm excited about.

On Linux, bun.js v0.1.0 server-side renders React (right):
- 3x faster than Node 18 (middle)
- 3.9x faster than Deno 1.23.2 (left)
Jul 4, 2022 4 tweets 1 min read
after bun ships I really want to make it auto-install missing npm packages This can be done fairly safely since bun doesn’t run pre/post install scripts
Jul 3, 2022 4 tweets 1 min read
figured out a way to do live reloading on the server for bun.js without any new APIs

It's scoped to the function. New modules imported inside "fetch" reload automatically on the next request Image "Loader" is a JavaScriptCore builtin Bun already exposed. Loader.registry is a Map of ESM modules.
May 3, 2022 10 tweets 4 min read
next version of bun gets "bun:ffi" – call native libraries from JS

3ns overhead JavaScript <> native:
- 5x faster than napi
- 100x faster than deno ffi

1 / 8 This works by just-in-time compiling small C functions that use the engine's (JavaScriptCore) representation of JavaScript values to convert C types <> JavaScript values

example generated c code:

gist.github.com/Jarred-Sumner/…

2 / 8
May 1, 2022 4 tweets 1 min read
7ns! This tweet will hopefully make sense in less than a week
Dec 25, 2021 4 tweets 1 min read
The more I use Docker, the more I think “should it really be this slow” why does it take 88.5s to load a *cached* 600 MB layer? what is the point of a slow cache?

if it's gzip, it probably should be using libdeflate

if it's sha, it should try a merkle tree like the mold linker

at 1gbps download, it's not network Image