Alloy (formerly Jayfor/Ink) is a programming language written in C. The goals of this language are:
- Speed
- Simplicity
- Cleanliness
We created Alloy because we love writing C, and love the simplicity of C; we also wanted to evolve C into something more modern, and easier to use.
We have an IRC where we discuss Alloy, and other stuff too, come join! If you want to help contribute, we highly suggest you join the IRC :)
- server: irc.freenode.net
- channel: #alloy-lang
Warning, this is still (potentially) subject to change. Also a disclaimer, the syntax below is very incosistent and is just to show what's possible in the language.
struct Whatever {
int x = 10
int y
}
fn do_stuff(int a, int b): int {
int x = 5
while ((a + b) > 10) -> x = (x + 1)
match x {
(x == 12) {
loop {
if ((a + x) > 21) -> break
}
return x
}
(x < 2) {
for _ :(a, b) {
a = (x + 1)
}
}
(x == 29) -> return a
_ {
return 1337
}
}
if (x > 21) {
return (x - 21)
}
}
fn main() {
do_stuff(125, 25)
}
The language is still in development. More information/specifics
can be found in /docs/
. The compiler is written in C
and uses LLVM as its backend.
To build you will need:
LLVM >= 3.4
- A suitable GNU C compiler (any one of the below will do fine):
clang >= 3.4.0
gcc >= 4.8.1
(changeLCC
andLCXX
in the makefile togcc
andg++
, respectively)
# clone the repository
git clone -v https://github.com/alloy-lang/alloy.git
# cd into the repository
cd alloy
# build
make
# run a program
./alloyc tests/parser-tests/const.alloy
Something not working? Open an Issue or send us a Pull Request on GitHub.
See CONTRIBUTING.md.
Alloy is licensed under the MIT License.