News for hackers. Stuff that matters.
Re:Python's “Disappointing” Superpowers by TeeWEE on Wednesday February 01, 2023 @04:43PM (#34618279)
All these features are nice and stuff... But they are often runtime features... At compile time Python doesnt tell you wether a program is correct. Which is fine for small programs or small services. But any big system is written in python is really hard to maintain without LOTS of unit tests...

Static typing, compile time checks just win in the long run. And with languages like kotlin you still have all the advantages, and you have nice tools like python has which execute at COMPILE time using DSL, which are type safe themselve..

Python has become mostly a toy language for me to write scripts in.

Re:Python's “Disappointing” Superpowers by CoastalCoder on Wednesday February 01, 2023 @05:26PM (#34618871)
> At compile time Python doesnt tell you wether a program is correct.

This is a general limitation of type systems, IIUC. If you want a type system to guarantee 100% program correctness, I think it can't handle an arbitrary Turing-complete program.

Re:Python's “Disappointing” Superpowers by ReflectedImage on Wednesday February 01, 2023 @05:29PM (#34618905)
No programming language tells you if a program is correct at compile time. Type errors aren't a very common type of bug either.
Re:Python's “Disappointing” Superpowers by kayodelycaon on Wednesday February 01, 2023 @06:07PM (#34619409)
The most common type error I see are unexpected null values. Which, surprise, is still a problem in many typed languages. :)
Re:Python's “Disappointing” Superpowers by bobbylarrybobby on Wednesday February 01, 2023 @08:19PM (#34620727)
“No programming language tells you if a program is correct at compile time” is technically true, but my experience is that about 99% of the refactors I do in rust, no matter how large, go back to working correctly as soon as the code compiles again. I don't think anything like this is possible in a language like python.
Re:Python's “Disappointing” Superpowers by necovek on Saturday February 11, 2023 @04:06PM (#34756350)
That's true, but mostly because one rarely compiles Python.

I've done significant refactors in untyped Python without much ado: as soon as your tests pass, code works too. I've done significant changes with tests passing on the first go.

Re:Python's “Disappointing” Superpowers by danpla on Friday February 03, 2023 @07:28AM (#34640203)
As I know, SPARK can do this (in particular, thanks to the strong type system).

https://learn.adacore.com/courses/intro-to-spark/chapters/01...

Re:Python's “Disappointing” Superpowers by chatmasta on Wednesday February 01, 2023 @04:58PM (#34618508)
What does "compile time" even mean for Python?
Re:Python's “Disappointing” Superpowers by RedTachyon on Wednesday February 01, 2023 @05:08PM (#34618638)
The moment you run the script, before it actually gets executed.
Re:Python's “Disappointing” Superpowers by mountainriver on Wednesday February 01, 2023 @07:20PM (#34620218)
Yes but a linter can