Chapel is a programming language for productive parallel computing. This repository is a simple starting point for Chapel in GitHub Codespaces, with runnable examples in examples/.
Not in a Codespace yet? See Using a Codespace below to get started.
⚠️ Warning: Codespaces runs in a virtualized environment with shared hardware and a modest core count. Performance and available parallelism in Codespaces are not representative of what you should expect on a native Chapel installation.
- Open hello.chpl.
- Wait for the Chapel extension and language tools to finish loading in Codespaces.
- Click the Run button in the editor (top right) once to compile the code, and once more to run the current file.
Note: The Run button does not support multi-locale (distributed) programs. Use the terminal for those.
If the Run button does not appear right away, wait a bit longer and reopen
the .chpl file.
Compile and run the main hello-world program:
chpl hello.chpl
./helloCompile and run one of the included examples:
chpl examples/hello3-datapar.chpl
./hello3-dataparThe Codespace defaults to single-locale mode (CHPL_COMM=none).
To simulate multi-locale execution, compile with CHPL_COMM=gasnet:
CHPL_COMM=gasnet chpl examples/hello4-datapar-dist.chpl
./hello4-datapar-dist -nl 2To avoid having to include CHPL_COMM in each compilation command, you can
export it (you need to do this once per shell session). After this, you can
compile as usual:
export CHPL_COMM=gasnet
chpl examples/hello4-datapar-dist.chpl
./hello4-datapar-dist -nl 2To explore more language features or play further, you can copy in examples from Chapel Primers or a prior tutorial. The following links are also helpful:
- Learning Chapel
- Chapel Primers
- Chapel tutorial examples
- Multilocale Chapel Execution
- Download Chapel
This repository includes a devcontainer.json file, making it usable from
GitHub Codespaces. When viewing this repository from GitHub's UI, click
Use this template > Open in a codespace to get started. Or use the
direct link: https://codespaces.new/chapel-lang/chapel-hello-world
The codespace includes the Visual Studio Code extension for Chapel, and tools such as
chpl-language-server
and
chplcheck.