Skip to content

Simple programming language written in Swift and compiled with LLVM

Notifications You must be signed in to change notification settings

bencochran/Kaleidoscope

Repository files navigation

Kaleidoscope

This is an implementation of (some of) the language from the LLVM Kaleidoscope tutorial.

The project itself does its parsing with KaleidoscopeLang and codegen using LLVM.swift.

Getting it running

  1. Build LLVM (currently tested with 3.6.2). Homebrew is the easiest way to do this: brew install llvm

  2. Clone the repository and its submodules

  3. In Carthage/Checkouts/LLVM/LLVM.xcconfig, set LLVM_PREFIX to be the prefix used when building LLVM. For homebrew this will typically be /usr/local/Cellar/llvm/3.6.2, for you it may be /usr/local or similar depending on your setup.

  4. Open Kaleidoscope.xcworkspace and run it!

Limitations

  • There’s currently no way to run the resulting LLVM assembly because there’s no way to represent main. See #4.

  • There’s no JIT like the Kaleidoscope tutorial has.

  • This currently only implements up to Chapter 4 of the Kaleidoscope tutorial

About

Simple programming language written in Swift and compiled with LLVM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages