clasp126...@icebubble.org
unread,Feb 16, 2022, 4:57:50 PM2/16/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to inferno-os
As I mentioned in another thread, I have been working a sizeable
contribution to Inferno: specifically, a set of library modules and
applications to provide functionality which is currently missing. The
code that I've written, so far, makes use of pick ADTs in several
places. Those who have ever used pick ADTs know that they can have a
tendency to make code more complicated, more difficult to maintain, and
generally look "uglier." But, when done correctly, use of "pick"
statements can be limited to just a few functions, or to a couple of
source files.
In the process of writing these library modules, however, I stumbled
upon (quite accidentally) Limbo's support for polymorphism:
specifically, type-parameterized functions and data. So, I went back
and began switching my code to use these polymorphic features, before
continuing to write any additional library code. Unfortunately, I've
discovered that Limbo's polymorphism support is very buggy and
incomplete. (Limbo's current inability to define polymorphic functions
on type-parameterized ADTs with "self ref" arguments means that it's not
really useful for general programming.) So I am left with two (less-
than-ideal) options for continued development:
(1) I could just forget I ever knew anything about polymorphism in
Limbo, and go back to using pick ADTs, exclusively. Among the
disadvantage of this approach: (1.a) If/when Limbo's support for
polymorphism is ever completed, someone would have to go back and
re-engineer my libraries to use a polymorphic API, (1.b) such API
changes would then require updating the applications which use the
libraries, and (1.c) pick ADT interfaces generally aren't as clean
as a true polymorphic interface would be.
(2) I could continue developing polymorphic APIs by "faking" the
polymorphic functionality which would be available IF Limbo's
polymorphic support were complete. Among the advantages of this
approach: (2.a) the cleaner, polymorphic, interfaces would be
available right from the start, and (2.b) if/when Limbo's support
for polymorphism is ever completed, applications using the libraries
would not need to be updated. Among the disadvantages of this
approach: (2.Z) the library code would have to be full of
programmatically looney "fake" polymorphic code as a stand-in or
placeholder for the real API. This craziness could cause confusion
for someone trying to maintain the library code. It could also
cause confusion for application developers who try to employ the
libraries' polymorphism more generally, under the mistaken
assumption that it's complete. (2.Y) If/when Limbo's support for
polymorphism is ever completed, there would be many places, spread
across the code for a few different libraries, where the "fake"
polymorphic code would then have to be removed/replaced/updated with
the correct (complete) polymorphic code.
(3) There also is a third, "non-option:" fixing the Limbo compiler. I
do not currently have enough of a working-knowledge of the compiler
to do this, nor know anybody who does, nor have the time to learn
enough about the compiler's internals to fix it on my own. Option
(3), therefore, isn't really a viable option.
So, I'm looking for advice on which way to proceed. Which way would be
less confusing? Which way would require less work? Which way would be
easier to maintain? Any comments/suggestions/advice would be welcome.