Is it possible to replace C and C++ with Go + cgo and interface frameworks such as Qt or DirectX with Go?
Any potential pitfalls I should be aware of?
UPDATE:
I see that my question was not precise enough. Of course I expected problems with Go concepts that aren't available in C/C++ e.g. goroutines. What I really wanted to know was if you could use Go to replace standard C++ functionality. I hope I can convey my idea: I thought of Go as a "scripting language" to leverage C/C++ libraries with a new language.
I'd like to know:
- Can you register Go methods as C/C++ callbacks ?
- Can I supply Go variables as parameters to C/C++ functions ?
- Are their pointers compatible ? Go runs on a native Vm, so I guessed there might be an abstraction layer over the memory that invalidates C/C++ pointers
Have you ever used cgo or know about its abilities ?