• sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 days ago

    The GC in Go is fantastic IMO since it runs in a separate thread. I used it since 1.0 (switched our product from node.js), and dealt with all the the pain of an imprecise GC (fixed in 1.5?) and all the little improvements to arrive at it’s current state.

    The main issues I have with it are pretty core to the language, unfortunately, such as:

    • interface{} is basically a void*, but since it’s a fat pointer, it can hold nil without itself being nil, which can happen by accident
    • runtime reflection is a bad habit, but it’s unfortunately really common
    • it’s really easy to deadlock by making stupid mistakes; if it had automatic unlocking based on scope (like Rust, or something like Python’s context managers), we could solve this, but defer just isn’t good enough
    • no destructors - with destructors, we could build a solution to deadlocks

    Maybe they fixed some of those issues, idk, I haven’t used it for several years. I did use it for about 10 years though.