Post #4258254
2026-07-30 23:43 UTC
I've been thinking fully low-level languages really need to exist (C, Zig, Rust, etc) for mission-critical stuff, but I also think most other software doesn't *need* that level of control to still be of really high quality. Go has a GC and a runtime and I've seen some really excellent programs written in it for example... :blobfoxthinkanime:
I've been thinking about a sort of "mid-level language" approach, one where everything is on the stack by default and you have access to raw pointers (which can't be null and may be like indices under the hood or something). If you want heap memory, you have to manually allocate it with either:
- A garbage collector, which you are in charge of when it runs and when it has to free everything
- A memory arena, which you are in charge of when you free it
- Maybe some other allocation method? Object pools/buckets, etc?
It would ideally be memory safe though I'm not sure how to achieve that and also allow memory arenas without some super complicated borrow checker.
C interop would also be as easy as humanly possible so you can easily "drop a level" when you need to for performance, too.
The advantage of this idea is you'd have the ease of use and memory safety of higher level languages but you can still fine tune and opt into "easy" optimizations that are usually low-level language only.
What do you think?
Replies (2)
-
@spacekatia@girlcock.club 2026-07-30 23:51
@witchgirls@woof.tech it kinda feels like rust ticks a lot of these boxes? except it doesn't have a garbage collector but arguably its ownership system is more powerful and not too much more difficult to grasp
-
@IceWolf@masto.brightfur.net 2026-07-30 23:56
@witchgirls@woof.tech Cool idea! Swift is sorta kinda like this already; it just doesn't have a GC though, it uses reference counting instead. Objective-C actually had some kind of memory pool concept [NSAutoreleasePool!] Yeah that was it! and yeah. I miss ObjC.