32
\$\begingroup\$

Most of the answers on this site are made using programming languages, that are well known, and easily installable by most of the people. They have well known installers (or are already included) in all major PC operating systems. These includes languages like Java, Ruby or Python.

Some answers are in languages which are also widely available, but this might not be a well known fact. I'd include C# here, as some people think it's only available on Windows as a paid app (Visual Studio), but in reality there's Mono, which is free and available on all operating systems (including Windows), and there is also a free version of Visual Studio for C#.

There are also languages which are somewhat hard to obtain. For example Mathematica and Maple are paid apps without proper free alternatives. Matlab, while having Octave as a free alternative it's missing some features from Matlab you might be using. Or for example GTB only works on TI calculators, and the installation instructions on how to set up a TI virtual machine are hard to find.

So if you are more or less actively using a language which you think might not be available for everyone, please post an answer describing how to install it. If you are using a non-free language, but it can generate a runnable code that can be viewed with a free app, then please describe how to generate this runnable code, so other people posting in that language can follow those instructions to generate an output that can be tested by everyone.

You can also link to these language posts from your answers to help people.

One language per post please, this is a community wiki. The question is based on this meta post

\$\endgroup\$
2

20 Answers 20

8
\$\begingroup\$

Minecraft (Java Edition)

  1. Create a Mojang account at https://minecraft.net/store/minecraft/#register
  2. Download the Minecraft launcher from https://minecraft.net/download/
  3. Login with your account and install the demo version (unless you want to pay for it)
  4. Start a demo world. You now have 90 minutes to build and test the submission, after that the world will be reset.
  5. Press esc and open a LAN world to enable cheats.
  6. Press T to open the chat and type /gamemode creative to set yourself to creative mode.
  7. If you need command blocks, type /give @p command_block.
\$\endgroup\$
1
  • \$\begingroup\$ The system requirements for Minecraft are here: help.minecraft.net/hc/en-us/articles/… Even if your computer does not fulfil them, you might still be able to run it. I've even played Minecraft on a phone before (which no longer works in version 1.13 and above). \$\endgroup\$ Jul 15, 2020 at 8:45
6
\$\begingroup\$

Testing Mathematica if you don't have it installed

Note: this only works if the answer provides a CDF file or Mathematica Notebook file.

If the answer provides a CDF file or Mathematica Notebook file, you can use the Wolfram CDF Player to view those files.

  1. Go to the CDF Player download page
  2. Fill in the little form.
  3. Download the installer and install the CDF player.

To save a Mathematica file as a CDF file or Mathematica Notebook

If you have a Mathematica answer and want to provide a CDF file or Mathematica Notebook file:

  1. Go to File -> Save As (or press Shift+Ctrl+S)
  2. Select "Mathematica Notebook" or "Computable Document".
  3. Save the file.
\$\endgroup\$
1
5
\$\begingroup\$

Sage

Windows, Mac OS X and Linux (except Ubuntu):

Visit this link to download binaries or this link for the source. If you use Windows you would also need VirtualBox. Details of installation can be obtained by following the links.

Ubuntu: Open a terminal and run this as root:

apt-add-repository -y ppa:aims/sagemath
apt-get update
apt-get install sagemath-upstream-binary
\$\endgroup\$
6
  • \$\begingroup\$ Hasn't apt-get been deprecated for about 5 years in favour of aptitude? \$\endgroup\$ Mar 7, 2014 at 15:53
  • 2
    \$\begingroup\$ @Peter In recent versions, apt-get is more preferred once again. \$\endgroup\$ Mar 7, 2014 at 16:01
  • 3
    \$\begingroup\$ @ChrisJester-Young Now, 16.04 is starting to recommend apt, which is like apt-get but with a nifty progress bar. \$\endgroup\$ Jun 13, 2016 at 11:27
  • \$\begingroup\$ Doesn't this work for Debian too? \$\endgroup\$
    – univalence
    Oct 3, 2016 at 17:22
  • \$\begingroup\$ @MegaMan "This PPA currently publishes packages for Yakkety, Xenial, Wily, Vivid, Trusty, and Precise.". You may be able to get it to install by tweaking your sources.list, but I don't guarantee it will work and it is certainly not officially supported. \$\endgroup\$
    – user12205
    Oct 4, 2016 at 8:08
  • \$\begingroup\$ @ace Ah, thank you. I still want to try it ;). \$\endgroup\$
    – univalence
    Oct 4, 2016 at 15:18
