13 ms·
Bun v0.7.0
- jsomedon 3y agoAFAIK there are competing javascript runtimes including Bun, Deno, Rome, Node and other runtimes that I don't know about. So which one to use?
- ericlewis 3y agoRome is not a runtime, it’s a toolchain.
- rfalon 3y agoIs Rome still being actively developed? Haven't heard much about it in years.
- twosdai 3y agoIf you want to experiment with something new and fun pick bun or deno. If you're looking to currently build a larger scale project with a few people that supports a lot of users, it's safer to go with nodejs/typescript.
- IceSentry 3y agoRome is not a runtime and picking one depends on your use case and personal preference about certain features.
- revskill 3y agoI don't see much deployment webapp story on the Edge/Lambda environment with Bun yet.
- tomnipotent 3y agoCheck out the roadmap: https://github.com/oven-sh/bun/issues/159 https://github.com/oven-sh/bun/issues/159
- yanis_t 3y agoI wonder if Bun will end up being something that will eventually drive the innovation within Node.js, and maybe even merge with it (remember io.js?)
- re-thc 3y ago> and maybe even merge with it (remember io.js?) Not likely. Bun doesn't use v8. And if Bun has to go the way of NodeJs nothing will likely happen as well. Bun can move fast because there aren't as many stakeholders, committees and all sorts of gatekeepers in the way.
- iddan 3y agoProbably won’t merge because it’s a VC backed project
- joshxyz 3y agoi doubt it will get merged. nodejs devs are firm on "this proposal is betteer kept in userland than within nodejs" approach, which also kept their ecosystem stable and predictable at most times.
- akmittal 3y agoI don't think it will merge. After deno nodejs is getting similar features like native fetch, web stream etc. Similarly nodejs can just implement buns unique features
- intelVISA 3y agoI hope so, whilst Bun isn't the fastest in this space it's definitely got potential to be if they can get some talented SWEs behind it.
- manojlds 3y agoIo.js was a fork of Node right. A merge is not on cards here.
- afavour 3y agoI can’t imagine a merge ever being on the cards. io.js was a fork of Node so merging it back in was a relatively simple proposition. Bun uses an entirely different JS engine so a merge would be horrendous, it would be more like a ground up rebuild. I’m also still a little lost on the “why” of Bun. I respect the tech a ton having noodled around with the JavaScriptCore API myself in the past. But I’m not sure why I’d use it over Node.
- todd3834 3y agoDoes anyone else think the logo looks more like an onion than a bun?
- hiimshort 3y agoLooks like a bun (bao) to me.
- jeffparsons 3y agoI always saw it as a xiaolongbao specifically. Maybe that's my personal preference biasing me, though. (And now I'm hungry.)
- lolinder 3y agoThat's exactly what it looks like [0]. With the face on it, I can't help but think of the Pixar short Bao: https://www.pixar.com/bao https://www.pixar.com/bao [0] https://en.wikipedia.org/wiki/Xiaolongbao https://en.wikipedia.org/wiki/Xiaolongbao
- moffkalast 3y agoThe name always reminds me of this xkcd https://xkcd.com/1682 https://xkcd.com/1682 and this one https://xkcd.com/1871 https://xkcd.com/1871 Bun + RabbitMQ + BunnyCDN + Apache Jackrabbit for the Lagomorph stack.
- rmuratov 3y agoReminds me of khinkali. https://en.wikipedia.org/wiki/Khinkali https://en.wikipedia.org/wiki/Khinkali
- dsissitka 3y agoPerhaps a bit awkwardly named but nice: > bun --smol is a new CLI flag which configures the JavaScriptCore heap size to be smaller and grow slower, at a cost to runtime performance. This is useful for running Bun in memory-constrained environments. From the example they gave (https://i.imgur.com/IDHTaAh.png https://i.imgur.com/IDHTaAh.png): Bun 343 MB Bun with --smol 54 MB Node.js 138 MB
- traspler 3y agoI like it :) as long as there are clear descriptions and docs there could be more whimsy in software
- jahsome 3y agoGo nuts, but please make your silly stuff an alias if you must.
- xmcqdpt2 3y agoWait, who decided all software is now Entreprise Edition (EE (tm)) focused?
- jdrek1 3y agoThis has nothing to do with enterprise, it's about accessibility. For most people on the planet English isn't even the first language and now you expect them to know about obscure wannabe-cutesy internet slang? Fuck that shit, what's next? UWU.md instead of README.md?
- dmit 3y agoA --small flag would provide approximately the same amount of information - you'd still need to read the description to figure out what it does. And thanks for the UWU.md idea, love it!
- jasfi 3y agoDoes anyone know why Bun (without --smol) sometimes uses much more memory than Node? Is this due to not being v1 yet? I'm also wondering if some old benchmarks could now be irrelevant.
- uhryks 3y agoI don't know how different it is, but my guess is mostly that Node.js uses v8 and bun uses JavascriptCore.
- deleted 3y ago[deleted]
- jer0me 3y agohttps://twitter.com/jarredsumner/status/1680805432665985025 https://twitter.com/jarredsumner/status/1680805432665985025
- degun 3y agoAm I misinterpreting or does it sound a bit arrogant as a response?
- kissgyorgy 3y agoYes, you are misinterpreting it.
- Jarred 3y agoThe 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 mystery to me. I think we would ideally have something in-between —smol and default. I expect we will fiddle with this more shortly before or after 1.0
- jasfi 3y agoOK thanks. Is that noted on the Bun site? Sounds like an FAQ.
- bnchrch 3y agoHonestly, I havent been a nodejs dev for a long time. However from the outside in, if an alternative runtime was to steal the show so to speak, then Bun looks like it might be able to do it. - Full interoperability with the existing ecosystem - Typescript and JSX as first class - Blazing fast compile times - Can serve a very large number of concurrent requests - And a standard library that does as much as the go stdlib Someone please tell me why this is a bad project, because so far I want to jump in.
- Aeolun 3y agoThe worst part of Bun is the lack of compatibility with other Node stuff. I’d use it if it weren’t for my wish to use Prisma on my project.
- ASI_2029 3y agoBun works with Prisma https://elysiajs.com/blog/with-prisma.html https://elysiajs.com/blog/with-prisma.html
- stareatgoats 3y agoIt's not bad, it's just still too early to "jump in", except to be an early adopter and perhaps one of the go-to experts when the bulk of the user developers come on board. The price for that is to always be prepared to refactor anything you build at this stage.
- mark_and_sweep 3y agoYou're reiterating Deno's feature list. Plus Deno's far more stable and works on Windows. So I'd suggest you go ahead and try Deno.
- hu3 3y agoThere's a big differentiator: Bun is written in Zig while Deno is in Rust. edit: I find this to be a big differentiator for those wanting to better understand how their tools work and hack/propose code changes when desired.
- ShadowBanThis01 3y agoYou forgot to say what it is.
- hnlmorg 3y agoThey did say what it is: > Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager — all in one.
- ShadowBanThis01 3y agoNo, it doesn't. This is the entire title: "Bun v0.7.0"
- hnlmorg 3y agoYou’re conflating “title” with “summary”. They’re two different concepts.
- ShadowBanThis01 3y agoI'm not conflating anything, and never mentioned a summary. I don't know if you're using a specialized application to view this site or something, but in a regular browser there's no summary. There's only the title, and this one neglects to say what the thing is.
- hnlmorg 3y agoMy point was that you’re misunderstanding what a title is. If you want to understand more about something then you should click the link. Not complain that all the detail isn’t in the title. It’s also worth noting that even their abridged description would be too long to use as the title string in HN. So what you’re asking for isn’t even possible on this forum.
- ShadowBanThis01 3y ago
- aranw 3y agoIs it only me that finds it strange that engineers working in a particular language will get another language to solve issues with said language? e.g. Javascript using C, C++, Zig, Rust, etc. Ruby and Python is also similar situation there are tools, libraries and such built in other languages
- glutamate 3y agoThis is the way any interpreted language works, the interpreter has to be written in something and for good performance this has to be a compiled language
- mkl 3y agoUsually. Pypy is a counterexample, with a JIT compiler written in Python: https://www.pypy.org/ https://www.pypy.org/
- jitl 3y agoIt’s written in a very restricted variant of Python, rpython: https://rpython.readthedocs.io/en/latest/rpython.html https://rpython.readthedocs.io/en/latest/rpython.html
- mkl 3y ago"RPython is a subset of Python2 that can be statically compiled. The PyPy interpreter is written mostly in RPython (with pieces in Python), while the RPython compiler is written in Python." - https://rpython.readthedocs.io/en/latest/getting-started.html https://rpython.readthedocs.io/en/latest/getting-started.htm...
- flohofwoe 3y agoI don't think it's strange. A programming language should focus on a specific problem domain, and not try to solve problems outside that domain (not that Javascript is a particular good example of that philosophy though).
- 3y ago
- maxpert 3y agoI am excited for something other than v8 getting some attention. But at the same time I know over time it's gonna get bloated like Node.js
- Jarred 3y agoI work on Bun. Happy to answer any questions
- toastal 3y agoWhen will communications beyond the proprietary Discord be opened up to something FOSS & trustworthy for folks concerned about privacy or under sanctions?
- sidharthv 3y agoThere was a discussion in MermaidJS community to move away from Slack into Discord. But we were thinking about moving to a FOSS platform instead. What are some viable options that communities have had success with?
- djbusby 3y agoMattermost is my favorite.
- toastal 3y agoIRC is very low bandwidth & offers the minimal requirements for communication which can be accessible/acceptable for many projects. If something heavier is needed or wanted, XMPP MUCs & Matrix Spaces may be a good option since they are federated & decentralized (although Matrix has unfortunate defacto centralization around Matrix.org, because it requires quite a lot of resources to self-host in both the Python server as well as mirroring all content for all users for its take on federation). Mattermost & Zulip are fine, but require an account (I believe) to the central server but are FOSS & used enough places to be considered stable/trustworthy. All options can by bridged to all other options (even the proprietary ones) in some manner, but if possible, the defacto server would be FOSS & owned/operated by the community so that that community can define their ToS and/or CoC. This way they are in control of the community rather than requiring users agree to someone else’s—especially a for-profit US corporation’s—terms in order to participate. Some users will want privacy, anonymity, control of personal data, or to get around a firewall/sanctions …and these desires should be considered acceptable. If not self-hosted (requires time/money), it’s still better to choose something using open protocols, like a space on Matrix.org, a big chatroom on XMPP’s Blabber/Conversations, Libera.Chat/OFTC, etc.
- LAC-Tech 3y agoDoesn't work on my system unfortunately (WSL 2) LAPTOP-162NUQO7:~$ curl -fsSL https://bun.sh/install | bash ######################################################################## 100.0% bun was installed successfully to ~/.bun/bin/bun Manually add the directory to ~/.bashrc (or similar): export BUN_INSTALL="$HOME/.bun" export PATH="$BUN_INSTALL/bin:$PATH" To get started, run: bun --help LAPTOP-162NUQO7:~$ ~/.bun/bin/bun Error relocating /home/lewis/.bun/bin/bun: unsupported relocation type 37 Error relocating /home/lewis/.bun/bin/bun: unsupported relocation type 37 Error relocating /home/lewis/.bun/bin/bun: unsupported relocation type 37
- Jarred 3y agoThat’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+
- LAC-Tech 3y agoYes I'm using musl. Alpine Linux in WSL2.
- foo_bar_2000 3y agoAll alpine users should already know this https://wiki.alpinelinux.org/wiki/Running_glibc_programs https://wiki.alpinelinux.org/wiki/Running_glibc_programs
- LAC-Tech 3y agoNode.js works fine, the rustup script correctly determines I'm on a musl system and gives me the right binary.
- dave1010uk 3y agoHas anyone managed to get bun running with ChatGPT Code Interpreter? I can get all the help text displaying but there's no output or error when running a JS file with the latest release (or even one from last year). The latest Deno release works out the box with Code Interpreter. There might not be much benefit to running Bun over Deno but if like to try.
- Jarred 3y agoIt sounds like we aren’t flushing something at the right time. Can you file an issue?
- dave1010uk 3y agoThanks. Reported here: https://github.com/oven-sh/bun/issues/3745 https://github.com/oven-sh/bun/issues/3745 Update: the bug is likely due to Code Interpreter using a 4.4 kernel, which is 7 years old!
- djoldman 3y agoGoing to https://github.com/oven-sh/bun https://github.com/oven-sh/bun It seems bun is: Zig 52.0% C++ 19.2% JavaScript 14.6% TypeScript 12.1% ... which is an interesting mix. I assume the JS is intended to be TS eventually or actually is right now. But why all the C++?
- Jarred 3y agoMany 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 a web browser
- machiaweliczny 3y agoI don’t like binary lockfile. How do I know if something is properly resolved?
- lolinder 3y agoSee the docs: https://bun.sh/docs/install/lockfile https://bun.sh/docs/install/lockfile > Why is it binary? > In a word: Performance. Bun’s lockfile saves & loads incredibly quickly, and saves a lot more data than what is typically inside lockfiles. > How do I inspect it? > Run bun install -y to generate a Yarn-compatible yarn.lock (v1) that can be inspected more easily.
- jwocky 3y agoNot having much luck running non-strict Node.JS classic scripts in Bun using CommonJS/require. Errors about strict mode despite not using "use strict";. Is there a flag to allow such scripts to run?
- Jarred 3y agoTry referencing `exports` or `module` in your code. That will automatically make it use CommonJS which doesn't have strict mode by default.
- eyelidlessness 3y agoBun internally treats most CJS modules as ESM, mapping require() calls to synchronous import() etc. And ESM is always strict mode, so that might be the issue?
- Jarred 3y agoThis used to be true, but now it transpiles to CommonJS with sloppy mode by default when "exports" or "module" is used
- rfalon 3y agoBun is not able to run non-strict javascript and there is no documentation that suggests it will be supported. No choice other than running Node.JS for this.
- 38 3y agostill no Windows