28
\$\begingroup\$

What is the general feeling about answer that can't be tested because no compiler or interpreter is available?

The accepted answer to this question is a case in point. The question has been raised in the comments as to whether the answer actually meets the question's requirements, so I thought I'd give it a go myself. I've downloaded a TI-84 calculator emulator and (after much struggling to enter the program) ran the translation of the program as stated in the comments. It gives an error (ERR:INVALID DIM).

The argument could be made at this point that the translation is incorrect in some way, and so to be sure I want to run the code given in the answer as is to see exactly what the output is for the question's test cases.

But here's where my big problem is - the compiler is given in some encoded format for a program that does not appear to be downloadable anywhere. How convenient.

So my question is: Should we allow answers in languages that cannot be tested to be accepted? Should we even be upvoting them when no-one can be sure they actually do what's required?

\$\endgroup\$
7
  • 9
    \$\begingroup\$ I usually never upvote Timtech's answers, as although the language seems interesting, I could never make GTB work on an emulator. Maybe the best option would be to pressure (comments, downvotes) the authors of untestable solutions to actually describe how to set up the environment (like in a meta post). Also it might be hard to do this for solutions, which use a proprietary, non-free interpreter (I look at you Mathematica) \$\endgroup\$
    – SztupY
    Feb 13, 2014 at 16:58
  • 1
    \$\begingroup\$ Mathematica also has free interpretive options (e.g. the CDF Player). But the core point is still valid - if one has a solution that is difficult to test (e.g. because it only compiles with certain versions of the compiler, or on specific hardware, or whatever) - it's a valuable courtesy to the community to provide guidance on how to test the solution. For languages such as Mathematica, that might include a link to a webpage with the solution as a CDF (a self-hosted fiddle, essentially). For something necessitating specialized hardware, a link to an emulator in which the solution functions. \$\endgroup\$ Feb 13, 2014 at 19:03
  • \$\begingroup\$ @JonathanVanMatre didn't knew about the CDF files. Thanks! \$\endgroup\$
    – SztupY
    Feb 13, 2014 at 20:05
  • \$\begingroup\$ @SztupY Also, Wolfram is working on taking the language of Mathematica (now referred to as Wolfram Language) and making it a separately-available general purpose language. At present, you can get the unfinished version (and a free version of Mathematica) for free with every Raspberry Pi. Which makes Mathematica itself not quite free, but much cheaper than the full package since all you need is a $30 dongle that also can be hacked in numerous ways for your fun and enjoyment. blog.stephenwolfram.com/2013/11/… \$\endgroup\$ Feb 13, 2014 at 20:28
  • \$\begingroup\$ Since it was brought up as an example, I thought I should post what I used to translate the program: gist.github.com/FireyFly/8985786 (in JavaScript for my own convenience, but it simply applies the translation table given on the GTB page so it should be easy to translate to something else). \$\endgroup\$
    – FireFly
    Feb 13, 2014 at 23:05
  • \$\begingroup\$ I thought MATLAB should also be mentioned as a commercial programming language, although the free "clone" called GNU Octave mostly achieves code-compatibility. \$\endgroup\$
    – marczellm
    Feb 14, 2014 at 17:45
  • \$\begingroup\$ I've posted a few answers in Maple, which has the same issue as MATLAB and Mathematica (proprietary interpreter). I should probably go back and upload actual worksheets for them, so that they could be tested in Maple Player (Maple's equivalent of Mathematica's CDF Player). \$\endgroup\$ Feb 19, 2014 at 16:08

1 Answer 1

12
\$\begingroup\$

I think when someone posts in a language which is hard to set up, or test, then I think it is appropriate to downvote the answer if it doesn't describe (or link to a page with) a proper introduction on how to set up the environment. If, according to manual calculations the answer is also wrong, I think it would be appropriate to also flag the answer as "Not an answer".

The hard part is to define what counts as "hard". I would define hard as anything that's not "easy". And "easy" means:

Operating System

It runs on at least one of the main, still supported, intel based operating systems:

  • Windows 8, 8.1, 10
  • Mac OSX 10.8+
  • A recent, supported linux variant, like Ubuntu Linux 14.04 LTS

