Is Go Used in Production more than Rust ?

ยท 932 words ยท 5 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

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).

languageApril 26May 15June 2June 12June 24July 1
Go957981988994990998
Python771773777779780783
Rust524528534540546550
Node~202202203203204
Lua475151515050
vala~4848494949
Ocaml~2828282828
Ruby272729303131
Perl252525252525
PHP202222222222
Bash~2223232323
Erlang~1515151515
Cython201111111111
Zig666666
scala~11111
Nim~11111
fish~~3333

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.

languageJune 2July 1August 1September 7October 2
Go988998100610181029
Python777783783789788
Rust534550556570579

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 .

Share:
waffarx cash back