getty is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
getty @keweddji

Today I learned:
1. Plymouth—the software for displaying graphical loading animations for Linux systems—has its own custom scripting language, and
2. This dynamic type union thing is a feature of that scripting language:
mastodon.social/media/toOG6rxT

· Web · 7 · 12

@pasqui023 It's not just an intersection type, but for reasons that didn't make it into the screenshot. For example, the "inheritance" of two functions will try them sequentially to enable dynamic definition-by-cases, which is different than just dynamic intersection types.

@keweddji
and what is the difference from function overloading?

@pasqui023 It's not overloading, because overloading selects a function first (e.g. based on an argument type) and then runs it; this will always run the first function, and then if that one fails, it will run the next one in the chain: mastodon.social/media/mSnPG8Bv

@pasqui023 That's a good way of thinking about it. The weirdness to me comes from exposing a specific exception-catching mechanism using the same mechanism that creates dynamic intersection types as well as hashmap unions.

@keweddji
It seems more that when used on non function objects it does the dual of that operation

So in a sense it is quite elegant

@keweddji Reminds me of the Perl module that lets you make a variable that is totally different depending on string context vs numeric.