News for hackers. Stuff that matters.
Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @12:47PM (#33897557)
I work on Bun

happy to answer any questions or feedback

Re:Bun 0.3 by n42 on Wednesday December 07, 2022 @04:13PM (#33900336)
I’m starting a project that requires a lower level language. Ideally I have tighter control of memory and no GC. I want to move fast and be safe. Go gives me the speed of development I desire, but is a little higher level than this project calls for. Rust is in theory the right choice, but my development speed is like molasses. Given I hope for this project to turn into a company I seek VC backing for, I’m uncomfortable investing in a tool that slows me down so early on.

How has Zig been for you in this regard? Do you have any regrets building your company’s flagship software around it at this stage?

Re:Bun 0.3 by LinuXY on Thursday December 08, 2022 @12:33AM (#33904571)
IMO Zig right now is fairly buggy. And the rate of bug introduction has been greater than the fixing of said bugs over the past few years. (Not a knock on the project.) Move fast and break things. Trying to develop production quality software in Zig is like trying to hit a moving target. Zig is not production ready, and they mean it. The ABI is not stable and features are removed/retooled from version to version. (eg. removal of async.) This is all stated upfront, however. Zig is a WIP. That being said, if you've read the warning labels and are still excited there's /tons/ of promise. They are on the right track to being a modern C replacement/augment/mux with an integrated build system. And it's a joy to program in. And the community is pretty great. The best way forward is joining the community and contributing in one way or another, because Zig will be quite special once it's done. Bun is a clear indication of this.
Re:Bun 0.3 by jackosdev on Wednesday December 07, 2022 @07:48PM (#33902613)
I'm also interested in this, the segmentation faults Primeagen found in Bun were concerning: https://youtu.be/qAYFepR4GcE?t=370 might have been fixed by now though.

I was seriously looking at Zig, but I'm always getting faster in Rust and it feels like the downsides of extra complexity is well worth the upsides for larger projects.

Re:Bun 0.3 by adam_arthur on Wednesday December 07, 2022 @01:53PM (#33898495)
What's the target level of compatibility with existing npm modules? 100%? Some lower percentile?

Hate to carry forward baggage of past design choices, but likely essential to really get widespread adoption. I'd definitely start using Bun for my projects today (non-production), if it works seamlessly with existing packages.

Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @02:18PM (#33898854)
We want Bun to feel more like an upgrade from Node than switching runtimes

Basically everything that doesn’t rely on node’s internal “bindings” C++ stuff should eventually be supported

Re:Bun 0.3 by petre on Wednesday December 07, 2022 @03:29PM (#33899803)
Will bun perpetuate the dependency hell that it prevalent with node? I like the deno approach better in this regard.

Are there any install methods other than piping curl into bash? Like packages.

Re:Bun 0.3 by nine_k on Wednesday December 07, 2022 @02:04PM (#33898664)
I suppose a compatibility shim for features that should not go into the new core could work. It would have a performance cost, but as long as this cost is limited to some deprecated APIs it would be OK.
Re:Bun 0.3 by adam_arthur on Wednesday December 07, 2022 @02:06PM (#33898691)
Yeah, a compatibility branch or a build time cross compatibility compiler would suffice.
Re:Bun 0.3 by jamesmunns on Wednesday December 07, 2022 @02:34PM (#33899080)
Congrats on the release!

Were there any organizational or policy changes after the "9 month grind" [0] tweet? Or is this still the policy of the bun/oven org?

[0]: https://news.ycombinator.com/item?id=32584211

Re:Bun 0.3 by henry_viii on Wednesday December 07, 2022 @03:17PM (#33899659)
Tweet in question:

https://archive.ph/PP6Im

Re:Bun 0.3 by sieve on Wednesday December 07, 2022 @04:03PM (#33900210)
I have been unable to locate examples using remote import/export. I would like to able to do a

  import { inflate } from "https://www.example.org/libs/zlib.ts"
with bun downloading all dependencies in the background. Like Deno does.[1]

[1] https://deno.land/[email protected]/basics/modules#remote-impor...

Re:Bun 0.3 by christophilus on Wednesday December 07, 2022 @12:54PM (#33897637)
I’ve built a few utility apps at work. I absolutely love it.

I hijacked your jsx support so that I had built in server-side templating without having to pull in any external libraries (e.g. React). The process of building my own TSX bindings was pretty trivial, but did feel like a hack (I created a React package.json entry that was a file path to my local source folder).

Is that scenario doable with less hackery?

Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @01:10PM (#33897832)
You can set “jsxImportSource” in tsconfig.json or jsconfig.json to point to a different jsx package

There is also a setting in bunfig.toml but it appears we haven’t documented it yet

Re:Bun 0.3 by johnnypangs on Wednesday December 07, 2022 @01:24PM (#33898034)
Bun seems really cool! I had a question about this part:

> Bun now works in more Linux environments, including Amazon Linux 2 and builds for Vercel and Cloudflare Pages. (Previously, you might have seen errors like: "version 'GLIBC_2.29' not found")

How would building for Vercel and CF pages work? Like normal but installing the relevant build tools using bun?

Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @03:03PM (#33899463)
Bun is able to run in these environments now - before it had that glibc error

Right now you’d need to download it via curl https://bun.sh/install | bash

But we need to make that better

Re:Bun 0.3 by dstaley on Wednesday December 07, 2022 @02:04PM (#33898654)
Additionally, I'd love to see the PR where this change was implemented. I've been trying to convince Zola, a static site generator written in Rust, to support older versions of GLIBC.
Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @03:05PM (#33899492)
Most of the code is here. It needs some linker config but basically you wrap symbols which depend on too new versions of glibc and dynamically load them or call some other implementation internally

https://github.com/oven-sh/bun/blob/main/src/bun.js/bindings...

Re:Bun 0.3 by gavinray on Wednesday December 07, 2022 @03:19PM (#33899678)
Are there any exclusive features that Bun has, that are particularly well-suited for writing databases or other low-latency, high-throughput I/O applications?

Seems like being written in Zig might give it a good foot in the door here.

Re:Bun 0.3 by wdb on Wednesday December 07, 2022 @01:24PM (#33898035)
I was curious where the 'dgram' module is on your roadmap?
Re:Bun 0.3 by Jarred on Wednesday December 07, 2022 @03:07PM (#33899524)
Lower than “tls” and “dns”, but not much lower. It’s necessary for databases and anything databases need is important for Bun to support well
Re:Bun 0.3 by tiffanyh on Wednesday December 07, 2022 @08:17PM (#33902836)
Who do you see as biggest competition (Eg Just-JS, Deno, etc)

Thanks for all you do to make the ecosystem better, btw.

Re:Bun 0.3 by bcjordan on Wednesday December 07, 2022 @02:23PM (#33898935)
can Bun help solve the hell that is running `npm install` in a project and seeing an error mentioning `node-pre-gyp` in the output with some platform-specific native dependency build issue
Re:Bun 0.3 by kszyh on Thursday December 08, 2022 @06:24AM (#33906730)
Great job, when can we expect native MS Windows support?
Re:Bun 0.3 by damsta on Wednesday December 07, 2022 @01:03PM (#33897757)
What are the things you are hoping to release in Bun v0.4?
Re:Bun 0.3 by emadda on Wednesday December 07, 2022 @07:10PM (#33902290)
Is there a plan to add:

- Compiling to a single binary

- WASM

Re:Bun 0.3 by turbo_fart on Wednesday December 07, 2022 @07:55PM (#33902673)
Check out bkg, the vercel/pkg for bun