Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is certainly a fine language. One common instance where I would prefer C++, though, is when you are writing libraries for others to use. A language that runs on a VM can not easily be used as a library inside a language that uses another VM. You cannot easily write a library for Python in Go or vice versa. If you use a VM-less language like C or C++, your work can be used (through various wrappers, like SWIG or that Apache thing) by everyone.


If you want libraries for others to use, just use plain C. C libraries are trivial to use in almost all languages (from Ada to Yorick).


Doesn't Go compile to machine code as well without a VM in between?


Go has garbage collection, which I think some people confuse with using a VM.


It has a runtime statically linked. All linking is static and std call interfaces are not exposed so you cannot expose libraries to other language bindings.


I have worked on a large C++ program that uses Python for UI and some scripting components. I don't see why it would be harder for Go to use Python. Also, Lua is used everywhere.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: