Simple programming language written in Swift and compiled with LLVM
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Carthage/Checkouts
Configuration
Kaleidoscope.xcodeproj
Kaleidoscope.xcworkspace
Kaleidoscope
KaleidoscopeTests
.gitignore
.gitmodules
Cartfile
Cartfile.resolved
README.md

README.md

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