23 Befunges, 713 bytes
The only language I really know is Befunge, so instead of multiple languages, I've just gone with multiple implementations of Befunge. I believe this is still valid under PPCG rules, which consider the language to be defined by its implementation.
vv_2#!>#-/\#21#:+#:>#\<0/-2*3`0:-/2g01g00p>#< 2#0 ^#1/4*:*9"9"p00***<<
!Helo Byd!!!!!Hai dunia!!!!Ciao mondo!!!Hallo Wereld!!!!
!Hallo Welt!!!Halo Dunia!!!Halo Dunya!!!Bonjour monde!!!
!Hei Verden!!!Hej Verden!!!Moien Welt!!!Labas pasauli!!!
!Molo Lizwe!!!Salut Lume!!!Hei maailma!!Sveika pasaule!!
!Hello World!!Salom Dunyo!!Tere maailm!!Sawubona Mhlaba!
!Kaixo Mundua!Salamu Dunia!Sannu Duniya!!!!!!!!!!!!!!!!!
The frustrating thing about Befunge, is that although there is an open source reference implementation, and the language itself is dead simple, there isn't a single third-party interpreter (that I'm aware of) that exactly matches the reference behaviour. Every implementation fails in a different way.
On the plus side, this gives us the opportunity to develop a single piece of code that will produce a different result in almost every interpreter. And that's what I'm attempting in the program above.
If anyone is interested in verifying the results, I've tried to group the various implementations into categories based on how easy they are to get up and running (e.g. some people may not be able to run Windows binaries, or may not be willing to build from source, but everyone should be able to test the online interpreters).
No installation required. It's usually just a matter of pasting in the code and clicking a button or two. But note that some of these are quite slow, so may need some time to finish executing.
Alexios' Befunge Playground
- Salamu Dunia!
Click the Clear... button and paste the code into the input field. Toggle the Edit switch to activate the interpreter, and then click the Run button to begin executing.
Note that this site probably won't work in Browser's other than Chrome.
- Molo Lizwe!
Paste the code into the input field, making sure to overwrite the existing code. Then click the Run button to execute.
David Klick's Befunge 93 Interpreter
- Sannu Duniya!
Paste the code into the Playfield input field, and then click the Run button to begin executing.
Ian Osgood's Befunge-93 Interpreter
- Salut Lume!
Paste the code into the input field under the Show button, making sure to overwrite the
@ that is already there. Click the Show button to import the code, then click the Run button to begin executing.
- Hej Verden!
First close the Help dialog, then click the Open/Import toolbar button (second from left), paste in the code, and click OK. To execute, click the Run Mode button (fourth from left), and then Start (fifth from left).
Also note that a few of the console-based interpreters are actually available on TIO, so while they aren't technically online interpreters, they can be tested online. For those that are supported (currently BEF, FBBI, MTFI and PyFunge), I've included a Try It Online! link next to their entry.
You'll need to have the Java run-time installed for these, but they should theoretically work on any platform. Only tested on Windows though.
Ashley Mills' Visual Befunge Applet
- Moien Welt!
This was initially an online applet which is unfortunately no longer available, but you can still download the jar and run it locally as a desktop application. You'll need to paste the code into the Program Editor window, then click the Convert button, followed by the Run button.
WASABI: Wasabi's A Superbly Asinine Befunge Interpreter
- Hallo Welt!
To paste in the code, right click in the top left corner of the editor window (it must be the very top left) and select the Paste menu item. Then enable the Full Speed check box (otherwise it'll take forever), and click the Run! button to begin executing.
YABI93: Yet Another Befunge93 Interpreter
- Halo Dunia!
Press Ctrl+A, Ctrl+V to paste the code into the editor window, being sure to overwrite the default source. Then click the Start button to begin executing.
You'll typically need Windows for these, although in some cases there may be binaries available for other operating systems. I can't promise the code will work on other platforms though.
- Hello World!
You can't paste the code into the editor, so you'll first need to save it to disk somewhere. Then from the IDE, use the File > Open menu to load the code from disk, and select the Simulation > Run/Pause menu to run it.
- Labas pasauli!
Press Ctrl+V to paste in the code, and then click the Debug toolbar button (the blue cog) to begin executing. Once the Debugger panel appears, you'll want to set the Speed to maximum - the button to the right of the slider - otherwise it'll take forever to finish.
- Tere maailm!
Press Ctrl+V to paste in the code, and then press F5 to run it.
Visbef: Visual Befunge '93 for Windows
- Hallo Wereld!
You can't paste the code into the editor, so you'll first need to save it to disk somewhere. Then from the IDE, press Ctrl+O to open the file browser and load the code from disk, and press F5 to run it.
Windows Console Apps
Again these typically require Windows, although other platforms may be available, but not guaranteed to work.
In all cases the code will need to be saved to a file on disk and the filename passed to the interpreter as a command line parameter (source.bf in the example command lines given below). Also note that some of these are technically Befunge-98 interpreters, and must be run with a particular command-line option to force a Befunge-93 compatibility mode. If you don't do that, you won't get the correct results.
BEFI: Rugxulo's Befunge-93 Interpreter
- Hei Verden!
CCBI: Conforming Concurrent Befunge-98 Interpreter
bef93w32 -q source.bf
- Sveika pasaule!
MTFI: Magus Technica Funge Interpreter
ccbi --befunge93 source.bf
- Hai dunia!
mtfi -3 source.bf (Try it online!)
Python and PHP Console Apps
These require the appropriate scripting language installed - either Python or PHP.
- Helo Byd!
- Halo Dunya!
pyfunge -v 93 source.bf (Try it online!)
- Bonjour monde!
php bephunge.phps source.bf
Source-only Console Apps
These will need to be built from source, and that's usually easiest with a *nix-like environment. On Windows I use the Windows Subsystem for Linux.
BEF: Befunge-93 Reference Distribution
- Ciao mondo!
bef -q source.bf (Try it online!)
- Sawubona Mhlaba!
FBBI: Flaming Bovine Befunge-98 Intepreter
cfunge -s 93 source.bf
- Hei maailma!
fbbi -93 source.bf (Try it online!)
- Kaixo Mundua!
- Salom Dunyo!
rcfunge -93 source.bf
How it works
The challenge with this was finding the fewest number of tests that provided the most differentiation between interpreters. In the end it came down to four main test sequences:
The first is an out-of-bounds memory read from offset -1,1. In theory this should always return 32 (ASCII space), but there were actually 10 variations in practice. This test is complicated by the fact that two of the interpreters crash on an out-of-bounds read, so a couple of special-case tests (division rounding and space bridging) were required to force those two back into bounds.
The second sequence is a test of Befunge-98 functionality - specifically the instructions
'. Almost all of the interpreters are Befunge-93, or are run in Befunge-93 compatibility mode, so they should just ignore those instructions. In practice there were 6 different ways in which this sequence was interpreted.
The third test checks the range of memory cells. In the reference interpreter, memory cells are signed 8-bit, but other implementations vary in range from 8-bit to unbounded, some signed and some unsigned. However, for the purposes of this test, we only had to distinguish between 5 of those variants.
The fourth and final sequence is a combination of underflow and negative division tests. There are a number of ways in which interpreters get underflow wrong, and there are at least 3 different ways in which the division and modulo instructions are implemented, but there were only 3 combinations we cared about here.
Each of these sequences returned a single number, and those four numbers were combined (via some basic arithmetic and translation tables) to produce a final value in the range 0 to 22. That value could then be used as an index to lookup the actual message to display.