4 ms·
In theory you should be able to AOT compile python now, with type inference. There are cases where the types are not inferable, as there are cases where the pro
by rabidsnail 16y ago
In theory you should be able to AOT compile python now, with type inference. There are cases where the types are not inferable, as there are cases where the programmer does not provide type hints. But I think an approach similar to clojure's where types are inferred when possible, type hints can be provided optionally, and runtime reflection is used as a fallback when the type cannot be determined ahead of time is a good approach. You generally don't worry about types in clojure any more than you worry about types in python; you only add type hints in performance-sensitive code in cases where the compiler can't figure out the types on its own.