I implemented the Nimble type inference algorithm from Henry Baker's old Common Lisp paper in Clojure awhile back for #reasons. It's based on lattice/algebraic data flow (Kaplan-Ullman) rather than logical unification (Milner), and works well to calculate type specialization while compiling dynamic languages:

https://www.plover.com/misc/hbaker-archive/TInference.html

Yesterday I added a simple C generator to make something like Pre-Scheme <https://prescheme.org> for #Clojure

@jack which, obvs, fails when it hits the bignum transition.

#Lisp-like languages are not good just because they handle recursion well -- #Clojure, running on the limited and unextensible JVM stack, does not handle recursion well -- but because when a result cannot fit into one storage type, you can return it as another storage type, because data items are tagged with their type.

You cannot easily move automatically between int32 and int64 in C, let alone between int64 and a bignum library.