Is Go Used in Production more than Rust ?
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.
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.
Language | pkg count |
---|---|
[email protected] | 718 |
[email protected] | 67 |
lua | 47 |
ruby | 27 |
ocaml | 26 |
perl | 25 |
php | 20 |
cython | 12 |
Zig | 6 |
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 runtime | pkg count |
---|---|
pkg-config | 1447 |
cmake | 1011 |
autoconf | 455 |
automake | 435 |
libtool | 366 |
ninja | 253 |
meson | 213 |
node | 189 |
gcc | 75 |
python-setuptools | 75 |
llvm | 30 |
luajit | 22 |
Statistics over time (trend of usage) ๐
We had the statistics on the past April. Here we add this May statistics (15 May 2024) for more clarity in the usage trend of programming languages.
Another update, on June 2nd 2024, I updated the following table with more statistics.
Update of June 12nd 2024. Count of Go apps (994) are 2X the count of Rust apps (540).
Update of June 24th 2024, Count of Go apps (990) are 1.8X the count of Rust apps (546).
Another update on July 1st 2024, Count of Go apps (998) is still almost 2X the count of Rust apps (550).
language | April 26 | May 15 | June 2 | June 12 | June 24 | July 1 |
---|---|---|---|---|---|---|
Go | 957 | 981 | 988 | 994 | 990 | 998 |
Python | 771 | 773 | 777 | 779 | 780 | 783 |
Rust | 524 | 528 | 534 | 540 | 546 | 550 |
Node | ~ | 202 | 202 | 203 | 203 | 204 |
Lua | 47 | 51 | 51 | 51 | 50 | 50 |
vala | ~ | 48 | 48 | 49 | 49 | 49 |
Ocaml | ~ | 28 | 28 | 28 | 28 | 28 |
Ruby | 27 | 27 | 29 | 30 | 31 | 31 |
Perl | 25 | 25 | 25 | 25 | 25 | 25 |
PHP | 20 | 22 | 22 | 22 | 22 | 22 |
Bash | ~ | 22 | 23 | 23 | 23 | 23 |
Erlang | ~ | 15 | 15 | 15 | 15 | 15 |
Cython | 20 | 11 | 11 | 11 | 11 | 11 |
Zig | 6 | 6 | 6 | 6 | 6 | 6 |
scala | ~ | 1 | 1 | 1 | 1 | 1 |
Nim | ~ | 1 | 1 | 1 | 1 | 1 |
fish | ~ | ~ | 3 | 3 | 3 | 3 |
As you can see from the table, the rate of increase in programs written in Go is higher than any other language including Rust and Python.
Next time, I will update only the changing top languages, which are Go, Python and Rust.
language | June 2 | July 1 | August 1 | September 7 | October 2 |
---|---|---|---|---|---|
Go | 988 | 998 | 1006 | 1018 | 1029 |
Python | 777 | 783 | 783 | 789 | 788 |
Rust | 534 | 550 | 556 | 570 | 579 |
Update of August 1st, apps written in Go still almost 2X more than apps written in Rust.
Update on October 2nd, apps written in Go is still almost 2X more than apps written in Rust.
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 , and GitHub .