Re:Nuitka: a Python compiler written in Python
by tenacious_tuna on Thursday June 17, 2021 @10:51AM
(#27540186)
Can you share some examples? I'm very interested in a typesafe alternative to python, but low friction is also necessary.
[ Parent
| on HN ]
Re:Nuitka: a Python compiler written in Python
by lmm on Thursday June 17, 2021 @09:03PM
(#27546261)
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.
Re:Nuitka: a Python compiler written in Python
by tooltower on Thursday June 17, 2021 @11:18AM
(#27540527)
They said ML family, so that's usually OCaml and SML.
Re:Nuitka: a Python compiler written in Python
by nwatson on Thursday June 17, 2021 @11:38AM
(#27540785)
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.
Re:Nuitka: a Python compiler written in Python
by nestorD on Thursday June 17, 2021 @11:21AM
(#27540569)
F# comes to mind. It uses indentation instead of braces and has a nice ecosystem.
Re:Nuitka: a Python compiler written in Python
by adsharma on Thursday June 17, 2021 @10:57AM
(#27540257)
Why do you think python3 is not typesafe?
Re:Nuitka: a Python compiler written in Python
by packetlost on Thursday June 17, 2021 @11:08AM
(#27540391)
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.
Re:Nuitka: a Python compiler written in Python
by adsharma on Thursday June 17, 2021 @11:30AM
(#27540673)
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.
Re:Nuitka: a Python compiler written in Python
by packetlost on Thursday June 17, 2021 @11:38AM
(#27540789)
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.
Re:Nuitka: a Python compiler written in Python
by adsharma on Thursday June 17, 2021 @01:33PM
(#27542169)
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.
Re:Nuitka: a Python compiler written in Python
by goodpoint on Friday June 18, 2021 @08:58AM
(#27549808)
You mean https://github.com/metacraft-labs/py2nim ?
Re:Nuitka: a Python compiler written in Python
by adsharma on Saturday June 19, 2021 @07:02PM
(#27565327)
https://github.com/adsharma/py2many
pip3 install py2many
py2many --nim=1 foo.py