3 ms·
Seems like a good release. I watched their video, and some charts were a bit unclear, as in, I didn't know if they were comparing with the previous Bun version
by gr4vityWall 3y ago
Seems like a good release.
I watched their video, and some charts were a bit unclear, as in, I didn't know if they were comparing with the previous Bun version or Node.js.
My experience with using Bun in side projects has been good. The built-in APIs work well in my experience, and I hope popular runtimes adopt at least a subset of them. The hashing and the SQLite bindings come to mind as APIs that I wish were available in Deno and Node.js as well.
They collect some telemetry by default. I don't think the install script tells you that. The only mention of it that I've found is in the Bunfile documentation: https://bun.sh/docs/runtime/bunfig#telemetry https://bun.sh/docs/runtime/bunfig#telemetry
I'd prefer if it was opt-in, and that users were given instructions for disabling it if they want to during installation.
They offer an option to create a dependency-free executable for your project, which bundles the runtime with your .js entrypoint. That works great if you want a single binary to distribute to users, but at the moment, the file size is still pretty big (above 90MB on GNU/Linux for a small project). Not terrible, but nothing comparable to Go or QuickJS yet. I wonder if in the future, Bun would offer an option to compile itself with certain features disabled, so we'd get a smaller binary.
I have been playing with using Bun as a Haxe target. It works pretty well and IMO it's a choice to consider if you like Haxe more than TypeScript, or if you want to add a web server to an existing Haxe project without adding another programming language. You can also to do things like generating validation code at compile time, which seems hard to do with just TypeScript.
- moritzwarhier 3y ago> I'd prefer if it was opt-in, and that users were given instructions for disabling it if they want to during installation. So you mean an informed opt-out, right? Thank you for the interesting hands-on experiences and insights regarding Bun. I followed the coverage and posts by Jarred here on HN for quite a while, think since the initial alpha release, but haven't used it. Will keep your examples for helpful added platform APIs in mind for when I hopefully come around to doing sth with Bun! It sounds like a great platform for JS scripting as well - I also think that could be a good and easy way to test the waters. Really, kudos to Bun and Jarred Sumner for living up to the promise he made when the first version was announced!
- gr4vityWall 3y ago> So you mean an informed opt-out, right? I worded it wrong - I meant I'd prefer if it was opt-in, or at least informed opt-out, like you said. Thanks for pointing it out. :) > It sounds like a great platform for JS scripting as well - I also think that could be a good and easy way to test the waters. It is. Some other features you might enjoy are the built-in TypeScript support and test runner. It works well for one-off scripts too, if you'd prefer not using Bash. For me, it was refreshing coming from Node.js. Hope it is an enjoyable experience for you as well.
- stefanos82 3y agoThank you for letting me know about telemetry; I had no idea.
- rnmkr 3y agoThen people go crazy when Golang announced they want to enable informed opt-out telemetry.
- notelem 3y ago> They collect some telemetry by default I wondered why every time I upgraded bun macos would pop up a permissions dialog. This explains that. Anyway, it can be disabled by adding the following to your environment: export DO_NOT_TRACK=1 This is the data collected: https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c3afdd53b437770e1/src/analytics/analytics_schema.zig#L325-L498 https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... This 64 bit machine_id line is concerning: https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c3afdd53b437770e1/src/analytics/analytics_schema.zig#L435 https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... It may be a unique identifier for your machine.
- Jarred 3y agoThat is unrelated. This is a code signing / notarization issue because we don’t distribute Bun via the Mac App Store and likely the way it was installed was via npm or something other than .zip file we distribute. Code signing is necessary due to the JIT entitlement in Bun (otherwise Bun would be a whole lot slower)
- notelem 3y agoMac code signing needs the machine id? https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c3afdd53b437770e1/src/analytics/analytics_thread.zig#L182-L193 https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c3afdd53b437770e1/src/analytics/analytics_thread.zig#L274C8-L323 https://github.com/oven-sh/bun/blob/801e475c72b3573a91e0fb4c... Why then is the unique machine id collected on Linux?
- Jarred 3y agoThis is dead code from before Bun 1.0. This code exists but is not run and probably stripped from the final executable (Zig is great at dead code elimination). We do get the Linux kernel version to detect if syscalls like pidfd_open are supported and enable fast paths.
- Jarred 3y agoNote that we do not currently send telemetry anywhere. The extent of what we track right now is a bitset of what builtin modules were imported and a count of how many http requests were sent with fetch(), and a few things like that. This is used in the message printed when Bun panics so we can have a better idea of what the code was doing/did when it crashed
- gr4vityWall 3y agoSorry, I didn't understand your post. From the last 2 phrases, it seems to be the case that you do collect some data. So, when you say > Note that we do not currently send telemetry anywhere. You mean that Oven do not send that data to someone else, right? I still see value in having a privacy policy so that users can find out what is collected by Oven in a concise way, and how to opt out of that. As far as I know, the fact that any data is collect at all, and that there's a flag to disable it is only mentioned in a documentation page for Bun's TOML config file.