Why would ad-hoc scripting require more flexibility with a type system? What kind of flexibility? Is it that you need more types? Or more union types to handle all the different variations that are the same, but all slightly different?
Re:Show HN: Purely Functional Scripting
by continuational on Sunday August 04, 2019 @02:13PM
(#20608233)
Anonymous records and variants are convenient in a scripting language because you don't have to declare them. This in turn leads to anonymous record types and anonymous sum types, which require something beyond HM for type inference, and I wanted to avoid introducing row variables.
TopShell uses type constraints for this, and I've never implemented a type constraint solver before TopShell. There are also some extra things to do around checking explicit type annotations, when the user provides them.
In TopShell, Streams are analogous to pipes. The primary way you use TopShell Streams is by combining and transforming them into new streams. The interface for streams is very similar to what you might find in a Functional Reactive Programming library, and indeed it can be used to eg. animate SVG based on data that's streamed from somewhere.