Can you please elaborate on your points. I would be interested in examples and specific things. I now learned nothing that prepares me to mitigate or even recognize possible problems. Just: cgo bad, trust me bro
yesterday i had to disable CGO (CGO_ENABLED=0) because of missing library error message in deployment server, but my question is: why this isn't by default?
Working with C in this way with a layer of Go in front of it means that there's an extra layer of complexity. For example, Go has a default way of handling memory alignment. In C, it's free rein. When you debug this, it is hard to figure out exactly what's happening, especially if it seems like a green flag all the way through.
@@rachellettuce I've seen a number of Go shops end up ditching cgo and the "plugin" package for IPC. My preference so far is where the parent spawns the child "library" process that exposes an RPC interface over stdin/stdout. gRPC is great for this as it multiplexes the stdio connection out of the box. It's probably the worst thing about Go - ABI interop with anything that wasn't built into the binary is just not stable.
Go is garbage collected, and C is not … Then try throwing in a v8 engine that hosts another garbage collected language by a non-garbage collected language, embedded in a garbage collected language 😅
Working with CGO I had some crazy bugs where just changing the order of seemingly random things would make code compile or not, just madness
Yeah, CGO can be a real head-scratcher sometimes. 😩
more like cno
@@roboto_ 🤣
In Star Trek terms: If C land is regular space, Go land is fluidic space; CGO, the interdimensional rift connecting them, is hostile and unstable.
@@bitmasked exactly!
Also I love your username
@@rachellettuce Thank you! Awesome channel - exactly my kind of ✨Content™✨
Can you please elaborate on your points. I would be interested in examples and specific things. I now learned nothing that prepares me to mitigate or even recognize possible problems. Just: cgo bad, trust me bro
I am learning how to make webserver in C.
build your own http implementation
Hell yeah! Definitely a great exercise
@@paca3107you have to do that when writing a webserver right? it was way easier than i expected not gonna lie
yesterday i had to disable CGO (CGO_ENABLED=0) because of missing library error message in deployment server, but my question is: why this isn't by default?
I thought this was gonna be about CS GO 🔫
Sorry :(
I thought it was just a typo of CGI lol
@@deafharp8944 high-key not a bad idea for a video 🤣
why is debugging hard, i can debug cgo code with breakpoints with vscode without a complex setup?
Working with C in this way with a layer of Go in front of it means that there's an extra layer of complexity.
For example, Go has a default way of handling memory alignment. In C, it's free rein. When you debug this, it is hard to figure out exactly what's happening, especially if it seems like a green flag all the way through.
Maybe Go shouldn't integrate but run them as separate process and only communicate with them in safe ways
Yeah I agree! I'm not sure how, or what's the best approach, but I feel like right now we have a duct tape solution that needs work.
@@rachellettuce I've seen a number of Go shops end up ditching cgo and the "plugin" package for IPC.
My preference so far is where the parent spawns the child "library" process that exposes an RPC interface over stdin/stdout. gRPC is great for this as it multiplexes the stdio connection out of the box.
It's probably the worst thing about Go - ABI interop with anything that wasn't built into the binary is just not stable.
I'm planning to spend my new year converting my python upscaling code to c++
@@yy84869 oof, I hope you like C++ at least 🤣
@rachellettuce is it worth it?, I am doing it for performance, even few ms will count.
@@yy84869 oh yeah definitely
@@rachellettuce thanks a lot, I really appreciate it.
halimshams.medium.com/python-vs-c-speed-comparison-48187511c595
Check this out!
great content you have a nice way of explaining things
I'm glad you enjoyed it! 🥰
@@rachellettuce happy new year 😉
@mr.shredder5430 you too 🤣
ok this explains why my code sucks when i work with tdlib
Go is garbage collected, and C is not … Then try throwing in a v8 engine that hosts another garbage collected language by a non-garbage collected language, embedded in a garbage collected language 😅
go could have been so good :/
@@-aexc- I know 😭
The CGo ghost
Going Ghost 👻
Deranged cousins 🤣
go L
🌹