This is an answer-chaining challenge in which each answer builds on the previous answer. I recommend sorting the thread by "oldest" in order to be sure about the order in which the posts are made.
The task
The nth program to be submitted must run in n different languages; specifically, all the languages added in previous programs to be submitted, plus one more. The program must output 1 when run in the first language used in answers to this question, 2 when run in the second language, and so on. For example, the first answer could print 1 when run in Python 3, and the second answer could output 1 when run in Python 3 and 2 when run in JavaScript; in this case, the third answer would have to output 1 when run in Python 3, 2 when run in JavaScript, and 3 when run in some other language.
Additional rules
- Your program must run without erroring out or crashing. Warnings (and other stderr output) are acceptable, but the program must exit normally (e.g. by running off the end of the program, or via a command such as
exit
that performs normal program termination). - Each answer must be no more than 20% or 20 bytes (whichever is larger) longer than the previous answer. (This is to prevent the use of languages like Lenguage spamming up the thread, and to encourage at least a minor amount of golfing.)
- Using different versions of the same language is allowed (although obviously they'll have to print different numbers, so you'll need to fit a version check into the polyglot). However, you may not use a language feature that returns the language's version number. Repeating the exact same language is, obviously, impossible (as the program would have to deterministically print one of two different numbers).
- Tricks like excessive comment abuse, despite being banned in some polyglot competitions, are just fine here.
- You don't have to use the previous answers as a guide to writing your own (you can rewrite the whole program if you like, as long as it complies with the spec); however, basing your answer mostly on a previous answer is allowed and probably the easiest way to make a solution.
- You cannot submit two answers in a row. Let someone else post in between.
- As this challenge requires other competitors to post in the same languages you are, you can only use languages with a free implementation (much as though this were a cops-and-robbers contest).
- Note that the victory condition (see below) is designed so that breaking the chain (i.e. making it impossible for anyone else to answer after you via the use of a language that is hard to polyglot with further languages) will disqualify you from winning. The aim is to keep going as long as we can, and if you want to win, you'll have to respect that.
Answer format
As all the answers depend on each other, having a consistent answer format is going to be helpful. I recommend formatting your answer something like this (this is an example for the second link in the chain):
2. JavaScript, 40 bytes
(program goes here)
This program prints 1 in Python 3, and 2 in JavaScript.
(if you want to explain the program, the polyglotting techniques, etc., place them here)
Victory condition
Once there have been no new answers for 14 days, the winner will be whoever posted the second newest answer, i.e. the largest polyglot that's been proven not to have broken the chain. Extending the chain after that is still very welcome, though!