News for hackers. Stuff that matters.
Re:In CPython, types implemented in C are part of the type tree by pansa2 on Thursday December 24, 2020 @05:03PM (#25531875)
> Would a more rigorously-typed alternate-universe Python have been as successful?

One of the reasons Python became popular was its reputation as “executable pseudocode”. Rigorous typing would detract from that.

Guido and the authors of Mypy clearly believe that now the language is popular, it can afford to add explicit types and become less like pseudocode. But I don’t think it would have become as popular had it taken this direction from the beginning.

Re:In CPython, types implemented in C are part of the type tree by lmm on Friday December 25, 2020 @02:59AM (#25535009)
> One of the reasons Python became popular was its reputation as “executable pseudocode”. Rigorous typing would detract from that.

Not necessarily, if it had good type inference. I write Scala that looks pretty close to Python (unfortunately the community as a whole makes extensive use of symbolic names, which I think is a mistake, but you can avoid those libraries), and with Scala 3's indentation-based syntax it can become even more so.

Re:In CPython, types implemented in C are part of the type tree by pansa2 on Friday December 25, 2020 @03:54AM (#25535216)
> I write Scala that looks pretty close to Python

Interesting. I’ve never used Scala - do you have any example code available?

Re:In CPython, types implemented in C are part of the type tree by lmm on Friday December 25, 2020 @05:18AM (#25535564)
Hmm, now that I look at it my personal code is mostly gnarly functional libraries. https://github.com/m50d/plus-minus-zero/ is probably the project that's closest to something I'd do in Python, but I've still used a fancy reactive library and some functional tools for dealing with the explicit async futures.

(It's a quick calculator tool to compute your European Mahjong Associaton rank score based on your tournament results, and can import your existing results through some quick and dirty web scraping. The domain linked from github has expired, but it's running at https://adoring-khorana-c20461.netlify.app/ - Scala usually runs on the JVM but this build is set up to compile to JS and run in the browser).