Here I both say supported and intel based, which means old OS's (including Windows XP), and ARM based operating systems (Android, iOS, etc.) are considered hard.

The "at least one" criteria means, that if it only runs on one of them (like PowerShell), then it is still fine. Hopefully there are enough members in the community that can test them, or if not, then you might still be able to install a VM and test it there (yes, I know, that this might not be viable for OSX though).

Installation

It can be installed via a common package manager on the supported operating systems, or it comes installed by default. The installer can be downloaded from the internet, and it can be installed freely.

So for example on Windows you can easily donwload an MSI, and install it. On Debian based linuxes you can use apt-get. On OSX it is available as either a pkg or through homebrew, etc.

Examples

Here are some examples:

  • Java 1.6+ Installable MSI on Windows
  • Ruby 1.8.7: Default on OSX 10.8
  • Javascript: A browser usually comes installed by default on all operating systems (note that the rules disallow JS code that only work for example on IE6, or other outdated browsers)

Hard languages

So what to do in case of hard languages? I would say that each of the mainly used hard languages should have a separate meta page, where there would be enough information either to the poster, or to the tester on how to run the code.

For GTB for example it would mean a step-by-step description on how to set up a TI-84 emulator, how to enter the code, etc.

For Mathematica it would describe how to create CDF files that can be shared to the users.

All solutions that use hard languages has to have a link to the appropriate meta page!

\$\endgroup\$
9
  • 1
    \$\begingroup\$ The separate-meta-pages idea is interesting. It'd probably make sense to keep the language-"articles" as separate answers to a single community-wiki question, I think, in order to not clutter meta too much. Since the primary way to access those posts would be via direct links, the size of the CW question shouldn't matter (contrary to e.g. the sandbox). \$\endgroup\$
    – FireFly
    Feb 13, 2014 at 23:15
  • 4
    \$\begingroup\$ Another "easy" option is to have an online tester: ideone, fiddle, etc. \$\endgroup\$ Feb 13, 2014 at 23:36
  • \$\begingroup\$ @PeterTaylor Online testers have a disadvantage that they won't work with some of the more advanced answers (like those requiring graphical or interactive input). And they ususally run on Linux under x86 architectures anyway, so fall into the easy category (albeit indirectly) \$\endgroup\$
    – SztupY
    Feb 13, 2014 at 23:52
  • \$\begingroup\$ Does dpkg instead of apt-get count? Like if I offer a .deb package. \$\endgroup\$
    – mniip
    Feb 16, 2014 at 18:23
  • \$\begingroup\$ Would a .NET language be considered easy? They work perfectly fine on Windows, but you need a Visual Studio environment to run them, which isn't free. Unless you count the Visual Web Developer Express version, but that requires somewhat more work for verification since you need to convert it to a website. \$\endgroup\$
    – Nzall
    Feb 20, 2014 at 14:51
  • 2
    \$\begingroup\$ @NateKerkhofs: mono is free, and available on all platforms, so unless you are using something very MS.NET specific that won't run under Mono it should be fine. Also there are free "Express" Visual Studio versions for each of the major .NET languages from Microsoft as well. \$\endgroup\$
    – SztupY
    Feb 20, 2014 at 15:42
  • \$\begingroup\$ What about languages like Visual Basic 6? There was a free express version of Visual Studio. \$\endgroup\$
    – Toothbrush
    Feb 21, 2014 at 18:54
  • 1
    \$\begingroup\$ You do not need Visual Studio to run .NET programs, even if you want to use Microsoft's tools. The .NET runtime is installed by default on Windows computers, and Microsoft freely provides command line compilers for several languages including C#, and F#. I think maybe the command line C# compiler even comes installed by default. @NateKerkhofs \$\endgroup\$
    – Omar
    Mar 14, 2014 at 23:52
  • \$\begingroup\$ What do you do in the case of really hard languages like SAS or Stata where everything is proprietary with no equivalent of Mathematica's CDF? The only people who can really test answers in these languages are those with the products licensed. I would guess that the number of SAS and Stata users on PPCG is fairly small. \$\endgroup\$
    – Alex A.
    Feb 10, 2015 at 21:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .