Count all programs written/built in Go/Rust/Python/.. and distributed via Homebrew. A translation of gobrew.
I found the post of the developer of gobrew and thought it was interesting to translate it to Rust. The post is called Go vs Rust usage in Homebrew Core formulae on my website and I would recommend reading it, if you haven't yet.
# get deps, build the "rustbrew" executable
$ cargo build --release
# will show the count of packages written in Rust in Homebrew Core (by default)
$ cargo run --release
No language nor build system nor library is specified. Counting packages built in Rust (by default):
524
$ cargo run --release -- -l rust
524
$ cargo run --release -- --lang rust
524
$ cargo run --release -- -l go
974
$ cargo run --release -- -l cython
12
$ cargo run --release -- -l ruby
27
$ cargo run --release -- -l lua
51
$ cargo run --release -- -l zig
6
- all versions of python
$ cargo run --release -- -l python
771
- specific version of python
$ cargo run --release -- -l [email protected]
718
$ cargo run --release -- -l [email protected]
67
$ cargo run --release -- -l [email protected]
10
$ cargo run --release -- -l [email protected]
6
$ cargo run --release -- -l [email protected]
2
# get the packages built with "ninja" build system
$ cargo run --release -- -l ninja
253
$ cargo run --release -- -l gcc
75
$ cargo run --release -- -l cmake
1011
$ cargo run --release -- -l meson
213
$ cargo run --release -- -l swig
32
$ cargo run --release -- -l llvm
51
$ cargo run --release -- -b
All Build Dependencies Count: 320
[ghostscript openjdk@8 libsigc++@2 ucl m4 pcre scala gengetopt automake [email protected] tl-expected xmake libtool docbook-xsl perl cweb lua pyinvoke cmake swig coreutils imagemagick gperf spdlog gnu-tar libevent sphinx-doc gputils gsettings-desktop-schemas tcl-tk unifdef gi-docgen graphviz go-md2man nasm bind freetds json-glib xbyak rustup-init counterfeiter vulkan-loader cpptest cargo-bundle libelf mkfontscale cargo-c jinja2-cli tradcpp pnpm ocaml-findlib gtkmm tclap libx11 libgpg-error [email protected] pipenv llvm [email protected] [email protected] node gradle@6 libpq [email protected] vim sip nlohmann-json protobuf dune nkf openssl@3 doctest [email protected] gtk-doc yarn hidapi sbt mage dos2unix asciidoctor hpack gmp flatbuffers t1utils keystone ronn ocaml pandoc [email protected] lzip miniupnpc xorgproto opam mvfst docbook2x texinfo cc65 libxkbfile gatsby-cli mdds protobuf@21 go cppunit [email protected] [email protected] glide python-setuptools [email protected] [email protected] gox lpeg node@14 ecl util-linux glm asciidoc go-bindata spirv-llvm-translator gpp boost gobject-introspection boost-build opencl-headers vala dub libetonyek valijson [email protected] maven sdcc gnutls doxygen gnustep-make [email protected] socat breezy gcc mandoc jam llvm@16 luarocks ocaml@4 librsvg cereal mercurial erlang gzip intltool pillow numpy eigen ant glib extra-cmake-modules binutils texi2html xz bmake mk-configure cabal-install libatomic_ops help2man libuv vulkan-volk [email protected] bash groff meson nginx nim google-sparsehash qt [email protected] googletest autoconf-archive opus freetype ki18n httpd lndir docbook po4a gawk node@18 ruby tmux tlx libosmium gtk4 yasm qt@5 check wabt xmltoman bsdmake apr grep pyqt-builder pod2man ispc rsync cython re2c cpanminus pybind11 cscope cxxopts util-macros xcb-proto cli11 osinfo-db-tools ford apr-util fpc ifacemaker font-util yelp-tools [email protected] libgcrypt ghc bazelisk [email protected] pkg-config bat libwpg libxt openjdk@11 gnome-common pypy spice-protocol python-lxml byacc [email protected] scons texlive msgpack-cxx halibut uthash dtools rebar3 nettle libxslt openjdk flex pygobject3 glktermw lit helm gettext itstool shfmt zig antlr scdoc haskell-stack fmt molten-vk autoconf dmd clojure asio gnu-getopt crystal libarchive rapidjson xmlto gradle smake quickjs docutils w3m bison cmocka gnu-sed libconfig cpptoml mingw-w64 dotnet xa pyyaml desktop-file-utils make hevea lowdown cunit foma [email protected] [email protected] gnupg poetry chafa emacs netsurf-buildsystem sassc rpcgen fontforge ocamlbuild ragel argp-standalone xtrans rust rustfmt ldc just [email protected] vulkan-headers libsodium mlton buildapp pcre2 libscrypt erlang@25 mockery mcpp repo mlkit ninja [email protected] ccache luajit]
$ cargo run --release -- --build-dep
All Build Dependencies Count: 320
[xmake grep ronn gobject-introspection ocaml font-util mkfontscale lpeg ucl vulkan-volk yarn glib ragel libconfig mandoc xtrans bat libosmium automake flex xz fmt clojure cpanminus vulkan-loader docutils protobuf@21 jinja2-cli doxygen extra-cmake-modules gatsby-cli httpd halibut rustup-init ruby cargo-c crystal miniupnpc dtools dub node@14 gtkmm msgpack-cxx socat boost rustfmt cweb foma binutils wabt googletest libtool libxslt hpack asio meson poetry ifacemaker python-setuptools desktop-file-utils cxxopts glktermw byacc xbyak openjdk@11 uthash bind go-bindata graphviz argp-standalone protobuf eigen [email protected] gnu-getopt libgpg-error libpq ocaml@4 mockery libuv flatbuffers [email protected] [email protected] coreutils emacs unifdef lndir cmake bsdmake dotnet librsvg libevent [email protected] nettle mingw-w64 cli11 perl gmp freetds pybind11 openssl@3 rpcgen docbook xmltoman libgcrypt util-linux [email protected] pyinvoke ocaml-findlib [email protected] apr pod2man pandoc erlang@25 gnustep-make spirv-llvm-translator libxkbfile itstool rebar3 libetonyek libsigc++@2 pyqt-builder autoconf boost-build tcl-tk apr-util cscope autoconf-archive shfmt openjdk hidapi mvfst openjdk@8 tclap maven pcre2 breezy asciidoctor libwpg jam keystone valijson scdoc hevea mlton groff libelf bash opencl-headers osinfo-db-tools sip dos2unix gnutls xa ghc quickjs erlang chafa gperf vim antlr cunit pkg-config yasm lowdown netsurf-buildsystem [email protected] pypy re2c lua gzip gnupg ghostscript nim docbook-xsl xmlto ldc counterfeiter yelp-tools xcb-proto bison mcpp pipenv rust [email protected] imagemagick ispc tmux [email protected] gettext glm gcc pygobject3 ecl [email protected] libx11 pcre gnu-tar libxt node scala util-macros [email protected] node@18 freetype lzip swig vala m4 sassc ocamlbuild gsettings-desktop-schemas pnpm go-md2man gawk gnome-common go llvm pillow smake nkf ccache [email protected] buildapp repo gtk4 cabal-install sphinx-doc xorgproto [email protected] tlx [email protected] ford ki18n doctest cpptoml po4a luarocks opus gi-docgen [email protected] spice-protocol dune tl-expected gradle@6 tradcpp intltool mk-configure rsync libsodium [email protected] llvm@16 ant help2man qt check [email protected] sdcc cpptest luajit json-glib gradle qt@5 texi2html docbook2x bmake fontforge [email protected] python-lxml vulkan-headers spdlog cc65 helm haskell-stack dmd just texinfo texlive cython gpp molten-vk cereal rapidjson nasm cmocka mlkit mage bazelisk gputils gtk-doc libscrypt asciidoc fpc gox nlohmann-json cppunit w3m mdds lit t1utils scons gengetopt google-sparsehash [email protected] libatomic_ops gnu-sed zig sbt cargo-bundle pyyaml make [email protected] numpy mercurial [email protected] [email protected] nginx glide ninja libarchive opam]
- get all Homebrew Core formulas
- save core_formulas as a file onto the disk
- get each package JSON file
- get count of packages which are written/built in Rust language
- ability to set the language or build system
- include dependencies in calculation
- include build dependencies in calculation
- include test dependencies in calculation
- include recommended dependencies in calculation
- include optional dependencies in calculation
- count all versions of the language by default
- re-download Homebrew/Core formulae index JSON file if the local one is older than 7 days