Is Go Used in Production more than Rust ?

ยท 592 words ยท 3 minute read

I was wondering if programs used in the real world are mostly written/built in Rust or Go? How to create a real world statistic to compare ?

Homebrew package manager ๐Ÿ”—

I found that Homebrew lists the dependencies of the package like this.

$ brew info eza
==> eza: stable 0.18.13 (bottled)
Modern, maintained replacement for ls
https://github.com/eza-community/eza
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/e/eza.rb
License: MIT
==> Dependencies
Build: pandoc โœ˜, pkg-config โœ”, rust โœ˜
Required: libgit2 โœ˜
==> Analytics
install: 12,792 (30 days), 38,295 (90 days), 68,375 (365 days)
install-on-request: 12,790 (30 days), 38,293 (90 days), 68,375 (365 days)
build-error: 0 (30 days)

The dependencies of eza to build are pandoc, pkg-config and Rust. So, I can get all software packages in Homebrew and query every package to get its dependencies, then calculate the number of packages which depends on Go and others on Rust.

I was wondering if I should execute system commands of brew list and brew info <pkg-name>, but fortunately, Homebrew has a json file containing all Homebrew Core Formulae.

gobrew ๐Ÿ”—

So, I created a simple Go program named it “gobrew” to get the JSON API, then parse it, and count all Go-based software packages.

I made gobrew more general, so, you can use it to get the number of packages written in Ruby by this command gobrew -l ruby. You can specify any programming language or library or build system or runtime.

Statistics on April 26, 2024 ๐Ÿ”—

The number of packages written in Go is 957. The number of packages written in Rust is 524. That means Go is the most used in software distributed by Homebrew package manager for production by far.

$ ./gobrew -l go
957

$ ./gobrew -l rust
524

You can try it yourself via gobrew on GitHub .

Here is a chart to help distinguish the difference in the count of packages.

# of Homebrew Core formulae written in Go vs Rust

other programming languages ๐Ÿ”—

I used this command to count packages written in these programming languages for me.

$ ./gobrew -l zig
6

Here is a table of programming languages (I thought of) and their packages count.

Languagepkg count
[email protected]718
[email protected]67
lua47
ruby27
ocaml26
perl25
php20
cython12
Zig6

build systems & libraries & runtimes ๐Ÿ”—

I used the following command to count packages which use the build system or runtime to get build or run.

$ ./gobrew -l cmake
1011

Here is a table of build systems, libraries and runtimes (I thought of) and their packages count.

build system or runtimepkg count
pkg-config1447
cmake1011
autoconf455
automake435
libtool366
ninja253
meson213
node189
gcc75
python-setuptools75
llvm30
luajit22

my opinion ๐Ÿ”—

I think of Rust as a great language for low level programming such as operating system modules and device drivers. And I think of Go as the perfect backend programming language and CLI apps. I think that’s why Go is almost 2x more used to create apps distributed via Homebrew compared to Rust.

I think Go is more useful for most cases, but there are other specific cases suitable more for Rust and Zig (which I think will succeed and get popular ).

I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , Facebook , Telegram and GitHub .

Share: