On Friday, January 4, 2019 at 2:41:19 PM UTC-5, robert engels wrote:
>
> I still think it would be a nearly impossible task given the C code in the 
> wild - outside of threading, the common usage of  ‘unions’  - there is no 
> way I know of to map these to a simple Go struct, or even several - you 
> need something like protobufs. So even if you could convert, you’d end up 
> with code that is probably harder to maintain/verify than the original C 
> code. 
>

I've worked on a lot of this old infrastructure code  myself, which is how 
I know that use of unions and threading simply isn't that common in it. You 
have to bear in mind that a lot of it was originally written in the last 
century, before the standards people won their war.   So for practical 
purpose ANSI pthreads didn't yet exist, though  in the NTP case (the one 
I've been elbow-deep in recently) some threading stuff was bolted on later 
to avoid stalling on DNS lookups.

As for security checking each line..yes, in an ideal world, but not 
necessary for the translation to be a worthy improvement,  Sure, we know 
the C code is leaky, but given the verification properties of both 
languages, a line-by-line translation can't make you worse off unless 
there's some huge undetected hole in the Go libraries.
That's a bet I'm willing to make.

You haven't noticed what I think is a larger problem - preprocessor 
conditionals.  That's a headache.  Still puzzling on that one.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to