5
\$\begingroup\$

Common Lisp

Download

For Linux, Windows, Darwin (MacOs), pick one of those two sidely available and supported implementations:

See also other implementations.

Quicklisp

Sometimes you will need to download and install additional libraries. This is the case if the challenge contains a (ql:quickload <X>) expressions. Most external libraries (systems) can be obtained through Quicklisp. There is a one-time installation procedure to follow:

  • download quicklisp.lisp
  • load the file (e.g. sbcl --load quicklisp.lisp)
  • inside the REPL, enter (quicklisp-quickstart:install)
  • Then, enter (ql:add-to-init-file). Indeed, each time you reload your environment, you need to load the installed setup.lisp file. The previous command adds what is necessary into your init file (e.g. ~/.sbclrc).

When you are using Quicklisp, for example if you call (ql:quickload :alexandria)1 you will see the system download and compile the library. This is generally fast but it might take some time for some libraries. However this is done only once per installed system. The executable *.fasl files resulting from the compilation will make quickload terminates faster on subsequent requests for the same systems (even if you quit and restart your environment).

Execution/REPL

Start and load the challenge with --load if the code is in a file. You can also directly paste them into the REPL. From the REPL, loading other files is made with (load "/path/to/filename").

1: see https://common-lisp.net/project/alexandria/

\$\endgroup\$
4
\$\begingroup\$

Whitespace

While Whitespace is available on ideone, it's official version is not that easy to install, as it's source only, and binaries that are working on recent systems are not readily available.

Install

The following installation instructions are for OS X

  1. Install GHC via homebrew

    $ brew install ghc haskell-platform

  2. Download and extract the source code from the official site

  3. Modify the Makefile, as it won't work on newer haskell versions:

    Change the 5th line, where it sets OPTS to the following:

    OPTS = -O -hide-package base

  4. Run make. It should generate the wspace executable

Posting

To help other people by testing you should not only include your answer in whitespace, but if possible also include it's BASE64 encoded or "readable" variant. By the latter I mean a solution where space is replaced by S, tab is replaced by T and line feed is replaced by L

To convert the "readable variant" from S/T/L files back to whitespace you can use the following converter:

