Nanobrew: The fastest macOS package manager compatible with brew (nanobrew.trilok.ai)

by syrusakbary 146 comments 225 points
Read article View on HN

146 comments

[−] mikemcquaid 53d ago
If it doesn’t ever execute Ruby: it cannot be compatible with Homebrew. “Compatible” is doing a bit of work here when it also means “implicitly relies on Homebrew’s CDN, CI, packaging infrastructure and maintainers who keep all this running”.

There’s a new vibe coded Homebrew frontend with partial compatibility and improved speed every few weeks.

Homebrew is working on an official Rust frontend that will actually have full compatibility. Hopefully this will help share effort across the wider ecosystem.

[−] runjake 53d ago
Context for those unaware: the commenter, mikemcquaid, is the project lead for Homebrew.
[−] pxc 53d ago
It is really coll that Homebrew provides a comprehensive enough JSON API to let people build on Homebrew in useful ways without directly running Ruby, despite everything being built in a Ruby DSL. That really does seem like a "best of both worlds" deal, and it's cool that alternative clients can take advantage of that.

I didn't know about the pending, official Rust frontend! That's very interesting.

[−] SOLAR_FIELDS 53d ago
Wow they are finally getting away from Ruby? Awesome. The speed will be a nice boon
[−] derefr 52d ago

> Homebrew is working on an official Rust frontend that will actually have full compatibility.

When you say "Rust frontend", is the vision that Homebrew's frontend would eventually transition to being a pure Rust project — no end-user install of portable-ruby and so forth?

If so (ignore everything below if not):

I can see how that would work for most "boring" formulae: formula JSON gets pre-baked at formula publish time; Rust frontend pulls it; discovers formula is installable via bottle; pulls bottle; never needs to execute any Ruby.

But what happens in the edge-cases there — formulae with no bottles, Ruby post_install blocks, and so forth? (And also, how is local formula development done?)

Is the ultimate aim of this effort, to build and embed a tiny little "Formula Ruby DSL" interpreter into the Rust frontend, that supports just enough of Ruby's syntax + semantics to execute the code that appears in practice in the bodies of real formulae methods/blocks? (I personally think that would be pretty tractable, but I imagine you might disagree.)

[−] atonse 53d ago
Heyyyy, who are you to tell us what is and isn't compatible with homebrew?

(Just kidding, thank you for creating homebrew and your continued work on it!)

[−] boobsbr 53d ago
Please, don't remove bottles and casks that are blocked by Gatekeeper. :˜(
[−] tfrancisl 53d ago
I appreciate the push for an official rust frontend. I've personally been migrating (slowly) to using nix to manage my Mac's software, but there are a ton of limitations which lead me to rely on homebrew anyway. The speed ups will be appreciated.
[−] breppp 52d ago
I think you are doing great work with brew and I hope the Rust version is released soon

However, how is this effort different than uv vs pypi? why is this a bad thing?

[−] cromka 52d ago

> Compatible” is doing a bit of work here when it also means “implicitly relies on Homebrew’s CDN, CI, packaging infrastructure and maintainers who keep all this running”.

This is literally what "compatible" means, how else did you expect then to frame it?

[−] ricardobeat 52d ago
That is great news! Would be even more awesome if it was being ported to a more approachable language like Go or Zig, or somehow rearchitected in Ruby, but I take it that ship has sailed long ago. Ruby -> Rust is a brutal move.
[−] anbotero 52d ago
Wait a minute, Homebrew is slow? I thought most of the time it takes for me is downloading and installing. I haven't noticed slowdowns anywhere else, even for the ones mentioned.
[−] waterTanuki 52d ago

> Homebrew is working on an official Rust frontend that will actually have full compatibility. Hopefully this will help share effort across the wider ecosystem.

Where can I read more on this effort?

[−] adityamwagh 52d ago
In it's current form, homebrew is amazing. It's not that slow and recent updates have made it really good to use. May I know the reasons for a Rust rewrite?
[−] halapro 53d ago
Makes no sense, the wording suggests it can use Homebrew's backend, not that it's a complete alternative to Homebrew. Nobody is confused about that.
[−] patabyte 52d ago
I'm really interested to learn more about the work on the official Rust frontend - do you have any links to share by chance?
[−] hirvi74 52d ago
What drove the choice to use Rust for an official frontend?
[−] yokoprime 52d ago
thank you for all you (and your co-maintainers) do for the community!
[−] AbanoubRodolf 52d ago
[flagged]
[−] drob518 53d ago
This feels like a solution looking for a problem. I have a couple hundred brew packages on my system and I’ve never sat there thinking “If this was only 2 seconds faster…” while doing an update. I’m sure the Homebrew folks could mine this for a few ideas of how to further optimize brew, but I don’t think I’ll be adopting it anytime soon. Compatibility is more important than speed in this case.
[−] ryandrake 53d ago
What would be great is a Homebrew-compatible system that doesn't cut off support for older machines. I have a 3.8 GHz Quad core i5 iMac that still crushes, yet Homebrew has determined that I'm just too old and icky[1] to work with anymore. I had to move over to MacPorts, which is surprisingly nice, but I still miss brew.

Yea, I know. It's open source. They can do what they want. Still sucks.

1: https://docs.brew.sh/Support-Tiers

[−] luizfelberti 53d ago
It might be good to explain how this differs from zerobrew [0], which is trying to accomplish the same thing

[0] https://github.com/lucasgelfond/zerobrew

