Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Jarred
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
121.
▲
by
Jarred
3y ago
I work on Bun - happy to answer any questions
122.
▲
by
Jarred
3y ago
I work on Bun Happy to answer any questions. We released v0.7.3 last Sunday. Hoping to ship v0.8.0 end of day Monday
123.
▲
by
Jarred
3y ago
This used to be true, but now it transpiles to CommonJS with sloppy mode by default when "exports" or "module" is used
124.
▲
by
Jarred
3y ago
Try referencing `exports` or `module` in your code. That will automatically make it use CommonJS which doesn't have strict mode by default.
125.
▲
by
Jarred
3y ago
In a word: pragmatism. Bun is pragmatic where Deno is “by the book”. Node.js globals like process are Bun globals. You can use require() and import in the same file. Bun is faster, easier to use, and more compatible with the JavaScript ecos
126.
▲
by
Jarred
3y ago
Expecting SvelteKit & SolidStart end of next week. Maybe Next 13 in two weeks. A lot of frameworks work today in the release builds, it’s the dev servers which are harder for us right now.
127.
▲
by
Jarred
3y ago
Many of the web APIs in Bun are generated code from WebKit/Safari, which uses C++. We copy them into Bun, comment out the web browser parts, and ship them in the runtime. This is great for web compatibility because it’s literally from
128.
▲
by
Jarred
3y ago
The closest thing we have builtin is HTMLRewriter, which is more of a tool for transforming HTML than for traversing. I have looked a bunch of times at how hard it’d be to import the DOM APIs from WebKit/Safari and would really love t
129.
▲
by
Jarred
3y ago
The heap size grows faster & stays larger in the default configuration, adjusted for the amount of memory the computer has We might enable —smol by default though. The garbage collector configuration in JavaScriptCore is still kind of a
130.
▲
by
Jarred
3y ago
It sounds like we aren’t flushing something at the right time. Can you file an issue?
131.
▲
by
Jarred
3y ago
We really care about performance and spend probably way too much time on it. I think caring a lot is a good way to fight against the longterm default trajectory of software becoming bloated & slow over time
132.
▲
by
Jarred
3y ago
It was originally supposed to be a bunny but the bao was cute so it’s kind of both now
133.
▲
by
Jarred
3y ago
I work on Bun. Happy to answer any questions
134.
▲
by
Jarred
3y ago
That’s an interesting error I haven’t seen before. Are you on the latest Linux kernel for WSL2? Is this WSL2 x64 or arm64? Are you using musl by chance? Bun requires glibc 2.29+
135.
▲
by
Jarred
3y ago
You might also like JSGlobalObject::haveABadTime() https://github.com/WebKit/WebKit/blob/b305f64a67e288b714a84f... // Consider the following objects and prototype chains: // O
136.
▲
by
Jarred
3y ago
ESM has nice things too, like top-level-await and strict mode by default. Explicit imports/exports are better for autocomplete when TS is unavailable. I think the ESM slowness can eventually be compensated for but it will need spec cha
137.
▲
by
Jarred
3y ago
bun test will get test coverage. I recently learned about a JSC api that lets you see which functions have been called or not called. There’s a “control flow profiler”. Just need to wire it up.
138.
▲
by
Jarred
3y ago
I wrote nearly all of macros in Bun over a year ago, when Bun was in private beta. We just never documented it or talked about it much Our focus is very much on Node.js compatibility
139.
▲
by
Jarred
3y ago
An earlier version of macros in Bun looked more like what you describe. We nerfed it because the API was too complicated. But we probably will revisit in the future. https://gist.github.com/Jarred-Sumner/454da846d614f7b
140.
▲
by
Jarred
3y ago
Import Attributes are a stage3 proposal which means it is very likely to become part of the language. It’s the last stage before becoming part of the language. > Another failure I see is the fact that the "type" property is not
141.
▲
by
Jarred
3y ago
It was mostly inspired by comptime in Zig. Babel macros came to mind too, but those rely on an AST and Babel-specific api. What’s really cool about comptime in Zig is it feels like ordinary code. Macros in Bun aim for that too.
142.
▲
by
Jarred
3y ago
DataView is JIT optimized by both V8 and JSC. Buffer’s write* functions are not, and therefore are slower. The faster but even more complicated approach would likely be to create a single DataView per ArrayBuffer and then set the byteOffset
143.
▲
by
Jarred
3y ago
I work on Bun, happy to answer any questions.
144.
▲
by
Jarred
3y ago
Yeah we need to fix raw mode
145.
▲
by
Jarred
3y ago
(I work on Bun) Great writeup We are working on the crash with the minifier + multiple entry points and hopefully will have a fix this week > Bun inserts code that looks like this at the bottom of the built file, in this case from a file
146.
▲
by
Jarred
3y ago
> 1. It seems the Bun.file API ( https://bun.sh/docs/api/file-io ) doesn't provide a way to distinguish between a zero-size file and a file that doesn't exist. Is this right? If it is, it would be nice
147.
▲
by
Jarred
3y ago
wow thats rough i'm sorry can you file an issue with some code that reproduces it? will take a look
148.
▲
by
Jarred
3y ago
The plan is JavaScript edge hosting focused on fast cold starts and being extremely inexpensive, using lots of custom infrastructure
149.
▲
by
Jarred
3y ago
There is no standard, import.meta is host-defined: 13.3.12.1.1 HostGetImportMetaProperties ( moduleRecord ) The host-defined abstract operation HostGetImportMetaProperties takes argument moduleRecord (a Module Record) and returns
150.
▲
by
Jarred
3y ago
Bun does need glibc, but older glibc versions should work okay because of this: https://github.com/oven-sh/bun/blob/78229da76048e72aa4d92516... We haven't implemented polyfills for everything yet though,
More ›