#!/usr/bin/env ruby
ARGF.each_line do |line|
  data = line.gsub(/'.'/) { |match| match[1].ord }
  data = data.gsub(/[^-LST0-9#]/,'').split('#').first
  if data
    data.tr!('LST',"\n \t")
    data.gsub!(/[-0-9]+/){|m| "#{m.to_i<0?"\t":" "}#{m.to_i.abs.to_s(2).tr('01'," \t")}\n" }
    print data
  end
end

Note that this, apart from converting the S, L and T characters, also allow single line comments with #, and can automatically convert numbers and simple character literals into their whitespace representation. If you don't need these extra stuff just remove lines 3 and 7

\$\endgroup\$
4
\$\begingroup\$

Julia

Download binaries or source: http://julialang.org/downloads.

Binaries are available for Windows, Mac, Ubuntu (.deb), Fedora/RHEL/CentOS/SL (.rpm), and generic Linux. Both 32- and 64-bit versions are available for all of these except for Mac, which only has a 64-bit version.

You can also get Julia packaged with an IDE called Juno on Windows, Mac, and Linux.

Source is available as a tarball or through GitHub.

Alternatively, you can use Julia in your browser through http://www.juliabox.org. There you'll find an IPython notebook-style interface as well as a console interface. Note that using JuliaBox requires a Google account for signing in.

\$\endgroup\$
4
\$\begingroup\$

Pyth

Run it online at:

https://pyth.herokuapp.com/


If the code takes a while to run or can't be run online for other reasons, you can download Pyth.

Download from here: https://github.com/isaacg1/pyth

To run:

python3 pyth.py program.pyth

Where program.pyth has your program in it.

Check regularly for updates (git pull) as Pyth is under development.

\$\endgroup\$
2
  • \$\begingroup\$ Does this require python3? \$\endgroup\$ Aug 19, 2014 at 12:27
  • \$\begingroup\$ Yes. I haven't tested it outside Python 3.4, but I think it should work on any Python 3 version. \$\endgroup\$
    – isaacg
    Aug 19, 2014 at 18:50
3
\$\begingroup\$

Perl 6

The most complete implementation of Perl 6 as of now is Rakudo. After installation, it's available as perl6.

Windows

Visit http://rakudo.org/downloads/star/, and download the newest .msi file. After that, include installation directory in PATH (right click on Computer, select Properties, choose Advanced System Settings, press Environment Variables, and change PATH), and you can use perl6 in cmd.exe.

Ubuntu Linux

Install rakudo package using apt-get package manager. Please note that it's one year old, so it may be not good enough to run the script, but in most cases it should work.

Fedora Linux

Install perl6 package using yum package manager.

Arch Linux

Install rakudo from AUR.

Other operating systems

Visit http://rakudo.org/downloads/star/, and download the newest .tar.gz file. Make sure you have C compiler and ICU library (libicu-dev on Debian/Ubuntu) installed before continuing, and extract the files. After that, run the following commands in the extracted directory.

perl Configure.pl --gen-parrot
make
make install

Other options

Ideone has too old version of Perl 6 to be reasonable, but it may work for very simple scripts which don't use newer features of Perl 6. Niecza is an alternate implementation, which was easier to install on Windows, but considering the current .msi installer used by Rakudo, it's not that great anymore. It's relatively complete, even if it doesn't implement certain features.

\$\endgroup\$
2
  • \$\begingroup\$ I think in Ubuntu one can install it using sudo apt-get install rakudo \$\endgroup\$
    – user12205
    Mar 9, 2014 at 21:41
  • \$\begingroup\$ @ace: Thanks for mentioning it. I initially assumed it has too old version to be reasonable (but I checked it long time ago), but considering it's just 1 year ago, it may be reasonable (but with a disclaimer). \$\endgroup\$
    – 0..
    Mar 9, 2014 at 21:49
3
\$\begingroup\$

JavaScript ES7

Occasionally people will save a few bytes by replacing Math.pow with the exponentiation operator **, which is one of the few things that has already been standardised for ES7. As such, if you don't have ES7 handy, you could attempt to replace occurrences of ** with the equivalent Math.pow construct for testing purposes.

Currently the simplest way I know of getting an ES7 environment is to use a Nightly build of Firefox.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Using Babel is also viable (or vihanserver.tk/p/esfiddle). \$\endgroup\$ Feb 3, 2016 at 3:26
  • 1
    \$\begingroup\$ According to MDN both Chrome 52 and Firefox 52 support **. \$\endgroup\$
    – Neil
    Jan 8, 2017 at 19:06
3
\$\begingroup\$

QBasic

If you don't have an old computer with DOS or pre-2000 Windows on it, you can still run QBasic programs:

  • First, what not to use. There are a couple of online emulators, but they are very limited, only supporting a subset of QBasic commands. Most importantly for this site, they don't understand syntax shortcuts that are useful for golfing! =^O
  • I run most of my programs on QB64, a free download. I've only used the Windows version; the website lists versions for Mac and Linux as well, but I can't speak for those. This is an emulator, written from scratch in C++, that compiles your QBasic code to an executable and then runs it.
    Pros: it's got most of the features of QBasic (and quite a few extras, too); you can also turn off syntax expansion, so your golfed code stays golfed.
    Cons: there are a few things from QBasic that aren't implemented, and several more that have subtle differences; some screen modes display as pretty small windows; the debugger and immediate mode aren't included, because it's a compiler not an interpreter.
  • Archive.org has made available the original QBasic running on the DOSBox emulator, meaning it's now possible to run QBasic code online.
    Pros: it's the real thing, works as advertised, no download necessary.
    Cons: you can't save your code or copy-and-paste in or out; sound works but comes across a bit wonky; and you can't turn off syntax expansion.
  • It's also possible to download the original executable and run it in DOSBox yourself. I haven't tried this, but steenbergh has had good success with it.
\$\endgroup\$
3
  • \$\begingroup\$ Hmm, I may have to give QB64 another try. I ran into problems with it the last time (about a year ago or so). \$\endgroup\$
    – Geobits
    Oct 7, 2015 at 19:38
  • \$\begingroup\$ @Geobits The only odd thing I've found so far is that the SCREEN modes don't quite match my memory of them. But my memory could be faulty, or it might be a case of looking different because it's in a window instead of fullscreen. \$\endgroup\$
    – DLosc
    Oct 7, 2015 at 19:42
  • \$\begingroup\$ I do all my QBasic (and QBIC) work in DOSBOX. Works like a charm, mostly. Most seriuous trouble was when I needed to send something to the printer; DOSBOX doesn't support that, it's not a full-featured DOS system. \$\endgroup\$
    – steenbergh
    Jul 26, 2017 at 11:21
2
\$\begingroup\$

Golflua

dpkg-based Linux distributions (Debian, Ubuntu, Mint, etc)

Download the corresponding .deb package from here
Then dpkg it in:

dpkg -i golflua_1.0-1_amd64.deb

Windows

Download the exe from here (zip archive)
No installation neccessary. Run like you would run lua.exe.

Other distributions, OS X, and a few other platforms

Download the source from here
Simply running make will list supported platforms and you should pick one of them.

$ make
Please do 'make PLATFORM' where PLATFORM is one of these:
   aix ansi bsd freebsd generic linux macosx mingw posix solaris
\$\endgroup\$
2
\$\begingroup\$

R

Downloads are available through a CRAN (Comprehensive R Archive Network) mirror of your choice: http://cran.r-project.org/mirrors.html

Both binaries and source are available for Linux, Windows, and Mac.

When running R locally, you can run it interactively from the command line or R GUI, or by submitting a program file from the command line using RScript somefile.R.

RStudio is a free R IDE available for Linux, Windows, and Mac.

Alternatively, you can use R in a number of different browser environments. (Note though that these may not be running a recent version of R.) A small subset:

\$\endgroup\$
2
\$\begingroup\$

GolfScript

On Linux

Install Ruby (almost certainly packaged with your distro) and then download the official interpreter.

On Windows

I've successfully used IronRuby to run a tweaked version of the interpreter. Patch:

--- golfscript.rb.orig
+++ golfscript.rb
@@ -272,7 +272,8 @@
                factory(to_s.inspect)
        end
        def to_s
-               @val.pack('C*')
+               # Workaround for IronRuby bug, thanks to w0lf
+               ''[email protected]('C*')
        end
        def class_id; 2; end
        def coerce(b)
@@ -389,8 +390,16 @@
        end
        include Comparable
 end
-code=gets(nil)||''
-$_=$stdin.isatty ? '' : $stdin.read
    +
    +# IronRuby's implementation of gets is buggy
    +code=File.read(ARGV[0])
    +
    +# PowerShell's handling of stdin will drive you nuts
    +$_=''
+if (ARGV[1])
+       $_=File.read(ARGV[1])
    +end
    +
     $stack = [Gstring.new($_)]
     $var_lookup={}

Note that the tweaks include taking input from a second file provided as an argument instead of from stdin, because I found that easier. I also set up an alias in my PowerShell profile:

function golfscript {
    &"c:\Program Files (x86)\IronRuby 1.1\bin\ir64.exe" d:\stuff\golfscript.rb $args
}
\$\endgroup\$
1
\$\begingroup\$

IDL

IDL is proprietary software, and is quite expensive. Most astronomy departments (at the very least) have floating licenses, but even a student license is expensive.

However, there is an IDL Virtual Machine that can be used to run properly-packaged IDL code. It's kind of a run-around to get it installed, sadly, but it is indeed free.

Since I'm the only one on this site who uses IDL (it seems), it's seemed pointless for me to package my code. However, if there's a need, I'll start uploading .sav files for use with the IDL VM.

\$\endgroup\$
1
\$\begingroup\$

SAS

SAS is proprietary statistical analysis software, and is renowned for being extremely expensive to license. It is a rather verbose 4GL, and as such doesn't see much use on this site. However, a free-for-personal-use version is available here:

http://www.sas.com/en_us/software/university-edition.html

There are two ways to proceed:

  • Set up a free-tier AWS instance and connect via the AWS marketplace
  • Download a VM image and host a local server that you can connect to via your favourite web browser on http://localhost:10080.

Both options provide access to all the core features of the SAS programming language that are likely to be relevant for code golf, and a decent selection of the most commonly used built-in procs.

Some SAS features are tied to modules that are not bundled with SAS University Edition and will therefore not be available, but it is extremely unlikely that any of these would ever be relevant for code golf, due to their complex, verbose and highly specialised nature - e.g. the likes of proc ga from the SAS/OR module.

\$\endgroup\$
1
\$\begingroup\$

WhoScript

Download the repository https://github.com/MCS-Kaijin/WhoScript. Then move WhoScript.py to a convenient location.

To run, type python WhoScript.py program [input] into your command terminal where program is the program file name and input is the optional input. If no input is provided then the program will prompt you for input when it is required. Check regularly for updates as WhoScript is still under development.

*the current interpreter only works in Python 2.7.x

\$\endgroup\$
1
\$\begingroup\$

PowerShell

PowerShell is open-sourced and available on Linux in addition to the usual Windows flavors.

Marked this as Community Wiki as I don't have a Linux environment with which to actually test, so I can't vet the actual installation steps.

\$\endgroup\$
1
\$\begingroup\$

Visual C++, Visual C#, Visual F#, Visual BASIC

Download the Express versions of Visual Studio for Windows Desktop here: http://www.visualstudio.com/en-us/downloads.

On Linux/Mac, install .NET Core or Mono.

This can also do SQL server, HTML, and XAML. It can profile Python, but I don't think it can edit it.

\$\endgroup\$
0
\$\begingroup\$

RProgN

You can either use the Online Interpreter, currently hosted on GitHub via: https://tehflamintaco.github.io/Reverse-Programmer-Notation/RProgN.html

Alternatively, you can download the standalone Lua Implementation from: https://github.com/TehFlaminTaco/Reverse-Programmer-Notation

After doing so, you can run it via the command line using: lua main.lua code.rpn <Inputs

Note, the Offline Interpreter requires Lua 5.3, yet the Online Interpreter should function identically as the master branch, as it essential runs a Lua VM, and loads the code from the Master.

\$\endgroup\$
0
\$\begingroup\$

AutoHotkey

AutoHotkey is an open source Turing complete scripting language that can be compiled. It's often used to remap keys, automate batch boring jobs, or cheat in video games. It's similar to AutoIt but much less strict, allowing both a C-like syntax or natural language, see the Documentation.

Installation:

  1. Download, available on windows only.
  2. Save as .ahk and it can be run through the exe or dll.
  3. If you want to compile the script; run ./Compiler/Ahk2Exe.exe
\$\endgroup\$

You must log in to answer this question.

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