HACKER Q&A
📣 apatheticonion

Is there a manually memory managed non concurrent Go (Golang)?


I like C but the lack of structural interface types and type parameters (generics) makes me feel less satisfied about the constructs I design in C.

I really like how Go (1.18) feels like C but with generics and a great structural typing system.

However, Go tends to ship large binaries and in exchange offers some nice runtime features like concurrency and high level types.

While these are great, I would love to know if there is a language similar to Go but without the runtime and garbage collection.

Here's some pseudo code demonstrating the sort of thing I am looking for

  interface IFoo {
    bar[T](value: T) T
  }

  func foobar(f IFoo) {
    f.bar("Hello!")
  }

  class Foo {
    bar[T](value T) T {
      return value
    }
  }

  func main() {
    var f = new Foo()
    foobar(f)
  }


  👤 cosheaf Accepted Answer ✓
There's Zig and Rust.