3 ms·
Dynamic languages do do type inference. Or at least they can. Julia does type inference at compile time. The difference is that it doesn't have to succeed. If
by oxinabox 7y ago
Dynamic languages do do type inference. Or at least they can.
Julia does type inference at compile time.
The difference is that it doesn't have to succeed.
If you write type unstable code then it won't.
- socialdemocrat 7y agoYes... but I feel that is more like an implementation detail. Semantically speaking you don't think of Julia as doing type inference. Semantically speaking expressions don't have types and the type of expressions are never inferred (however they are inferred at compile time as an implementation thing for the JIT). My point is that you can make an alternative Julia implementation that did absolutely no type inference and everything would work just fine apart from possibly bad performance. However you could not make a compiler for a statically typed language such as Haskell which did not do type inference. If you did programs would no longer compile. At least that is how I interpret the difference. I could be wrong. You probably know this better than me.