Be very careful with memory management. Last I used it, the requirements/guarantees wrt Go-owned memory were unclear/poorly documented.
-
-
The requirements were defined and documented a few releases back. There's also a runtime check for the rules. No as bad anymore.
2 replies 0 retweets 0 likes -
Is there some kind of pinning mechanism for Go memory to avoid having to make copies?
1 reply 0 retweets 0 likes -
You can just share things directly, no copies required, in most cases. See https://golang.org/cmd/cgo/#hdr-Passing_pointers …
2 replies 0 retweets 0 likes -
I remember reading that at some point. It's still *very* restrictive. Works fine for flat buffers but data structures are hell.
2 replies 0 retweets 0 likes -
I think that is an important point of any bridge between languages/runtimes: expect nothing but the simplest of data to work.
1 reply 0 retweets 0 likes -
I respectfully disagree; I think well-designed FFIs should be able to accomodate almost every use case without ugly workarounds.
1 reply 0 retweets 0 likes -
Doesn't mean it needs to be *easy* but it needs to be *possible* without using gross hacks that veer way off course from the expected usage.
1 reply 0 retweets 0 likes -
For example, I usually do Python->C interop with Cython, and that works very well. Not everything is trivial but it's a *lot* nicer than Go.
2 replies 0 retweets 0 likes -
Well, Go has a fancier runtime than Python. That's the cost.
1 reply 1 retweet 2 likes
You can have a fancier runtime and still maintain flexibility. That argument is lazy.
-
-
I disagree but I doubt I'll convince you so I'll let you win this round.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.