Tutorials - Building and installing
You can choose to build the project from source (which requires some knowledge like git, cmake and using shell commands) or get a build from a ZIP file.
Setup
You can setup an environment variable named
ARKSCRIPT_PATH
, with the path to the installation directory of ArkScript, so that the standard library can be located without using --lib <path>
. This step is optional.
The environment variable should direct to a folder with the folder lib/
inside. Multiple path can be provided if your installation separates the modules and the standard library,
by separating the different paths with a single ;
.
Installing from a release
Windows
Download the
windows-msvc-{version}.zip
from the releases, and unpack it wherever you want, as long as you remember where (or add the location to
an environment variable as specified in the setup section, to avoid using --lib <path>
). To use the command ark
from everywhere, you will need to
add it to your PATH environment variable.A (maybe easier) alternative is to download
windows-installer.exe
, an InnoSetup installer for ArkScript. It will install it as well as the standard library (modules included) in your C:/Program Files
folder, and create the appropriate ARKSCRIPT_PATH
environment variable.
Linux
Download the
linux-{compiler}-{version}.zip
from the releases. You can put the binaries and the lib anywhere you want, as long as you add it to your
path to execute ArkScript without giving the complete path (in your .bashrc
for example). You can also create an environment variable as stated in the setup above.
Installing through Docker
Just launch
docker pull arkscript/stable:latest
and you're good to go! To run it, use docker run -it arkscript/stable:latest ... arkscript executable options here
.
Installing from source
Clone the repository and go in the newly created repository, then init and update all the git submodules, as follows:
> git clone https://github.com/ArkScript-lang/Ark.git
> cd Ark
> git submodule update --init --recursive
If you want a specific revision or tag, you can do this right before initializing and updating the git submodules:
# for a specific revision
> git checkout <commit>
# for a specific tag
> git checkout tags/<tag>
Different CMake switches are available to customize the build:
-DARK_BUILD_EXE
to generate an executable, defaults to Off, building a shared library-DARK_ENABLE_SYSTEM
to enable `sys:exec` (execute shell commands without restrictions), defaults to On-DARK_PROFILER_MIPS
to enable the MIPS counting, defaults to Off-DARK_BUILD_MODULES
to build the modules, defaults to Off-DARK_NO_STDLIB
to avoid the installation of the ArkScript standard library-DARK_SANITIZERS
to enable ASAN and UBSAN
Windows
Requirements:
- Windows 10 x64
- Visual Studio 17 2022
- cmake >= 3.11
Commands:
PS> cmake . -Bbuild -DARK_BUILD_EXE=On -G "Visual Studio 17 Win64"
PS> cmake --build build --config Release
PS> cmake --install build --config Release # might need administrator rights
Linux
Requirements:
- g++ 14
- 64 bits computer
- cmake >= 3.11
Commands:
~/ark$ cmake . -Bbuild -DARK_BUILD_EXE=On
~/ark$ cmake --build build --config Release
~/ark$ sudo cmake --install build --config Release # needs administrator rights to install under /usr/bin
MacOS
Requirements:
- g++ 14 or clang 16
- cmake >= 3.11
On MacOS versions prior to 10.15, libc++
lacks filesystem
in the standard library.
You will need to :
- Install a newer compiler using Homebrew:
brew install gcc && brew link gcc
- Pass compiler path to
cmake
in the build step:-DCMAKE_CXX_COMPILER=/usr/local/bin/g++-14
Commands:
~/ark$ cmake . -Bbuild -DARK_BUILD_EXE=On -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-14
~/ark$ cmake --build build --config Release
~/ark$ cmake --install build --config Release # might need administrator rights
Running the tests
To check that everything works, it is important to run the tests for the projects, and we have a multitude of them:
tests/arkscript
: tests written in ArkScript itself, testing the builtins, operators and keywords (language unit tests)tests/benchmarks
: benchmarks for the parser and VM with a few scripts to help identifying regressionstests/errors
: every subfolder is a category of errors we are trying to detect, witha.ark
anda.expected
making a pair of a snippet that should produce an error and the expected errortests/fuzzing
: a collection of scripts (intests/fuzzing/docker/
) and ArkScript source files under the differentcorpus
/corpus-cmin
/corpus-cmin-tmin
directories (only thecorpus
directory is managed by us, the two others are generated automatically through scripts and AFL++). Fuzzers can be run automatically using thestart-afl-docker.sh
script, that starts a docker image, compile ArkScript and run the fuzzers inside tmux sessions. Anoutput/
folder is created at the root of the project with the fuzzers outputtests/unittests
: C++ unit tests for the project using boost/ut, testing different utilities of the project