4 ms·
What you can do with Julia types is far more advance than I think you can do with any statically typed language. I can add a type annotation in Julia which is
by socialdemocrat 7y ago
What you can do with Julia types is far more advance than I think you can do with any statically typed language.
I can add a type annotation in Julia which is a function call which returns a type e.g. This function can be of any complexity.
I think a better approach is simply a Linter. You report type problems you can find and ignore the rest. Not point trying to figure out the more advance Julia cases.
I would assume 90% of Julia code will use types in a pretty straightforward manner and thus would be able to be analyzed by some sort of Linter. Lint.jl e.g.
- throwaway894345 7y agoYou're describing optional type systems; in this regard, Julia is on par with Python or TypeScript. The linter you're describing is also a type checker (like Python's Mypy). That said, it would be really interesting if someone would make a type checker that would evaluate/resolve those more complex types, at least those that can be guaranteed to terminate.
- socialdemocrat 7y agoOptional typing and what Julia does is quite different. Julia type system is nothing like Python or TypeScript. In Julia type annotations are not just a sprinkle of sugar. It has a very concrete use beyond asserting type consistency. Julia types are used to decide what code gets run and memory layout of data.