Is there a way to change the REPL's language, while it's running?
(edited: fixed typo)
It appears like one should be able to do so by changing the .replit file and adding the right
language = "..." entry (at least this is how it works when importing a repl from GitHub). However, the same does not seem to work when the repl is running, i.e. after you edit your .replit and refresh the page, the loaded repl still uses the previously defined language.
Is this because the instance the repl is running on has already been provisioned (and I would have to wait for it to be terminated first), or simply it's not possible to change one repl language after it's been created?
language paramater actually doesn't do anything.
The language that the repl is is set when you first import it.
@Coder100 are you sure about that? When I first imported this GitHub repository  as a new repl, it did not have
language = "nix" inside .replit, and the repl got created with language equal to "Bash". Then I added
language = "nix", re-imported it, and the repl turned out with language set to "Nix".
So I think
language = ... inside .replit does indeed something...but maybe just at repl creation time.
@Coder100 I just told you I imported a repl from Github, so I did not explicitly selected a Language from the dropdown, simply because there was no dropdown to begin with.
- Same repo
language = "nix", the repl got imported with language set to Bash
language = "nix", the repl got imported with language set to Nix
Maybe I got lucky, but I find it hard to believe that setting
language = inside .replit does not do anything at all -- simply because I got different results when I did specify it, and when I did not.
You can't change the language of a repl, but the .replit file can change which file runs. If you want a different replit language just copy+paste everything into a new repl
@MrVoo so just to confirm:
- you can add
language = "nix"to .replit, but that will be used only while importing repls from git/GitHub (I just tried this, so I am sure it works this way)
- any subsequent change to that line will have no effect, and the only way to change language would be delete+create