[TUHS] History of popularity of C

Chris Torek torek at torek.net
Mon Jun 8 07:15:26 AEST 2020


Yes, both Rust and Go are being used.

Rust has some advantages: like C++, it can compile to very fast
code that does not need a garbage collector but that provides
type-safety.  It also gives you thread-safety through clever
compiler analysis of who "owns" any given variable or data.

The ownership / lifetime-analysis / borrow-checker is quite
complicated and takes a lot of getting-used-to.  I have not
written anything "real" in Rust and had not had time to really
learn it (I was hoping to learn it for real and write code in
it the last few years, but that never actually happened).

Meanwhile, Go is actually a really nice language to use.  It has a
few quirks, but it gives you reasonably-fast-running code that
(because there is a garbage collector) does not require nearly as
much skull-sweat when figuring out who owns memory and how to make
sure it gets released appropriately.  Its built in channels and
goroutine support makes multi-threaded cod, and using all the CPUs
effectively, also much easier.

You pay (sometimes noticeably) for the GC, but the price is not
too bad in less time-critical situations.  The GC has a few short
stop-the-world points but since Go 1.6 or so, it's pretty smooth,
unlike what I remember from 1980s Lisp systems. :-)  (Note: I
started with Go 1.11, so I don't have a lot of history, nor that
much experience in it.  But I do like it.)

Both Go and Rust have build systems.  In Rust, this is a separate
front-end from the compiler proper (rustc): you run "cargo build",
for instance.  In Go, you run "go build", "go test", etc., to
build and invoke unit tests and so on.  Rust has generics (think
C++ templates, except sane) and Go lacks them although there's a
plan for them in Go 2.0.  Rust has, or at least had, rather bad
array support when I last looked at it: you could make an array
out of any type, but with only up to 32 elements.

Chris


More information about the TUHS mailing list