Skip to content
/ alloy Public
forked from ark-lang/ark

Alloy, an LLVM based programming language written in C [WIP]

License

Notifications You must be signed in to change notification settings

torwart/alloy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

IRC

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

A taste of Alloy

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)
}

Status

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.

Building

To build you will need:

# 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

Contributing

Something not working? Open an Issue or send us a Pull Request on GitHub.

See CONTRIBUTING.md.

License

Alloy is licensed under the MIT License.

About

Alloy, an LLVM based programming language written in C [WIP]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 90.8%
  • C++ 7.3%
  • Makefile 1.6%
  • Shell 0.3%