Ask HN: Statically typed, high level language for machine learning?
Hi, I've been self-teaching machine learning the last few months. Python seems the only option, but I don't like dynamically typed languages. Python doesn't even have constructs for making a variable immutable.
Also, I think type hints aren't a in the right direction, comparing it with type inference and generics in Haskell, for instance.
Is there any alternative?
3 comments
[ 4.8 ms ] story [ 14.6 ms ] threadhttp://mypy-lang.org
Perhaps the solution would be a full blown programming language which transpiled to Python the same way Typescript does. So, MyPi, but much more developed: interfaces, type inference, generics... Having access to all the Python libraries.
recent addition into `typing_extensions` allows that:
from typing_extensions import Final immutable_str: Final[str] = "cant change me"
mypy will then notice you in case the variable has been changed somewhere.
> Also, I think type hints aren't a in the right direction, comparing it with type inference...
that's quite vague statement, but mypy supports type inference to some extent - if you'll initalize a list with some strings in it, it will infere the type as list of strings etc