So uh, if you have a Rust cli app and want to efficiently distribute it, your best bet now is to package it up as binary wheels on PyPI so folks can get super fast and convenient access to it via uv?

How the tables have turned

@tintvrtkovic Can also be done using npmjs.com with a thin JS wrapper.

@kevin @tintvrtkovic I thought for that to work with an npm package you either needed to include binaries for all platforms or have a custom install script that figured out what file to download and ultimately install?

@brettcannon @tintvrtkovic Yes, that's true. NPM doesn't have a concept equivalent to 'wheels' so choosing and installing a binary package for the specific architecture required has to be done by a JS program. It's pretty much a copy-and-paste thing though, there are lots of examples out there in the wild.

@kevin @brettcannon @tintvrtkovic Does any other language ecosystem have an equivalent concept to wheels (i.e. built binaries with compatibility guarantees)?

@pradyunsg @brettcannon @tintvrtkovic I can't think of one... there are things like Homebrew but that's not a language ecosystem.

@kevin @pradyunsg @tintvrtkovic I can't think of any either. All other ecosystems that I can think of distribute source only as they just don't have the cross-language usage we have.

@brettcannon @kevin @pradyunsg @tintvrtkovic Ruby has some equivalent thing I think, no? Is that what a gem is?

@brettcannon @kevin @pradyunsg @tintvrtkovic Looking into it a bit, seems like Ruby definitely has equivalent of a wheel ("native gems" I think they are called) and npm has something like this as well, looking at this: npmjs.com/package/prebuild

@pganssle @brettcannon @kevin @tintvrtkovic

IIUC, Ruby's native gems still trigger a compile at install time on the user's machine.

And, prebuild is quite close! Although it seems the generated binaries live outside of the NodeJS index/dependency resolution (eg: github.com/wadey/node-microtim). unpkg.com/browse/mutou-micro@1 shows a package that is "just" copying a bundled binary with custom logic instead of compiling in certain circumstances.

Follow

@pradyunsg @brettcannon @kevin @tintvrtkovic I can't tell if that is right. I distinctly remember that Ruby used to be a pain like Python was (requiring a compiler, etc), and then they had a change similar to our change with wheels that made it not a pain.

I just created a bundle with `nokogiri` and `sqlite3` and this was included in the verbose output:

```
Fetching racc 1.8.1
Fetching sqlite3 2.4.1 (x86_64-linux-gnu)
Installing racc 1.8.1 with native extensions
Installing sqlite3 2.4.1 (x86_64-linux-gnu)
Fetching nokogiri 1.17.1 (x86_64-linux)
Installing nokogiri 1.17.1 (x86_64-linux)
Bundle complete! 2 Gemfile dependencies, 4 gems now installed.
Bundled gems are installed into `./.vendor/bundle`
```

That makes me think that `racc` has native code that needed to be compiled, but `sqlite3` and `nokogiri` had some pre-built binaries available. Maybe a person can chime in if I'm misunderstanding it.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.