Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ark-lang/ark
A compiled systems programming language written in Go using the LLVM framework
https://github.com/ark-lang/ark
Last synced: 4 months ago
JSON representation
A compiled systems programming language written in Go using the LLVM framework
- Host: GitHub
- URL: https://github.com/ark-lang/ark
- Owner: ark-lang
- License: mit
- Archived: true
- Created: 2014-12-02T21:32:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T14:05:43.000Z (over 5 years ago)
- Last Synced: 2024-08-01T16:18:07.302Z (7 months ago)
- Language: Go
- Homepage: https://ark-lang.github.io/
- Size: 15.4 MB
- Stars: 677
- Watchers: 40
- Forks: 47
- Open Issues: 45
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-programming-languages - Ark - Ark is a systems programming language focused on being practical and pragmatic. We want a language that is simple, easy to write, yet powerful enough to create readable, performant and concise code for any problem (Uncategorized / Uncategorized)
README
## Ark [][1] [](https://raw.githubusercontent.com/ark-lang/ark/master/LICENSE)
[1]: https://travis-ci.org/ark-lang/ark "Build Status"
[Ark](//www.ark-lang.org) is a systems programming language focused on being practical and pragmatic. We want a language that is simple, easy to write, yet powerful enough to create readable, performant and concise code for any problem
On the right is a gif of an example program [ark-gl](//github.com/ark-lang/ark-gl) written in Ark using OpenGL and GLFW.
## Index
* [Getting Involved](#getting-involved)
* [Example](#example)
* [Installing](#installing)
* [Dependencies](#dependencies)
* [Building](#building)
* [Compiling Ark code](#compiling-ark-code)## Getting Involved
Check out the [contributing guide](/CONTRIBUTING.md), there's a lot of information there to give you ideas of how you can help out.## Example
Ark is still a work in progress, this code sample reflects what Ark can
do *currently*, though the way you write the following will likely change
in the near future.More examples can be found [here](/examples).
```rust
// binding to printf
[c] func printf(fmt: ^u8, ...);pub func main(argc: int, argv: ^^u8) -> int {
// accessed via the C module
C::printf(c"Running %s\n", ^argv);// mutable i, type inferred
mut i := 0;for i < 5 {
C::printf(c"%d\n", i);i += 1;
}
return 0;
}
```## Installing
Installing Ark is simple, you'll need a few dependencies
before you get started:### Dependencies
* Go installed and `$GOPATH` setup - [Instructions on setting up GOPATH](//golang.org/doc/code.html#GOPATH)
* For building LLVM bindings:
* Subversion
* A C++ Compiler
* CMake installed
* `libedit-dev` installed### Building
Once you have your dependencies setup, building ark from scratch is done by
running the following commands:```bash
$ git clone https://github.com/ark-lang/go-llvm.git $GOPATH/src/github.com/ark-lang/go-llvm
$ cd $GOPATH/src/github.com/ark-lang/go-llvm
$ ./build.sh
$ go get github.com/ark-lang/ark/...
```The `ark` binary will be built in `$GOPATH/bin`. To use the compiler,
make sure `$GOPATH/bin` is in your `$PATH`.### Compiling Ark code
Currently the module system Ark uses is a work in progress. As of writing this,
each ark file represents a module. A module has a child-module "C" which
contains all of the C functions and other bindings you may write.Given the following project structure:
src/
- entities/
- entity.ark
- player.ark
- main.arkTo compile this, you would pass through the file which contains the main
entry point (main function) to your program, which is conventionally named "main.ark".Since our main file is in another folder, we need to set the src folder as
an include directory so that the compiler doesn't think it's a module. We use
the `-I` flag for this:ark build -I src src/main.ark --loglevel=debug
This should compile your code, and produce an executable called "main", which
you can then run.For more information on the module system and how it works,
refer to the ["Modules and Dependencies"](http://book.ark-lang.org/modules.html)
section in the Ark reference.For more information on program flags, refer to the
["Program Input"](http://book.ark-lang.org/source.html), section in the Ark
reference.