🐶🐾🤣🤣🤣
Discussion
Beginning to sound like someone who’ll be into Haskell in a few years.
haha, don't get me started on that silly memory copy insanity of the pure function
it's at the centre of the debate between GC, malloc and insane shit like Rust borrow checker but i think that, as Go and Java both use GCs and both are within spitting distance of C/C++ performance that the problems of GC only exist in people's imaginations and for purposes like operating system kernels and embedded systems with no memory
My applications are hard real time embedded applications, which pretty much eliminates GC’d languages from the running for work. It’s an alien world compared to 99% of what goes on around here so I’m sure I sound like an idiot.
C# is still one of my favorite languages for non-real time stuff (not sorry) but I am very attracted to Go for the goroutines. Seems like a really nice approach to parallelism. The static linking is cool too, unless you’re working on something proprietary (GPL hell).
yep, goroutines and channels being first class and the functions as values are the three features that make me addicted to go, it's a whole different way of thinking
almost no other languages have coroutines at all and none have it as a low level syntax, maybe you could do it with operator overloading in C++ but that shit is messed up
unfortunately the GC and CSP kinda go hand in hand but in actual fact you can turn off the GC and you can write code to manage memory manually, in fact many network handlers in Go are written with allocate-once freelists, and you can actually do this for a whole application
as it is, i personally avoid using the compact declaration asignment operator for things, as many people use them inside if and for blocks without thinking about whether it makes sense to allocate yet another value on the stack when there already is one with the same name, and scope shadowing can hide some bad bugs
I’ll look into GC’less golang tomorrow. You’ve given me an interesting rabbit hole to go down…
yeah, there is a variant also, tinygo https://tinygo.org/ which supports almost everything in go except for GC, main point is it will let you use coroutines, even on one core you can use coroutines, they are possible to use that way (with channels as well of course)