You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a C programmer and I love Go. A very important feature that I think Go need is if you can use GC or not. I'll explain, GC it is useful in certain contexts but in other contexts no, for example in system programming. So I think for example one possible thing it could be "import GC" and you can code with GC, if you don't import GC you need to alloc the memory manualy. This would improve the language and also would leave a lot of freedom to developer's. In my dreams I would like to replace all my C programms with Go.
I rest avaiable to further clarifications.
The text was updated successfully, but these errors were encountered:
Perhaps it should be the other way around, I'd rather not break every existing Go program!
Also, while it's a good idea, Go doesn't make a distinction between pointers on the heap vs the stack, so you can't be entirely sure which memory you need to free and which ones you don't. Another confusion would be that "gc" also stands for "Go Compiler" (lowercase typically means Go compiler, uppercase means garbage collector)
On the other hand, I'd imagine that this would reduce the runtime size and speed up the program if you know what you're doing.
It'd also be weird to have libraries that have GC interacting with libraries that don't have GC. I feel like that'd complicate things a lot
Setting GOGC=off disables the garbage collector. You can use calls in the runtime package to force a manual garbage collection.
Go is not C. The garbage collector is an essential component of the language. At this stage of the language, what you propose would be an extremely invasive change which would go against the overall design choices made by the language.
I'm a C programmer and I love Go. A very important feature that I think Go need is if you can use GC or not. I'll explain, GC it is useful in certain contexts but in other contexts no, for example in system programming. So I think for example one possible thing it could be
"import GC"
and you can code with GC, if you don't import GC you need to alloc the memory manualy. This would improve the language and also would leave a lot of freedom to developer's. In my dreams I would like to replace all my C programms with Go.I rest avaiable to further clarifications.
The text was updated successfully, but these errors were encountered: