Skip to content

yskuniv/haskell-bfi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haskell-bfi

A brainf*ck interpreter implemented in haskell.

Installation

First of all, you need to setup the Haskell building and execution environment (like GHC and Stack).

To construct it, I recommend GHCup, because it's very isolated (it constructs the all in the environment in ${HOME}/.ghcup, so if you want to uninstall it, you just remove the directory) and can hold multiple versions of GHC at a time.

See https://www.haskell.org/ghcup/ and follow the instructions on the page.

Usage

First, clone this repository at anywhere you want, then change the directory.

$ git clone https://github.com/yskuniv/haskell-bfi.git
$ cd haskell-bfi/

Run stack build to build the interpreter.

$ stack build

Now you can run the interpreter with stack run FILE like the following.

$ stack run samples/helloworld.bf
Hello, world!
$

If you want to see the help, just you run stack run -- --help.

$ stack run -- --help
haskell-bfi - A brainf*ck interpreter implemented in haskell.

Usage: bfi FILE
  Run FILE

Available options:
  -h,--help                Show this help text
$

If you want to install the command for using it, you can do that by stack install. By default, maybe it's installed at ${HOME}/.local/bin. Now you can run the command like the following.

$ ${HOME}/.local/bin/bfi samples/helloworld.bf
Hello World!
$

Or if you want to run it just like bfi, adjust your PATH like the following or write the export part in your ~/.bashrc.

$ export PATH="$HOME/.local/bin:$PATH"
$ bfi samples/helloworld.bf
Hello World!
$

About

A brainf*ck interpreter implemented in haskell

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published