Is it time to plan a move to Go?

Eric S. Raymond esr at thyrsus.com
Tue Nov 7 02:39:26 UTC 2017


Hal Murray <hmurray at megapathdsl.net>:
> But if you do a direct translation, you end up with code that still has all 
> the crappy structure that you started with.

That is true.  But crappy structure can be cleaned up after the
translation, and I'm particularly good at that kind of refactoring in
a language with a richer type ontology than C. On the other hand, the
thought of trying to do significant structural changes *as we verify a
translation* scares me - I do not think I am good enough to take
*that* risk, and I'm dubious that anyone is.

>                                       I think the main problem with 
> the current code is global variables.

To a first approximation, yes.

> If I was working on this, I'd look into starting from scratch and trying to 
> build things up by chunks.  The hard part would be the core of the 
> timekeeping stuff, processing replies from a server.  Between the RFC, the 
> book, and the code, we should be able to figure out how to do that.

I agree with half of that - the building-up-by-chunks part.

To the limited extent that I already have a plan, it's to peel
off chunks of low-level code (for example, the calendaring
functions - and isolate them in Go modules with their own tests.

But I think we'll get to a point - to be delayed as long as possible - when
there are no longer cut off clean chunks and we have to just sprint for a
brute-force, ugly but serviceable translation of the rest.

> Or maybe, look at chrony and try something new.

Alas, at that point we lose the conservative data center crowd.  Presenting
no-surprises behavior in the docs and amin tools is not an advantage to be
thrown away lightly.

> Is there a yacc/bison for Go?

There is.  If there weren't, or it turns out to suck, adapting a YACC
skeleton file to make a Go object is well within my competence - almost
weekend-project territory.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.




More information about the devel mailing list