Stack Exchange's official stance is that
Since Stack Overflow launched, we’ve been trying to explain that it’s not just a Q&A platform: it’s also a place where you can publish things that you’ve learned: recipes, FAQs, HOWTOs, walkthroughs, and even bits of product documentation, as long you format it as a question and answer.
So we can accumulate any kind of relevant information on this SE site, as long as we can format that information as Q&A. The important word here is "format" - the Q doesn't need to be an actual question; it just needs to be formatted as such.
As I already said in the comment, "How do I prove this statement in each proof assistant?" is a valid question in this format. And then the corresponding answers would be "You can write this in Lean", "You can write that in Coq", etc. So the Q&A format is not the limiting factor in my opinion.
But, I also partially agree with Guy Coder that an external website dedicated to such a collection of code examples might be a better solution. One reason is organization of information; Rosetta Code supports various features that help browsing and contributing to the site (albeit hacky at times, given that it runs on top of a wiki platform) such as
- a list of all tasks in one page
- a list of tasks solved/unsolved in each language
- a system to propose new tasks/languages
- a discussion "board" for each task, and a global one
SE doesn't support any of these. (Well, technically we can discuss stuff about rosetta-stone posts on this Meta, but it would be mixed with other site-wide discussion.)