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\$

migrated from codegolf.stackexchange.com Mar 7 '14 at 15:30

This question came from our site for programming puzzle enthusiasts and code golfers.

  • 1
    \$\begingroup\$ Related: meta.codegolf.stackexchange.com/questions/202/… I assume this differs in asking how to set up a local environment rather than where to find an existing remote version. \$\endgroup\$ – dmckee Mar 7 '14 at 15:38
  • \$\begingroup\$ First check tio.run/nexus, then ideone, then scroll down. \$\endgroup\$ – Pavel Dec 29 '16 at 5:48

21 Answers 21

7
\$\begingroup\$

Minecraft

  1. Create a mojang account https://minecraft.net/store/minecraft/#register
  2. Download the demo version from here https://minecraft.net/download/
  3. Start the game and login with your account
  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 1 to set yourself to creative mode.
  7. If you need command blocks, type /give @p command_block.
\$\endgroup\$
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\$
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\$
  • \$\begingroup\$ Hasn't apt-get been deprecated for about 5 years in favour of aptitude? \$\endgroup\$ – Peter Taylor Mar 7 '14 at 15:53
  • 2
    \$\begingroup\$ @Peter In recent versions, apt-get is more preferred once again. \$\endgroup\$ – Chris Jester-Young Mar 7 '14 at 16:01
  • 2
    \$\begingroup\$ @ChrisJester-Young Now, 16.04 is starting to recommend apt, which is like apt-get but with a nifty progress bar. \$\endgroup\$ – LegionMammal978 Jun 13 '16 at 11:27
  • \$\begingroup\$ Doesn't this work for Debian too? \$\endgroup\$ – Mega Man Oct 3 '16 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\$ – ace_HongKongIndependence Oct 4 '16 at 8:08
  • \$\begingroup\$ @ace Ah, thank you. I still want to try it ;). \$\endgroup\$ – Mega Man Oct 4 '16 at 15:18
5
\$\begingroup\$

J

For simple programs that do not do any IO or for answers consisting of a single verb, use http://tryj.tk. First, bind the code to a name with the copula =:

NB. From http://codegolf.stackexchange.com/a/45308/134
shuffle =: <@({.,?@#@}.({,<@<@<@[{])}.)&>/@(<"0@i.@#,<)

Then try out the verb and see what it does. The first parameter goes on the left side, the second parameter goes on the right side. If there is only one parameter, it goes on the right side.

shuffle 1 1 2 3 3 3 4 5

There is a very simply precedence rule in J; first adverbs are evaluates from left to right, then verbs from right to left. For example,

1 <: @ + & * 2 + 3

is paranthesized as

1 ((<: @ +) & *) (2 + 3)

useful operators for testing answers include:

  • i. y generate integers from 0 to y - 1
  • # y count the number of elements in the leading axis of y.
  • $ y is the shape of y, that is a vector of the number of elements of each axis of y.
  • ~. y is y with duplicates removed.
  • x = y is element-wise equality whereas x -: y is deep equality.

More documentation is available on the pages of jsoftware.

If the solution needs to do IO, you can download the interpreter on the pages of jsoftware. Unpack the tree somewhere and then start a binary named jconsole for the REPL. On Windows, the process might be slightly different.

\$\endgroup\$
  • 1
    \$\begingroup\$ tryj.tk isn't available anymore, but TIO has J. \$\endgroup\$ – Adám Feb 26 '18 at 8:15
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\$
  • \$\begingroup\$ Does this require python3? \$\endgroup\$ – Nathan Merrill Aug 19 '14 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 '14 at 18:50
4
\$\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\$
3
\$\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\$
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\$
  • \$\begingroup\$ I think in Ubuntu one can install it using sudo apt-get install rakudo \$\endgroup\$ – ace_HongKongIndependence Mar 9 '14 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\$ – Konrad Borowski Mar 9 '14 at 21:49
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
+               ''+@val.pack('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\$
2
\$\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\$
  • 1
    \$\begingroup\$ Using Babel is also viable (or vihanserver.tk/p/esfiddle). \$\endgroup\$ – Mama Fun Roll Feb 3 '16 at 3:26
  • 1
    \$\begingroup\$ According to MDN both Chrome 52 and Firefox 52 support **. \$\endgroup\$ – Neil Jan 8 '17 at 19:06
2
\$\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\$
  • \$\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 '15 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 '15 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 '17 at 11:21
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 .