Submitted by Viewer23 t3_11b4thz in coolgithubprojects
Comments
Viewer23 OP t1_j9w3by0 wrote
- I already use GO.
- The only dislike part about GO is it doesn't have a tunable GC.
In languages like Nim (that also compiles), you can actually tune it's GC to use different methods of Memory Management AND even turn it off.
https://nim-lang.org/1.4.0/gc.html
Python even has something similar. It has a gc package where you can completely turn off it's GC (or do other alterations)
https://docs.python.org/3/library/gc.html
GO's GC isn't bad. It does work amazingly however if you are working on projects where memory is crucial then GO's GC isn't going to help that much. Moreover, that gc will slow down the code / take a toll on the performance.
https://tip.golang.org/doc/gc-guide
Whereas C, it's manual memory management. You have full control over the memory. Since I like both C and GO, I decided that I want to convert some of GO's packages to C since Go's packages are very useful.
(In C, there are no split, join or cut functions similar to GO)
kabrandon t1_j9w5jbd wrote
Fair enough of a reason. I also use both Go and C. However, with C, I've determined that it's less useful to me as a general purpose programing language and more useful in niche circumstances (for me) where I'm doing embedded system dev work. Hence my question. Perhaps that's even the environment you're thinking of where Go's garbage collector is un-ideal.
thebrazengeek t1_j9wvzzw wrote
Go Arenas may be a solution to some of the issues you're having with Go's GC
Viewer23 OP t1_j9x32s6 wrote
Damn. I did not see this before.
https://github.com/golang/go/issues/51317 (talks about introducing arenas)
0rsinium t1_j9xiual wrote
You can disable or tune GC with GOGC env var or control it in runtime with debug.SetGCPercent: https://pkg.go.dev/runtime/debug#SetGCPercent
kabrandon t1_j9w02n5 wrote
It's cool that this exists, but... why not just use Go?