On Thursday, January 3, 2019 at 5:46:39 PM UTC-5, Eric Raymond wrote:
>
> On Thursday, January 3, 2019 at 12:11:06 PM UTC-5, Jake Montgomery wrote:
>>
>> I would note that any tool that ports from C++, or even C, to Go is going 
>> to produce ugly, unmaintainable, and non-idiomatic code, at best.
>>
>
> These are two different cases.  I agree that graceful C++ to Go 
> transpilation is effectively impossible.
>
> On the other hand, I believe graceful, comment-preserving C to 
> idiomatic-Go transpilation is almost possible.  
>

I might believe that it could be comment-preserving and possible graceful, 
and pretty much human readable. But I seriously doubt that it could ever 
produce anything I would call idiomatic-Go. Perhaps we have different 
definitions of that term. Aside from the line by line form, I also mean 
"something that an experienced go programmer might write." Idomatic-Go by 
my definition, would include the use of things like interfaces and methods. 
It uses goroutines and channels where appropriate. That is what you want if 
you want "real" go code that is usable and maintainable. 

"Transpilation" is really just the first step. It can get you to a working 
code base, but turning it into truly idiomatic Go, that people want to deal 
with, is work that needs to be done by humans. IIUC, that's what the go 
team did with the compiler. Getting a Go version that was 100% 
functionality-faithful to the original C was crucial. But it was only the 
first step. 

-- 
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