Go and Rust
Eric S. Raymond
esr at thyrsus.com
Thu Sep 15 04:45:36 UTC 2016
Mark Atwood <fallenpegasus at gmail.com>:
> Go has a GC. the Go standard library and the complier implementation will
> always be utterly controlled by Google, and will be full of Google magic.
> Go's usecase is to solve Google's problems, and can basically be modelled
> as "compiled Python that forcefully avoids all of the kinds of typos that
> Dr Pike got annoyed with typing for the past 30 years". It may make sense
> to rewrite reposurgeon in Go, to break out of Python's performance
> Rust is "C with sane types and sane scoping and sane string handling and
> sane threading, with a focus on zero runtime cost abstractions". If
> someone was to write security critical internet facing daemons from
> scratch, Rust would probably be the right choice.
Yup, I'd say that's a pretty fair characterization of both.
Consequently, I am in fact thinking about moving reposurgeon to Go. Compilation
would be a performance plus, but the really big deal is getting out from under
the GIL - I have an actual concrete use case (author-address munging on large
repositories) that takes prepostorously long and needs to be broken up into
parallel threads that can be farmed out to multiple processors.
There are two things blocking me. One is it'd be a big job, too big
while I'm working on NTPsec. Reposurgeon is 11KLOC of *dense* Python,
and I think I'd have to reimplement some substantial pieces of the
Python standard library on top of that (Cmd, for example). The other
thing is the lack of catchable exceptions. I think I can live with
Go's other quirks, but that may be an actual showstopper.
If we decide we're brave enough and can get the funding, moving ntpd
to Rust is a possible future. It would have been impractical to the
polint of crazy with the code we started from, but that was 152KLOC of
removals and cleanup ago; at 75KLOC (and with about another 9KLOC
scheduled to drop when we move ntpq and ntpdig to Python) I think
it is now well within possibility.
(Especially if I can write a tool to semi-mechanize the translation,
which is oh so very much The Kind Of Thing I Do.)
In addition to the properties Mark mentions, Rust is designed to
make it relatively easy to prove claims about the behavior of code,
including security claims. That is interesting.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
More information about the devel