4 ms·
You misunderstand me. I am not saying C does things better than Go. I am saying it is less expressive. In the sense that there are a lot of things you simply
by norswap 12y ago
You misunderstand me.
I am not saying C does things better than Go.
I am saying it is less expressive.
In the sense that there are a lot of things you simply cannot implement in C, whereas you can implement them -- in an ugly and unsafe fashion, it is true -- in C.
Generics is not the only example. You can easily get exceptions in C with setjmp and longjmp for instance. You can even get garbage collection in C (and not only talking about the conservative Boehm stuff, you can use fat pointers -- yes it's unwieldy and ugly, but it works).
As for all the niceties, yes there are there, but you can implement most of them in C also (and, in fact, people have).
You'll notice I did not even say C was better than Go.
My actual thoughts on the matter is that they're not made for the same use cases -- albeit one of my problem with Go was always figuring its use case. Apparently I'm not the only one confused, because the language creators expected to get C users, they got Python user instead. As you said yourself, it has more niceties, so maybe it is kind of a middleground when more performance or concurrency is needed, but C is deemed to tricky or unsafe. As I have learned to navigate my ways around C's pitfalls (and boy, there are some pitfalls!), I don't think I'll ever be tempted to use Go (at least, if the language doesn't change significantly).
I'm also not some kind of C fanatic, I use Java, Ruby or Python if it gets the job done; and while I don't really use them for actual work, I have a soft spot for some functional languages.
- bitg 12y agoYou could compare any language to machine language and you can say that language is less powerful. Go is not even close to the power of C and assembly. I'm not gonna even try to argue.