vtereshkov / umka-lang

Umka: a statically typed embeddable scripting language
BSD 2-Clause "Simplified" License
1.08k stars 53 forks source link

Remove weak pointers from the language #306

Open vtereshkov opened 1 year ago

vtereshkov commented 1 year ago

Umka has some features that make the language more complex and difficult to learn than is usually acceptable for a scripting language, especially in game development, where the target audience is game designers, not even programmers.

The concept of weak pointers, introduced as a means of preventing memory leaks caused by isolated reference cycles, is particularly complicated. One cannot use weak pointers properly without revising the whole program architecture from the data ownership perspective. Thinking about data ownership is an unnecessary cognitive burden on a scripting language user.

Umka must be simpler.

If we want Umka to still rely on reference counting, there are two possible solutions that don't require user intervention into memory management:

Umka seems to share these features with Go, but Go's garbage collector is a project much larger (in terms of lines of code, as well as man-years) than the whole Umka compiler/interpreter.

When implemented, this feature will invalidate #279. For a possible full transition to a tracing garbage collector, see #200.

vtereshkov commented 6 months ago

Useful links from the discussion on Reddit: