Hacker News new | ask | show | jobs
by pjmlp 3420 days ago
> To me they're very discrete things, if you can't manually manage memory(raw pointers and the like) then it's not a System Programming language.

Having a GC doesn't forbid that, in very specific cases.

Mesa/Cedar, Modula-2+, Modula-3, Oberon, Oberon-2, Active Oberon, Component Pascal, System C#, Swift, D are all examples of such languages.

2 comments

Rust, too, had an optional GC (where the choice is per-data, not global) for a long time and still intended to be a systems language (And was pretty successful at being systemsy IMO). I think there was a time when &-pointers didn't exist and all sharing was done through the GC too. At one point there was a realization that the new borrowing system could be used to write GC-less programs pretty easily, and that was a turning point after which the GC started being phased out in community usage and eventually removed from the language.
I never said anything about having a GC, just that if you can't poke directly at memory when you need to then you're going to have a heck of a time working on the Systems Programming space.
> if you can't poke directly at memory when you need to then you're going to have a heck of a time working on the Systems Programming space

That's possible in go with unsafe.Pointer. Go's runtime, GC and memory allocator are written in Go and make use of this.

Also remember Go was inspired a lot by Oberon-2. The Oberon languages were used for writing operating systems despite a GC. They just used assembly or UNSAFE constructs for stuff the type-safe or GC parts couldn't handle.
As mseepgood already replied, you can do that in Go.