Open mdempsky opened 8 years ago
Sorry for any disruption caused by revisiting this proposal.
The proposal in #70274 raises concerns related to cgoCheckPointer
. The desired solution involves integrating cgo into the compiler, which aligns with the general idea of this proposal. However, a notable difference is that this proposal does not seem to address cgoCheckPointer
or provide a plan for resolving the associated issues. For reference, #70274 suggests leveraging compiler pass like type inference and pointer analysis to address these concerns.
I’m leaving this comment as a marker to ensure that, as this proposal progresses, the concerns raised in #70274, particularly those regarding cgoCheckPointer
, are taken into consideration and resolved.
Currently cgo support is implemented with cmd/cgo as a separate tool that analyzes cgo-using Go code and transforms it into standard Go code. This proposal is to extract the analysis logic into a separate internal package that can be reused by cmd/compile and go/types directly without needing source rewrites. I.e., turn them into native cgo compilers, rather than needing a separate "cgofront" preprocessor step.
The expected benefits are:
Potential downsides and counter-arguments:
Alternative ideas that might achieve similar benefits while generalizing to tools other than cmd/cgo:
/cc @ianlancetaylor @alandonovan @griesemer