News for hackers. Stuff that matters.
Re:Guido van Rossum joins Microsoft by _the_inflator on Thursday November 12, 2020 @12:28PM (#25072159)
With Anders Hejlsberg also at Microsoft, maybe they do something like type-safe Python similar to TypeScript?

Anyway, congrats to both MS and Anders! This will be very interesting for Python.

Re:Guido van Rossum joins Microsoft by duckerude on Thursday November 12, 2020 @12:31PM (#25072207)
> something like type-safe Python similar to TypeScript

That already exists, and van Rossum worked on it: http://mypy-lang.org/

Re:Guido van Rossum joins Microsoft by ehsankia on Thursday November 12, 2020 @01:11PM (#25072750)
Also Pyre [0] by Facebook and Pytype [1] by Google. More importantly, the core part (type annotations) allowing these libraries to exist has been added to core python for years now and keeps on evolving, so it is an ongoing effort.

EDIT: As mentioned below, also added Pyright [2] by Microsoft

[0] https://github.com/facebook/pyre-check

[1] https://github.com/google/pytype

[2] https://github.com/microsoft/pyright

Re:Guido van Rossum joins Microsoft by tracnar on Thursday November 12, 2020 @01:29PM (#25073014)
You forgot the one made by Microsoft, Pyright (and PyLance).
Re:Guido van Rossum joins Microsoft by ajliu on Friday November 13, 2020 @03:11AM (#25080167)
Having tried a good number of these various type checkers, it seems like Pyright is the only one that properly supports all of the accepted PEP changes to typing.
Re:Guido van Rossum joins Microsoft by bmitc on Thursday November 12, 2020 @12:37PM (#25072294)
Isn't that just F#?
Re:Guido van Rossum joins Microsoft by estomagordo on Thursday November 12, 2020 @12:42PM (#25072365)
In the sense that indentation has syntactical meaning, yes. Otherwise, no no no.
Re:Guido van Rossum joins Microsoft by bmitc on Thursday November 12, 2020 @12:57PM (#25072581)
I don't understand. You can take Python code and basically write the equivalent in F#, ignoring many of F#'s additional features. It would look similar (probably even be cleaner) and would be type-safe.
Re:Guido van Rossum joins Microsoft by augusto-moura on Thursday November 12, 2020 @12:47PM (#25072438)
F# is not even close of Python, they are very distinct
Re:Guido van Rossum joins Microsoft by bmitc on Thursday November 12, 2020 @12:52PM (#25072517)
Of course, one is a sanely designed language. :)

Joking aside, my question centered around that if one wants a type-safe Python, why wouldn't you just want something similar to F#?

Re:Guido van Rossum joins Microsoft by augusto-moura on Thursday November 12, 2020 @02:45PM (#25074020)
This is the same as asking for typed JS and getting Rust recommended just because the syntax is similar.

They are totally different, the core paradigm of programming is totally changed and most of the points of JS are not in Rust (meta-programming, garbage collection, community)

Re:Guido van Rossum joins Microsoft by duckerude on Thursday November 12, 2020 @12:59PM (#25072595)
You can add typing to an existing codebase, saving you vast amounts of work compared to rewriting in a different language.
Re:Guido van Rossum joins Microsoft by bmitc on Thursday November 12, 2020 @01:06PM (#25072687)
Can that really be done for Python and the vast amount of libraries? I don't get the sense that one could simply slap on a static type system on Python and get libraries typed for free.

That is unless we're talking about a gradual typing system for Python, where new Python code could be typed and integrated into untyped codebases, similar to Racket and Typed Racket.

Re:Guido van Rossum joins Microsoft by duckerude on Thursday November 12, 2020 @01:12PM (#25072766)
The existing type system (see e.g. http://mypy-lang.org/) is gradual. You can mix typed and untyped code, at the cost of some safety.

You can also write type stubs for libraries that don't provide type information.

Re:Guido van Rossum joins Microsoft by justanotheratom on Thursday November 12, 2020 @08:46PM (#25077886)
Agree: F# as a better Python

https://youtu.be/_QnbV6CAWXc

Re:Guido van Rossum joins Microsoft by bmitc on Thursday November 12, 2020 @10:14PM (#25078405)
Thanks. :) I believe you're the only one who does here.