ta0kira / zeolite

Zeolite is a statically-typed, general-purpose programming language.
Apache License 2.0
18 stars 0 forks source link

Should internal inheritance be possible in C++ extensions? #159

Closed ta0kira closed 3 years ago

ta0kira commented 3 years ago

Since C++ extensions are now streamlined, the author no longer has access to the dispatching code. This means that the concrete declaration must publicly show all inherited types. This can look a bit strange.

For example, Argv in lib/util inherits a few categories, yet it isn't possible for a caller to get a value of type Argv. This means that the inheritance is purely for the purposes of generating the dispatching code. I guess the alternative is to just return Argv from global().


Allowing internal inheritance would be a bit awkward, because it would likely hide that inheritance in the .zeolite-module. This would make generating the --templates more difficult, because that information would be contained in a section that doesn't exist at the time --templates is called.

ta0kira commented 3 years ago

Probably not worth the effort. C++ extensions aren't meant to be the "real" user-facing API; they're supposed to be just functional enough to make C++ functionality available. The module author can then hide them in $ModuleOnly$ (e.g., EnumeratedWait in lib/thread) and provide a cleaner API using Zeolite code.

ta0kira commented 2 years ago

Forgot I'd already considered this when opening #192.