5 ms·
Rust does not intend to be a replacement for C though, while Go does (partially).
by rhabarba 6y ago
Rust does not intend to be a replacement for C though, while Go does (partially).
- Zababa 6y agoRust is used in places where C is used though. For example it is used for Python cryptography where C was used before https://lwn.net/Articles/845535/ https://lwn.net/Articles/845535/. I doubt Go could be used this way. What do you mean exactly by "does not intend to be a replacement for C"?
- rhabarba 6y agoRust was developed to replace (parts of) C++, initially. C++ has a different niche than C.
- steveklabnik 6y agoRust doesn't "intend" to replace any programming language because we don't really believe programming languages get replaced. Rust does want to be useful in the same niches where both C and C++ are useful, among other niches and languages in those niches.
- pjmlp 6y agoIt sure can, https://www.f-secure.com/en/consulting/foundry/usb-armory https://www.f-secure.com/en/consulting/foundry/usb-armory https://tinygo.org/ https://tinygo.org/
- Zababa 6y agoI was talking specifically about the cryptography part, sorry if I wasn't clear enough. I don't deny that Go can be used for "low level" or embedded development. But, I don't think Go can be used to create libraries used in other languages easily.
- mappu 6y agoGo can do this easily - you just do `go build -buildmode=c-shared` and put a magic //export FuncName comment before any function. This produces a C ABI .so (Linux) / .dll (Windows). Although the resulting library is a little bit heavy (1-2MB) because it bundles the Go runtime and GC, and initializes it on first load.
- Zababa 6y agoThanks, that's something I didn't know about.
- nick_ 6y agoRust is a No true Scotsman of programming languages.