I had the following idea to approach language evolution:
Problem:
Languages try to be backward compatible by stabilizing, and only slowly
deprecating old features. This results in a language which does not
evolve. Some different takes about this:
C++: adds new features but does not fix problems, and often does not
remove obsolete features resulting in, well, C++.
Python: Minor versions which add new features, big version jump from 2
to 3 to make backward incompatible changes. The resulting
incompatibility was a big problem, almost 5 years after the release of
3.0 (December 3rd, 2008) people are still using 2.x. Rust seems to
follow a similar approach, devs are already defering features to 2.0 to
stabilize.
Other languages simply do not evolve at all and are replaced.
My idea to improve this situation would be to add a version tag in every
main crate, something like "#ver 0.10". For each version jump the
compiler would fix the code automatically, and convert it to the current
language specification. When the library/code is multiple versions
behind the conversions could be applied successively. This can be done
in a lot of cases, see python 2to3 script and even Google did this for
go with the tool gofix during development. With this change not updated
libraries would still be usable in rust. To simplify updating libraries
the compiler could, on demand, print out a report of problematic parts
and propose fixes. Some things can not be fixed with an automatic
approach, for these cases a classic deprecation mechanism or something
else could still be used.
Advantages:
Kind of backward compatibility to old code bases.
Rust can evolve and stay streamlined at the same time.
Compiler does not have to deal with deprecation mechanism, because you
can remove, and change things instantly.
When this would be in place i think it would be best to release
incompatible updates often, but with only a few changes. Every six
months for example.
What do you think about this?
Manuel
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev