this post was submitted on 19 Jun 2023
25 points (100.0% liked)
Functional Programming
1398 readers
1 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If the language has really good type inference (Haskell comes to my mind though F# was quite nice as well) it's better. It really makes life much easier.
However when dealing with real-world problems (just moving data around which are changing constantly) the types don't really add that much, you need to test anyway. Test suites is what I need. Clojure and Common Lisp are OK.
I agree. F# has also type providers (https://learn.microsoft.com/en-us/dotnet/fsharp/tutorials/type-providers/) that are a form of type-inference on steroids, for assigning types to external resources.
IMHO, whenever possible it is better using static typing, but there are real world problems where the nature of data is extremely dynamic, or the types are very complex. In these cases a naive but rigid static type system can be a problem. So in these cases it is better or a relaxed static type system where some constraints can be checked at run-time (i.e. like a dynamic type-system), or a very powerful static type system. In a certain sense, Common Lisp and Racket are examples of the first case, because you can add type annotations to code, so they are both dynamically and statically typed language.