Skip to content

Comment on Ipcalc – Command line CIDR calculator with IPv6 supportparent

Comments

It's just a matter of what tools you happen to have preinstalled. Meson and Ninja are easier to install than the entire Rust suite or Go (using their official guide, anyway). They're in the standard repos rather than piping curl to bash or manually managing tar.gz downloads.

I would appreciate a Makefile for a project this simple but I do prefer the Meson/Ninja build system for projects like these.

easier to install than Go

Huh?!?!?!

I don't know about Rust (I know they like their install script), but for Go you can download a pre-compiled binary and you're instantly up and running. That option is not exactly hidden[1].

You don't even have to use an OS installer, e.g. for Linux/Mac you can download a .tar.gz file[1] unzip it anywhere and just run "go" based commands to compile stuff immediately (maybe adding it to your $PATH to make life easier).

But really. Go is a million times quicker and smaller than usual bunch of stuff you need to install to get a C thing compiled (and that's just the standard tools, before we start talking about random stuff like Meson or Ninja)

The point I was making is that Ipcalc is a simple CLI utility. It doesn't need all the baggage that comes with C compiling. Its practically made for Rust or Go.

You can also easily cross-platform compile with Go. Try that with C without jumping through hoops !

[1] https://go.dev/dl/

Perhaps "install" is the wrong word.

I want my software to be upgraded through the normal means. I don't want to monitor the Go website for new versions and I don't want the tools themselves to phone home with update checks (especially if Google is behind them).

I now notice that Ubuntu packages golang-go in their repositories, so I suppose Go is on par with Meson and Ninja. Strange that they don't mention that on their download page, though.

You can also easily cross-platform compile with Go. Try that with C without jumping through hoops !

Clang has "--target=arm-linux-gnueabihf" to cross compile to ARM. You might need to go more specific (i.e. "--target=riscv64 -march=rv64gc" for specific RISCV configurations) but it's just a single command line flag. With GCC/G++ you need the dedicated compiler packaged separately to save space, but you'd use environment variables (export CC="arm-linux-gnueabihf-gcc"; export CXX="export CC="arm-linux-gnueabihf-g++").

The only difficulty you'd run into is when you want to dynamically link the produced binary (because you need a compatible .so to link against). You'll have the same problem in any language, though.

Lol you have to setup the necessary build directories bin,src,etc and environment variables before using golang from tarball e.g. GOROOT, GOPATH, GOPROXY=direct or you’re gonna run into issues. Golang is easily the most overcomplicated when it comes to setup the of the dev environment.

It wasn't always like this, in the early days you only needed GOROOT and GOPATH. Nowadays there are numerous hidden envvar toggles like GOPROXY and GOMODULES111.

Even still, this doesn't seem more difficult than installing and learning how to use ninja and / or meson build.

It's only two commands, clearly stated in the docs. No configuration required.

    meson setup build
    ninja -C build
It's not like meson or ninja is an obscure tool either, contrary to what this thread suggests. They're both popular C/C++ build tools along with cmake.

True.

Which “standard repos” don’t contain the Go or Rust compiler these days? All the major distros have both, as far as I know.

The Rust documentation recommends "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" unless you're on Windows. The Go website tells you to download a tar.gz and extract it into your path. To me, that signals that you're not supposed to use your package manager to install the tooling (or face the incompatibility wrath if you try to do so anyway).

In comparison, both Meson and Ninja refer you to your package manager as a way to install them.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.