So what might make dynamic languages easier to write in? I enjoy dynamic languages more because: * "double kilometerToMiles(double km) { return km / 1.6 }" here the types are of really low value, yet I have to type them in. * a mutable list of generic and variable arity event handlers. Really hard to specify as a type (most languages cannot do it). Really easy to use. * co- and contravariance and lists, the math work…
What about:
toMiles (Kilometers k) = Miles (k/1.6)
Then you do: let x = Kilometers 5
print (toMiles x)
And, of course, any calculation will only accept the correct units. At this naive implementation, you'll have to add the conversions to satisfy the compiler, but there are Haskell libraries that bring automatic conversions too.Anyway:
> Like types that are null or non-null, or tainted (from the user) or non-tainted.
That's Haskell.
> Or two numbers that are kilometers vs miles.
That's my example up there.
> Or only accessible under a certain lock or other preconditions.
Yep, Haskell.
> And be flow sensitive (kotlin style null checks), not make me write even more code.
That's emulating what people do in Haskell.