I enjoy developing in Haskell, but am presently confronted with a challenge. At my place of education, I don't have administrative rights on my account. I want to debug/test while there. I need a way to run Haskell code without installing haskell-platform
or ghci
or anything else requiring of an administrative level of privilege. For instance, a web site which will run haskell code (abeit limited to not include file access of course) or a java utility (or standalone .app
, though java is preferred due to the nature of the "parental controls"), or something else I haven't thought of. Source or compiled Java, Flash, and source code in Ruby or Python are preferred to native code. This is on Mac OS X 10.6, for reference.

- 862
- 1
- 11
- 17
-
2use online haskell interpreter, like this http://tryhaskell.org/ – RolandXu May 14 '12 at 03:01
-
3You should be able to just unpack a [binary package of GHC](http://www.haskell.org/ghc/download_ghc_7_4_1#binaries) in a directory somewhere. Make sure you get the bindist, and not the installer. – hammar May 14 '12 at 03:07
8 Answers
You can install GHC without admin privileges, but you'll have to build from source. Check out the Building on MacOS X for more details.
Essentially, like any other open-source project, you can compile code and install it, generally, anywhere on your filesystem like into a folder in your home folder (I often use the ~/.local folder for that purpose).
As the linked page mentions, you can also use MacPorts and install it to any place you can write to. Once MacPorts is installed you can install GHC.
EDIT
As pointed out by Carl in the comments below, you don't need to build from source. Just grab the binary tarball from http://www.haskell.org/ghc/download_ghc_7_4_1#binaries.

- 848
- 5
- 9
-
Note that I haven't actually tried building GHC from source; I use the pre-compiled Haskell Platform myself so YMMV :) – plasma May 14 '12 at 02:59
-
4You don't need to build it from source - you just need the non-installer binary distro. – Carl May 14 '12 at 04:10
-
3Building from source is not possible without an already working Haskell compiler, unless you can cross-compile on another machine. The GHC binary distro is the solution here. – John L May 14 '12 at 07:46
-
@John: It is possible to build GHC without already having GHC. For example, Macports does that without requiring an already functioning version of GHC. – plasma May 14 '12 at 17:18
-
@sr42: Macports downloads a binary bootstrapping distribution to compile the full ghc. – John L May 24 '12 at 13:41
In addition to all the other ideas, several companies will rent you virtual (cloud) linux servers for a few cents an hour. You have root on those and can install whatever you want, then freeze the image until you need it again.
Normally this might not be advantageous over a local solution if you can make one work, but a possible extra benefit would be that your work can stay on a single "computer" which you could access while sitting in front of any variety of modern PC that might be available to you on a given day.

- 39,853
- 6
- 84
- 117
-
I can run my own server. I don't want to because I feel like it would be a hassle, and because of the internet filters that would likely block my IP. Most remote server providers are blocked. – Andrew Wonnacott May 16 '12 at 00:26
An alternative not only for Haskell is http://ideone.com/

- 54,104
- 13
- 100
- 195
-
they use pretty old version of GHC (ghc-6.8.2). Could you and other SO heavyweights perhaps push (/help ??) them, together, to install the newer one (with more packages installed, too)? :) Otherwise it's indeed a far superior option to codepad. – Will Ness May 15 '12 at 14:18
-
I sent them email about missing security certificate on their site many months ago, got a positive reply, and ... it's still missing. It'll take much more than just 1 email i'm sure. :| But kudos for trying! – Will Ness May 16 '12 at 05:15
If you truly can't install anything, then there's
http://tryhaskell.org/ -- like GHCi, but you can't load modules, which means not only that you can't use many standard functions (say, the functions in Data.List), but also that you can't use certain language features (like user-defined algebraic data types).
I also remember a hpaste-style site which executes its code -- and allows you to have private pastes -- but I can't remember it at the moment. Edit: I was thinking of http://codepad.org/ -- thanks @Mog

- 8,438
- 5
- 36
- 58
-
There's [ideone](http://ideone.com/), but it's running GHC 6.8.2 which is from 2007. – hammar May 14 '12 at 03:13
For the website option, TryHaskell will hardly cut it, it's way to limited.
codepad, OTOH, is more liberal, and should be of more use.
But honestly the bindist option is the best one, clearly!

- 7,490
- 3
- 31
- 58
-
codepad is using Hugs from 2006 -- according to its About page. So, much older than ideone. The best I've found is rextester, at GHC 7.10 http://rextester.com/l/haskell_online_compiler – AntC Apr 14 '17 at 01:44
Try http://hiji.tinyrocket.se/ It is a haskell interpreter written using javascript.
http://ghc.io/ GHC.IO is a version of the Haskell interactive interpreter, ghci, that runs online in a web browser.

- 3,931
- 11
- 37
- 59
There is a web-based interpreter for Haskell at http://tryhaskell.org/. However, it may not provide enough functionality for your requirements.

- 8,297
- 3
- 35
- 57
You just need to install homebrew, which you can do without root rights if you do so in your home directory. You can then brew install cabal-install
which will automatically install cabal and ghc, or brew install stack
to install stack.

- 183
- 8
-
Thanks! Brew wasn't as good 5 years ago but this will maybe help future high school students aspiring to do Haskell development :) – Andrew Wonnacott Jun 06 '17 at 03:56
-
Oh, and don't forget to add the `bin` folder in the folder where you've installed brew to the PATH. – Spooikypok_Dev Jun 06 '17 at 04:52