Hacker News new | past | comments | ask | show | jobs | submit login

Can you share some examples? I'm very interested in a typesafe alternative to python, but low friction is also necessary.



Personally I moved to Scala, which has a poor reputation because of some symbol-heavy libraries, but you can use it to write very clean Python-like code. Version 3 has actually added a more Python-inspired syntax with colons and indentation instead of braces.

Standard ML was where I started. As a language it's great, as an ecosystem it's limited. OCaml seems to be where the action is (and even then its packaging/dependency management isn't great - but then it can't be worse than Python's).

F# has a very good reputation but I haven't used it a lot myself.


They said ML family, so that's usually OCaml and SML.


I use JetBrains PyCharm with type annotations in my code. I run the type-checker/linter ("Inspect Code") every 10 minutes or so, it's muscle-memory at this point. It covers most cases, problem resolved.


F# comes to mind. It uses indentation instead of braces and has a nice ecosystem.


Why do you think python3 is not typesafe?


Because it's not? It has a type system but it's still duck-typed at the end of the day, and no amount of Mypy will change that.


It should still be possible to use the python syntax and a reimplemented stdlib to build a statically typed, typesafe variant.

I think you object to the name python3, because there is a duck typed interpreter that's popular.


You fundamentally cannot build a statically typed variant of Python without cutting portions of the stdlib, most notably `mock.patch`. You could do a good majority of it, probably enough to be completely usable, but at what point does it stop being Python? Go use Nim if you want statically typed Python-ish syntax.


py2many transpiles py3 to nim. Think of python as a way to interpret nim code if you like, with a large installed base of existing libraries.

There is demand for iterative creation of software: first get the logic out with the least friction and then think about types, resource leaks, good software engineering practices etc.



https://github.com/adsharma/py2many

  pip3 install py2many
  py2many --nim=1 foo.py


Type safety and static typing are orthogonal. Both C and C++ are statically typed, yet are not type safe, for instance.


nim-lang.org might interest you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: