Chapel

Chapel

Installation

Source Code
# Download chapel-{version}.tar.gz from https://chapel-lang.org
tar xzf chapel-{version}.tar.gz
cd chapel-{version}
export CHPL_LLVM=bundled
./configure
make
make install

Examples

Fibonacci Numbers
// Fibonacci Numbers
proc fib(n: int): int {
    if (n < 2) {
        return n;
    } else {
        return fib(n - 2) + fib(n - 1);
    }
}

proc main(args: [] string) {
    var n: int = args[1]:int;
    writeln(fib(n));
}

/*
    example
        compile:
            chpl -o fib fib.chpl
        run:
            ./fib 39
*/