
Ask HN: Statically typed, high level language for machine learning? - snrji
Hi, I&#x27;ve been self-teaching machine learning the last few months. Python seems the only option, but I don&#x27;t like dynamically typed languages. Python doesn&#x27;t even have constructs for making a variable immutable.<p>Also, I think type hints aren&#x27;t a in the right direction, comparing it with type inference and generics in Haskell, for instance.<p>Is there any alternative?
======
yedpodtrzitko
> Python doesn't even have constructs for making a variable immutable.

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

------
smt88
Other languages won’t have as many high-quality libraries. Maybe something
like MyPy?

[http://mypy-lang.org](http://mypy-lang.org)

~~~
snrji
That's right, but imho type hints are no the way to go, specially when many
types could actually be statically inferred by the compiler/interpreter.

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.

