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.
8023/# !-1401p680p88+79*6+1p238*7+0pg90p$#v0';1';+>9%80p$$$$"ph~s"+3vv
vv_2#!>#-/\#21#:+#:>#\<0/-2*3`0:-/2g01g00p>#< 2#0 ^#1/4*:*9"9"p00***<<
>>$:2%3*-4/3g68*-70p1-0`02-3/-03-2%1+2/-70g+80g65+70g`7++3g68*-70g9`*v
0168:0>0133?45130120340200v00:<+8*+76%4p00+5/4:+-*86g3++98/2%+98g09+<<
@>gg#^:#+,#$"!"-#1_@
!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).
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.
Befungius -
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.
jsFunge IDE -
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.
Java IDEs
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.
Windows IDEs
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.
BefunExec -
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.
BeQunge -
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.
Fungus -
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!
Command line: bef93w32 -q source.bf
CCBI: Conforming Concurrent Befunge-98 Interpreter -
Sveika pasaule!
Comand line: ccbi --befunge93 source.bf
MTFI: Magus Technica Funge Interpreter -
Hai dunia!
Command line: mtfi -3 source.bf
(Try it online!)
Python and PHP Console Apps
These require the appropriate scripting language installed - either Python or PHP.
Befungee -
Helo Byd!
Command line: befungee.py source.bf
PyFunge -
Halo Dunya!
Command line: pyfunge -v 93 source.bf
(Try it online!)
Bephunge -
Bonjour monde!
Command line: 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!
Command line: bef -q source.bf
(Try it online!)
cfunge -
Sawubona Mhlaba!
Command line: cfunge -s 93 source.bf
FBBI: Flaming Bovine Befunge-98 Intepreter -
Hei maailma!
Command line: fbbi -93 source.bf
(Try it online!)
Fungi -
Kaixo Mundua!
Command line: fungi source.bf
Rc/Funge-98 -
Salom Dunyo!
Command line: 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 ;
and '
. 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.
Are we allowed to use a consistent method of counting bytes that is not used by any of the programming languages that are used? – Zacharý – 2017-10-28T17:05:06.830
@Zacharý I guess any single encoding that has a representation for all characters used in the answer can be used to count the bytes. Or perhaps the bytes should be counted in UTF-8 for every answer? – Steadybox – 2017-10-28T17:31:11.713
1If I have a language that uses a different encoding than all the others, should I convert the code to that language's codepage or use the same byte representation? (which would be hard because some of the bytes result in incorrect UTF-8) – NieDzejkob – 2017-10-28T18:59:13.750
@NieDzejkob Convert to a code page that supports all characters in the answer (in all languages) if possible. – Steadybox – 2017-10-28T19:24:17.313
@Steadybox The point is: what should I feed to the interpreter? – NieDzejkob – 2017-10-28T19:25:20.590
I'd say either way (converting to the interpreted language's code page or using the same byte representation) is fine. – Steadybox – 2017-10-28T19:30:38.413
2
@NieDzejkob I think the rule for polyglot is have one file with measurable bytesize and can be run by multiple interpreter/compiler. (example)
– user202729 – 2017-10-29T09:38:37.5874Note that the exclamation marks in Chinese and Japanese (
!
, U+FF01) are different from the others (!
, U+0021). – alephalpha – 2017-10-29T15:20:15.400