Live data from Hacker News

Pyre: A performant type-checker for Python 3

pyre-check.org

81–90 of 118 posts

Re: Pyre: A performant type-checker for Python 3

#81

Earlier quoted context omitted.

Yeah and even worse they disagree about type errors! We really need a modern Python alternative. I don't know of any that don't give up the REPL / single file script features which are pretty huge advantages of Python to be honest.

It's radically different, but the language where I've had the most pleasant repl-driven experience is Elixir. Because of how it's error handling works it's even sane to debug with a repl into live production in some cases.

I've started learning Elixir over the week and I can't see myself using Python for scripting again. They're very different languages but th experience feels similar, except I vastly prefer Elixir

Re: Pyre: A performant type-checker for Python 3

#82
post #66

Earlier quoted context omitted.

It's a problem the moment it has to interact with the outside world, especially DBs/serialization/... really any kind of I/O.

So Python can't do IO? Django doesn't exist? What are you talking about exactly?

I'm talking about type safety. Types matter, a lot, and python is a PITA to use without a system like pyre.

Re: Pyre: A performant type-checker for Python 3

#83
post #81

Earlier quoted context omitted.

It's radically different, but the language where I've had the most pleasant repl-driven experience is Elixir. Because of how it's error handling works it's even sane to debug with a repl into live production in some cases.

I've started learning Elixir over the week and I can't see myself using Python for scripting again. They're very different languages but th experience feels similar, except I vastly prefer Elixir

I wouldn't expect elixir to be good at scripting. What sort of libraries do you use?

Re: Pyre: A performant type-checker for Python 3

#84
post #34

Earlier quoted context omitted.

I have yet to successfully build a project with the strict mypy settings, without resorting to either turning some off or having to use an explicit Any. And a lot of the non-default settings are absolutely critical if you care about correctness. Lack of recursive types has been a major deal breaker for me. If you have a class Foo that can construct a class Bar, and a class Bar that can construct a class Foo, you can'…

This pretty much mirrors my mypy experience too. The only project I've ever successfully used it on was a single-file CLI tool that only used the stdlib. And by "successfully" I mean "it ran at all". Every other thing I've thrown at it has caused it to crash. I quite like the concept, but implementation has been rather abysmal as far as I've seen. Has it improved in ~ the past year?

I've been using it recently, but just as a vscode plug in for type hints, I don't run any additional checks afterwards, but it seems to catch type errors before execution. But it's been cpu intensive in a wsl container on larger >2k line py files. I haven't tried many others tho, so not really sure if there are better options out there.

Re: Pyre: A performant type-checker for Python 3

#85

Earlier quoted context omitted.

Yeah and even worse they disagree about type errors! We really need a modern Python alternative. I don't know of any that don't give up the REPL / single file script features which are pretty huge advantages of Python to be honest.

Wouldn't Julia be that language? Its fast, supports static typing, and is built from the ground up for machine learning/ data science. It also has a built in REPL.

Julia is nothing like Python though, and it has other flaws like 1-based indexing and huge delays loading packages as it compiles them.

Re: Pyre: A performant type-checker for Python 3

#86

Earlier quoted context omitted.

Yeah and even worse they disagree about type errors! We really need a modern Python alternative. I don't know of any that don't give up the REPL / single file script features which are pretty huge advantages of Python to be honest.

Node.js has a REPL, and there's nothing stopping you from putting your entire project into a single file.

True, but to use JavaScript sensibly you really need to use Typescript and ESLint (to ban the crazy old features like `var` and `==`).

But I do agree Typescript is one of the best alternatives today if you can stomach `tsconfig.json` `eslintrc` and `node_modules`.

Re: Pyre: A performant type-checker for Python 3

#87
post #10

As with package managers, there seem to be half a dozen different, competing type checkers for Python now...

It's starting to look like the huge embarrassment that is python packaging and environment management. I work with the language every day, and I still have no idea what am I supposed to use between conda, pip, setuptools/setup.py, pyproject, meta.yml, poetry, pipenv, etc... Conda is so slow that I sometimes wonder if we are being trolled by some cruel God of programming. Pip is faster, but version resolution is iffy.…

Just use setup.py and __version__, ignore fashion until a winner emerges. Hasn’t failed me in ~twenty years.

Re: Pyre: A performant type-checker for Python 3

#88

Earlier quoted context omitted.

Clearly didn't watch the talk then. He found that about 1-2% of errors in real world projects were type-related errors.

Fwiw this absolutely doesn't match my experience with pytype, both on my own work and, as I understand it, "at scale".

Ah yes... good old anecdotal evidence.

Re: Pyre: A performant type-checker for Python 3

#89
post #10

As with package managers, there seem to be half a dozen different, competing type checkers for Python now...

Yeah and even worse they disagree about type errors! We really need a modern Python alternative. I don't know of any that don't give up the REPL / single file script features which are pretty huge advantages of Python to be honest.

GNU Guile can do that easily, as probably many other languages. The ecosystem is what makes people stick to Python, especially in areas like data science. Ecosystems are generally difficult to compete with, because they rely a lot on mind share. Mind share is a bit like gravity, in that clumps of matter will collect more matter. It takes very motivated people to implement solutions anew in another language, piece by piece getting an ecosystem up to speed. Or a lot of money.

Re: Pyre: A performant type-checker for Python 3

#90

Earlier quoted context omitted.

Wouldn't Julia be that language? Its fast, supports static typing, and is built from the ground up for machine learning/ data science. It also has a built in REPL.

Julia is nothing like Python though, and it has other flaws like 1-based indexing and huge delays loading packages as it compiles them.

How is it nothing like Python?

1-based indexing is definitely not a flaw. And version 1.6 massively decreased package import and precompilation time.

Post reply on HN