[−] themadsens 53d ago
I naively assumed it would work on the already installed homebrew packages. No such luck.

After installing, 'nb list' and thus eg. 'nb outdated' will yield the empty list! I have absolutely no use for a competing homebrew installation that is mostly compatible ..

[−] chuckadams 53d ago
This might be a good thing for homebrew to adopt for the download/install process, but if it doesn't include a ruby interpreter, I have a hard time seeing how it's going to be compatible with anything but searching and installing bottles. I install most of my packages from a Brewfile, which itself is Ruby code.
[−] tzs 52d ago
OT: speaking of Homebrew, I made an incorrect assumption about it that eventually led to some problems. It was me being stupid, but I bet others have made the same mistake but not yet hit problems. Hence this comment.

My mistake was when I upgraded from my 2017 iMac (Intel processor) to an Apple silicon Mac at the start of 2024 and migrated via Time Machine I did not do anything extra specifically for Homebrew. I just assumed that as things got updated via the normal periodic Homebrew updates I run it would start grabbing the Apple silicon binaries for binary things it installed.

It turn out that is wrong. They made Apple silicon Homebrew kind of independent of Intel Homebrew. Intel Homebrew uses /usr/local and Apple silicon Homebrew uses /opt/homebrew. This allows having both native and Intel Homebrew installed at the same time if you need both.

The correct way to migrate from an Intel Mac to an Apple silicon Mac is to install Apple silicon Homebrew on the new Mac, and then install all the packages you want. Intel Homebrew works fine on Apple silicon Macs so you can use the Intel Homebrew that migrated via Time Machine to make the package list to use with Apple silicon Homebrew (or you can make it on the old Mac).

I only noticed this because I was trying to build something from source using some libraries that were installed via Homebrew and running into problems. An LLM was helping figure this out and it was telling me I might have to manually symlink those libraries from where they were in /opt/homebrew to where the build process for the thing I was building expected to find them and I didn't have a /opt/homebrew. The libraries were somewhere in /usr/local. I then noticed those libraries were not for Apple silicon, checked other things installed view Homebrew and saw nothing was for Apple silicon, and realized I had the wrong Homebrew.

[−] denkmoon 52d ago
Brew is a leaky piece of crap. nix 4 lyf. Seriously, I used to hate any time I needed to install something with brew not knowing if it was going to break everything else, since using nixpkgs for my macos dev requirements it's been so much nicer.
[−] Onavo 53d ago
The current version of brew has a flaw where the installer can't install isolated dependency trees in a sterile manner. If you have packages A, B, C, and D that all have updates, and assuming A,B,C depend on each other and come out to a total of say 1MB, and D is 1000MB, brew works in a MapReduce manner where it will attempt to finish downloading everything in parallel (even though the real bottleneck is D) before doing any installation.

Since the first 3 has no dependency on D, a better way would be to install them in parallel while D is still downloading.

[−] kassadin 53d ago
Do you choose compatibility or speed?

nb info --cask codex-app

nb: formula '--cask' not found

nb: formula 'codex-app' not found

[−] sanderwebs 52d ago
I've found brew so painful that I switched to nix. Nix unfortunately is painful in its own way. However, I recently discovered devbox which is a wrapper around nix. It works really well as a package manager. Just run "devbox global add "
[−] alsetmusic 53d ago
I'm not a Python dev, but I appreciate the motivation uv has inspired across other package managers. I tried another brew replacement called zerobrew last month. It installed packages to a different directory from homebrew, so I didn't actually test drive after seeing that. Regardless, I look forward to the competition pushing mainstream tools to improve their performance.
[−] an0malous 53d ago
Does it reinstall postgres for every package install?
[−] manlymuppet 53d ago
If we get the Bun-ification of every package manager and language ecosystem that would be an awesome thing. This is a great trend.
[−] maxloh 53d ago
How does this work? AFAIK Homebrew formulae are written in Ruby [0].

Do they use some kind of Ruby parser to parse formulae?

[0]: https://github.com/Homebrew/homebrew-core/blob/26-tahoe/Form...

[−] 12_throw_away 53d ago
So, A) to what extent is this vibe coded? And B) what is "trilok.ai" where you download it from?
[−] tantalor 53d ago
And why does speed matter in this case?
[−] coldtea 52d ago
Tried to install a package with it, it failed.

Tried the same package with brew. Worked like a charm.

Uninstalled nanobrew.

[−] pxc 53d ago
I've been looking for something like this, especially to use only with casks now that Homebrew has removed support for not adding the quarantine bit. Looking forward to giving it a try!
[−] hirvi74 52d ago
Why does the speed of a package manager matter? I'm being sincere too. I have used countless package managers, and speed is not an attribute of any of them that I have noticed.
[−] hsaliak 52d ago
This is most certainly vibed with a few optimization focused prompts. Yes - performance is a feature, but so is lack of risk.
[−] marksully 53d ago
what happens if I test this tool by installing some packages and then remove (the tool)? will I still be able to use Homebrew to manage these new packages?
[−] MoonWalk 52d ago
Inaccessible: net::ERR_CERT_AUTHORITY_INVALID
[−] bibimsz 52d ago
is this going to be like litellm?
[−] orefalo 52d ago
well nanobrew is not on brew!
[−] NamlchakKhandro 52d ago
No one should be using brew.

It's terrible

[−] peytongreen_dev 53d ago
[flagged]
[−] ryguz 52d ago
[dead]