3 ms·
Very cool! Really beautiful output. Curious why you're using pipes to communicate when you can use CGO to make the go stuff it's own static C library and commu
by azinman2 10y ago
Very cool! Really beautiful output.
Curious why you're using pipes to communicate when you can use CGO to make the go stuff it's own static C library and communicate bidirectionally that way? Granted it's a bit more complex than that sounds (I've did this to bring v.io to iOS), but I'd figure that'd still be easier than the alternative?
- fogleman 10y agoHonestly didn't even think of that. Might have to look into it.
- AsyncAwait 10y agoAren't you limited then to C datatypes?
- icebraining 10y agoA pipe transmits bytes. You can transmit bytes in C datatypes, hence they're equivalent. Whatever serialization is used right now can be reused.
- azinman2 10y agoOr even better, actual bools and strings like a real API. I don't know what the Go library looks like in terms of an API, but the pipes are already requiring serialization. This at least makes that hookup slightly easier, although CGO bridge has some overhead to it, so it wouldn't completely surprise me if a FIFO unix buffer was in fact faster especially if there's serialization in both situations.