3 ms·
If you want Go-style concurrency, why not use Go in the first place?
by _ak 11y ago
If you want Go-style concurrency, why not use Go in the first place?
- jagger27 11y agoGarbage collection.
- _ak 11y agoWhat stuff are you working on where the runtime guarantees of the Go 1.5 GC aren't good enough?
- jagger27 11y agoMe personally? Nothing. I'm sticking with Go.
- _ak 11y agoExactly. I'd argue that the majority of people complaining about Go being unusable for them because of the GC would actually be able to deal with the GC easily. I'm working on a soft realtime application in Go, and the GC has never gotten in the way.
- fmstephe 11y agoCan you elaborate about your experiences writing soft real-time in Go. Is your project open source?
- lmm 11y agoRight back at you though: I'd argue that the majority of people complaining about OCaml (or even the JVM) being unusable for them (and using Go instead) would actually be able to deal with it easily.
- _ak 11y agoStop derailing this discussion about Go GC vs. C no GC.
- lmm 11y agoIt is relevant though. You're talking about the large number of people who are using C and don't need no GC as though they're people who should be using go - but if they don't need no GC they probably don't need a language as low-level as go full stop and would be better served by a more expressive alternative. Ultimately, a large proportion of "people who need go or C" actually need C, making this library a good idea.
- cthrowago 11y agoI can imagine it being nice if you're tied to existing C code. Or if you want C-style memory management.
- zobzu 11y agoI you've written advanced-enough go, you probably have a bunch of file that start with some C code before the Go code starts. Go simply can't interface everything the way C does. Go doesn't give you the same level of flexibility either. tldr: Go's great, but it's just not as powerful as C (unlike Rust or some others, which can do anything C does).
- _ak 11y agoWhat specifically are you talking about? Go can do syscalls perfectly fine, you can mess in your memory perfectly fine (even if you have to resort to the unsafe package), so what exactly is it where you think Go lacks flexibility compared to C? Because so far, your posting sounds rather hand-wavy.
- wishing_for_ffi 11y agoOne problem is that it's very hard to call go libraries from other languages (it requires a runtime). C libraries can be called from almost any language. There are many go libraries I would love to use, but can't because of this. I expect many others are in a similar boat.
- zobzu 11y agoFor ex try to read the data from a signal. Another example is to start a namespace before all threads start. I can go on for a while :)
- rumcajz 11y agoMy primary use case was writing network protocols (the stuff I had to deal extensively when implementing ZeroMQ and nanomsg). On one hand you want ultimate performance, i.e. no context switchers, manual memory allocation et c. On the other hand, you want the convenience of writing linear code without caring about what to do when function blocks.
- stefantalpalaru 11y agoYou don't even need to use Go, the gccgo implementation of the runtime (including garbage collection) is available from C: https://github.com/stefantalpalaru/golib https://github.com/stefantalpalaru/golib