Ark is a systems programming language somewhere inbetween C and C++.
A small example program written in Ark.
[c] func printf(fmt: str, ...);
func main(): int {
mut i := 0;
for i < 5 {
printf("i: %d\n", i);
i = i + 1;
}
return 0;
}
Installing Ark should be relatively easy, you'll need a few dependencies before you get started:
- Go installed and
$GOPATH
setup - subversion
- LLVM installed, with
llvm-config
andllc
in your$PATH
- a C++ compiler
Replace RELEASE_360
with the version of LLVM you have installed. For example, version 3.6.1 becomes RELEASE_361
. You can find out your version of llvm by running llvm-config --version
.
$ svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/final $GOPATH/src/llvm.org/llvm
$ export CGO_CPPFLAGS="`llvm-config --cppflags`"
$ export CGO_LDFLAGS="`llvm-config --ldflags --libs --system-libs all`"
$ export CGO_CXXFLAGS=-std=c++11
$ go install -tags byollvm llvm.org/llvm/bindings/go/llvm
$ go get github.com/ark-lang/ark
$ go install github.com/ark-lang/ark
Make sure $GOPATH/bin
is in your $PATH
.
To see the current state of the compiler, try running the test script.
For detailed usage information, run ark help
. For information on specific commands, use ark help <command>
.
ark build tests/big_test.ark -o out_name
If the -o
option is not specified, the outputted binary will be names main
.
ark docgen tests/big_test.ark --dir some_output_dir
If the --dir
option is not specified, the generated documentation will be placed in docgen
.
The targets gen
and fmt
are included for the convenience of the developers. They run go generate
and go fmt
respectively on all the modules in Ark. Please run make fmt
before creating a pull request.
Requires $GOPATH/bin
to be in your $PATH
and Python 2.4 or newer.
$ ./test.py
Ark is licensed under the MIT License.