10
Write a program that:
- if a compiled language is used, compiles without errors
- if an interpreted language is used, runs without syntax errors
for every major release of your language, and produces different output for every major release under which it is compiled/run. (It may produce the same or different output for versions within the same major release, as long as it varies among major releases.) You may not output or use any part of the language version in your program.
A "major release" of a language is defined to be a publicly available release that added to the major version number. For example, C# has had 6 major releases, C has had 3 (K&R is not a numbered version and does not contribute to the count), and Ruby has also had 3 (due to version 0.95). What number constitutes the major version number can change over time (Java has had 8 major releases).
Any language used in this challenge must have:
- At least three major releases, and
- A dedicated Wikipedia article.
7
%put &sysver;That will be valid and produce different output in every major release of SAS. Might want to disallow version printing. – Alex A. – 2015-04-15T22:48:06.570If css counts as a language, it will be so trivial.. (but probably not easy to test) – jimmy23013 – 2015-04-15T22:52:05.837
@user23013: As far as I know, CSS doesn't count as a language for the purposes of this site. – Alex A. – 2015-04-15T22:57:16.827
@user23013 CSS is not a programming language: http://meta.codegolf.stackexchange.com/questions/2028/what-are-programming-languages/2073#2073
– EMBLEM – 2015-04-15T22:57:40.8671
Two questions: 1) Does "major release" have to be the earliest version that added to the major version number? For example, for Python 2 does it have to be Python 2.0.0, Python 2.0.1 (earliest on the releases page) or is something like Python 2.2.0 or 2.7.8 fine? 2) What happens if we can't get hold of very old interpreters/compilers or they don't work on our computers?
– Sp3000 – 2015-04-16T03:46:16.087@Sp3000 It can be any subversion within the major release, and even vary within a major release, as long as it is different among different major releases. As for old versions, I guess you'll have to choose a different language, then. – EMBLEM – 2015-04-16T04:14:52.330
3
The J language does not support or distribute versions older than J5, and even if you tried you would be extremely hard-pressed to find anything more than documentation for J4, and nothing for anything older. Further, J8 was a major release, but nothing in the engine changed, only in the IDE and window libraries. Which major releases of J (1 <= n <= 8) must be supported?
– algorithmshark – 2015-04-16T05:26:15.8074
This question is basically a less well specified generalisation of this one.
– Peter Taylor – 2015-04-16T07:42:38.8032The "for all major release" part makes the challenge harder for languages with many major versions. It also increases the work needed to set up the environment for testing. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ – 2015-04-16T09:49:52.237
How about PHP? There's no way to test PHP1-3... And it had so many versions......... – Ismael Miguel – 2015-04-16T21:00:15.950
1The popularity contest tag means that you should accept the most popular answer, i.e., the one with the highest vote tally. – Dennis – 2016-01-25T06:43:34.523