Swiftpack.co - Package - kai-language/kai

Kai Programming Language

Gitter chat

An expressive low level programming language.

Documentation

Read the docs at docs.kai-lang.org

Featured projects

Have you built something cool? Feel free to share it here!

  • KaiNES: A pure-Kai NES emulator.
  • KaiVM: A register-based VM and disassembler.
  • Kinit: A minimal init system.

Download and Install

MacOS

You can download and install Kai through our homebrew tap.

brew install kai-language/tap/kai

Linux

In the future, Kai will offer official binary distribution through apt and other package managers. See building Kai.

Building Kai

Before you can begin building Kai, you must install the following dependencies:

  • Swift 4.0
  • LLVM 4 or higher
  • libgit2

Swift 4

On Mac, the preferred way to install Swift 4 is by installing Xcode. After installing Xcode, make sure to run it once and say yes to installing the command-line tools.

LLVM

By far, the easiest way to install LLVM on Mac is through brew. After setting up brew, run the following to install the correct version of LLVM:

brew install llvm

Using LLVM with Swift Package Manager

Now that LLVM is installed, append the directory to your path in ~/.bash_profile

/usr/local/opt/llvm/bin

In order for Swift Package Manager to build against LLVM's libraries, we need to setup a pkg-config file. Thankfully, LLVMSwift has a script for this:

Grab the script by running swift package update in Kai's root directory. Then, run:

swift .build/checkouts/LLVMSwift.git-<version-here>/utils/make-pkgconfig.swift

LibGit2

Just like LLVM, libgit2 can be installed through brew.

brew install libgit2

Github

link
Stars: 64
Help us keep the lights on

Used By

Total: 1

Releases

0.2.0 - Apr 30, 2018

Fixed:

  • Pretty much everything has been changed.
  • Updates to constant folding

New:

  • #test directive
  • #os directive
  • #if conditional compilation

0.1.9 - Feb 24, 2018

Fixed:

  • Lots and lots of bugs
  • Enum syntax updated to be more refactor friendly
  • Variadic improvements

New:

  • Unions are now tagged automatically
  • Enum flags
  • Type info!
  • Inline asm

0.1.8 - Dec 9, 2017

New:

  • Added using support in switch statements

Fixed:

  • Crash when import fails
  • Crash when decl position was loaded
  • Selectors on aliased pointers
  • Codegen with LLVM aliases

0.1.7 - Dec 3, 2017

New:

  • using support on enumerations
  • case statements now support lists. Ex: case "a", "b", "c":

Fixed:

  • String escape crash
  • Invalid width crash
  • Invalid codegen logic creating duplicate function prototypes
  • #function directive
  • Function calls on aliased types

0.1.6 - Nov 25, 2017

Fixed:

  • Slice as lvalue crash