links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
329 stars 42 forks source link

Abstract types for alien objects #1099

Open slindley opened 2 years ago

slindley commented 2 years ago

It is frequent when interfacing with JavaScript code to need to handle objects that do not have a Links type. They pass through Links via some alien JavaScript API, but Links code cannot itself inspect such opaque objects. Currently we can pretend that alien objects have some Links type, and we can ensure that Links code doesn't try to inspect them by choosing an uninhabited type such as [||]. It would be cleaner to be able to explicitly declare an abstract type to represent a particular kind of alien object. At the very least, we could build in one specific AnyJS abstract type for opaque alien JavaScript objects.

slindley commented 2 years ago

Related to #1016.