5 ms·
This is a really cool concept. And no, I don't know of any other languages that have something like this -- but I'm not convinced it's actually a good thing.
by rauljara 14y ago
This is a really cool concept. And no, I don't know of any other languages that have something like this -- but I'm not convinced it's actually a good thing. Promising to never break old code means that your language can never really fix old mistakes. The only way you can evolve your syntax is by adding more, never changing or taking away ideas that turned out to not be very good. But, at the same time, not breaking old code is really nice, and something that has probably helped to keep perl relatively popular.
One solution I like a lot actually comes from a terrible language. The Stata statistics package has its own language, that is awful. But at the top of each file, you can specify the version of the language that you are writing in. If the version isn't specified, it uses the most recent interpreter; otherwise it uses the interpreter specified by the version. It allows the syntax to evolve without ever breaking backwards compatibility. Newer versions can call functions[1] written in older versions, so they still have to maintain backwards compatibility of the virtual machine. But aside from that, they could completely rework the syntax and no old code would break.
From a programmer's perspective, it's a fairly elegant solution to handle different versions.
--edited a few times for clarity
[1] Stata doesn't really have a way to make user defined functions. Instead, they're called programs, which should give you some hint as to Stata's awfulness.
- nnutter 14y agoPerl does something similar, see the [feature] keyword. [feature]: http://perldoc.perl.org/feature.html http://perldoc.perl.org/feature.html
- sigzero 14y agoThey don't promise to "never" break old code. There is a big discussion about cleaning up Perl going on (and getting funded by The Perl Foundation) I believe.