| Bytes | Lang | Time | Link |
|---|---|---|---|
| nan | 250804T134418Z | Steve Be | |
| 002 | 2 languages | 250804T131926Z | Steve Be |
| 005 | 3 languages | 220208T193228Z | user1008 |
| nan | 201001T011501Z | Jonah |
Alternative answer
It's a bit hard to tell whether this is valid or not, but maybe this works in F# and OCaml.
fun _->infinity
It's a lambda that you have to assign to something and run. I don't think it's possible to call a function without passing something, but the something is ignored, so I don't know if that counts as using input.
F# (.NET Core), 17 bytes
fun _->infinity
OCaml, 17 bytes
fun _->infinity
2 languages, 2 bytes
jq
[]
Running jq with the -n flag ("--null-input / -n: Don´t read any input at all. Instead, the filter is run once using null as the input.") which seems to be the reasonable way to use jq for this challenge.
Outputs []
Removing either character makes a syntax error. Removing both causes a different compilation error.
JavaScript (browser REPL)
[]
Outputs []. Depending on the REPL, it might not actually be possible to make a program attempt to run with characters removed.
Comments
Ok, this seems like an interesting but very difficult challenge. My problem is I don't really know any languages other than JavaScript these days.
I tried to make something in JS/My-Basic or JS/SQLite but no luck.
Strangely JS and My-Basic often had opposite problems. My-Basic is fine assigning undefined variables to each other (a=b) but doesn't like random expressions (3+2).
But in general it seems very difficult to make anything which is more than a single keyword. Anything you add to make one language compile is by definition going to be superfluous in another. The best bet seems to be two languages which have very similar syntax in some way but which are considered separate enough for the challenge.
3 languages, 5 bytes
Ruby
print
Python 2
print
Perl 5
print
2 languages, 20 bytes
Scala
System.out.println()
Javascript
System.out.println()
This does about the same thing that the answer by Jonah does, except because a lot less languages use print, it features 3 or 2 languages. Still felt like answering however.
These all print the empty string.
6 languages
Bash, 4 bytes
echo
Zsh, 4 bytes
echo
fish, 4 bytes
echo
tcsh, 4 bytes
echo
ksh, 4 bytes
echo
J, 4 bytes
echo
Kicking things off with a boring one. If I understand the rules, I think it's legal though.
The shells are clear enough and output a newline. Removing any contiguous substring will result in "command not found".
In J, echo is a built in function, and prints its argument with a newline appended. J doesn't have 0-argument functions, so you have to call it with something. However, anything works, including the empty string '', which is the conventional choice for calling a function when the argument doesn't matter.