News for hackers. Stuff that matters.
Re:Rust Weird Expressions by peterkelly on Friday May 14, 2021 @09:27AM (#27154043)
This is what Python should have done.
Re:Rust Weird Expressions by egeozcan on Friday May 14, 2021 @10:27AM (#27154684)
JavaScript had something close, valid on the context level, with "use strict" (which is, I guess, borrowed from Perl), and I still don't understand why they don't repeat that for newer features that would be much simpler if they broke backwards compatibility.
Re:Rust Weird Expressions by Macha on Saturday May 15, 2021 @09:18AM (#27164932)
Didn't this end up in every Perl file having a ton of different "use" statements at the top for features that became expected?
Re:Rust Weird Expressions by egeozcan on Saturday May 15, 2021 @11:54AM (#27166317)
Perl model of enabling features individually was indeed too much, I was suggesting a language-level switch.
Re:Rust Weird Expressions by winstonewert on Friday May 14, 2021 @11:28AM (#27155291)
This approach only works for syntax level changes, it wouldn't have helped the problematic changes in Python 2 -> 3.
Re:Rust Weird Expressions by cyphar on Friday May 14, 2021 @01:25PM (#27157023)
Well, the ability to specify python version by module would've made migration much easier for everyone (in theory). But you're quite right that it wouldn't by itself be a solution -- it would also have required additional complexity to handle interoperability when calling between python versions, both in the runtime and the programs themselves (even a sufficiently smart compiler can't figure out what string encoding a python2 function expects).