News for hackers. Stuff that matters.
Re:Writing Python Like Rust by dbrueck on Thursday June 29, 2023 @12:05AM (#36516188)
I'm one of those people. :) Well, it's not so much that I prefer no explicit types, I just dislike how most languages require you to specify them, and to do so at the least opportune time, so I end up preferring languages that don't require them at all. (Ideally, the language would let you start with none and then layer them in as the design gels.)

FWIW, there are definitely ways to do it "right" in languages like Python, but it's a slightly different approach to dev than in other languages, so people create a mess if they don't shift, or if they are just untrained/sloppy/lazy/whatever. But when you have a team of people doing it right, it's really quite nice, even as the codebase grows large.

But if even just one person on the team can't be trusted to do it that way, you're probably better off in some other language.

Re:Writing Python Like Rust by skitter on Thursday June 29, 2023 @09:18AM (#36519959)
What do you think about e.g. Roc having whole-program type inference that always works and always infers the most general types?
Re:Writing Python Like Rust by dbrueck on Thursday June 29, 2023 @12:50PM (#36523094)
In isolation, I love the idea. I don't have a strong sense of how the tradeoffs would affect things in practice though.

Perhaps they are not a big deal, but if they are too restrictive, then maybe the next best thing would be to have anything go (like in Python or Javascript), but the compiler guides you to where it's having trouble inferring things.