Skip to content

dansawkins/ark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ark Build Status license Gitter

Ark is a systems programming language somewhere in-between C and C++.

Table Of Contents

Example

For a more complicated example, check out a port of my virtual machine MAC in Ark here. Or if you just want a small example program written in Ark.

[c] func printf(fmt: str, ...);
func main(): int {
    mut i := 0;
    for i < 5 {
        C::printf("i: %d\n", i);
        i = i + 1;
    }
    return 0;
}

Resources

Installing

Installing Ark should be relatively easy, you'll need a few dependencies before you get started:

Dependencies

Building

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/russross/blackfriday
$ go get gopkg.in/alecthomas/kingpin.v2
$ go get github.com/ark-lang/ark
$ cd $GOPATH/github.com/ark-lang/ark
$ make

The ark binary will be built in $GOPATH/bin. To use the compiler, make sure $GOPATH/bin is in your $PATH.

To see the current state of the compiler, try running the test script.

Usage

For detailed usage information, run ark help. For information on specific commands, use ark help <command>.

Compiling Ark Code

ark build tests/big_test.ark -o out_name

If the -o option is not specified, the outputted binary will be names main.

Docgen

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.

Utilities

make gen and make fmt

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.

Testing

Requires $GOPATH/bin to be in your $PATH and Python 2.4 or newer.

$ ./test.py

About

Ark, a compiled systems programming language written in Go using the LLVM framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.3%
  • Python 1.6%
  • Makefile 0.1%