LispKit is a framework for building Lisp-based extension and scripting languages for macOS applications. LispKit is fully written in the programming language Swift. LispKit implements a core language based on the R7RS (small) Scheme standard. It is extensible, allowing the inclusion of new native libraries written in Swift, of new libraries written in Scheme, as well as custom modifications of the core environment consisting of a compiler, a virtual machine as well as the core libraries.
So far, performance was not a priority in the development of LispKit. The LispKit compiler does not perform many code optimizations and the performance of the system is below state of the art Lisp and Scheme implementations.
LispPad implements a simple, lightweight, integrated development environment for LispKit on macOS.
LispKit provides support for the following core features, many of which are based on R7RS:
- Modules based on R7RS libraries
 - Hygienic macros based on 
syntax-rules - First-class environments
 call/cc,dynamic-windand exceptions- Dynamically-scoped parameters
 - Multiple return values
 - Delayed execution via promises and streams
 - Support for the full numerical tower consisting of arbitrary size integers, rationals, real numbers, and inexact complex numbers.
 - Unicode strings and characters
 - Vectors and bytevectors
 - Text and binary ports
 - R7RS-compliant records
 - R6RS-compliant hashtables
 - R6RS-compliant enumerations
 - All R7RS libraries: 
(scheme base),(scheme case-lambda),(scheme complex),(scheme cxr),(scheme eval),(scheme file),(scheme inexact),(scheme lazy),(scheme load),(scheme process-context),(scheme read),(scheme repl),(scheme time),(scheme write),(scheme r5rs) - LispKit-specific libraries: 
(lispkit datatype),(lispkit object),(lispkit enum),(lispkit iteration),(lispkit set),(lispkit stack),(lispkit queue),(lispkit heap),(lispkit wt-tree),(lispkit prettify),(lispkit json), and(lispkit pdf) 
LispKit is incompatible or incomplete with respect to the following R7RS features:
- Lists are immutable. Mutable cons-cells are supported in a way similar to Racket
 - Error support is incomplete; the following functions are missing: 
read-error?,file-error? current-input-port,current-output-port, andcurrent-error-portare functions (as required by R5RS) and not parameter objects (as required by R7RS)- Datum comments introduced via 
#;do not always work as expected. 
The following SRFI libraries have been ported to LispKit and are included in the framework:
- SRFI 1: List Library
 - SRFI 2: AND-LET* - an AND with local bindings, a guarded LET* special form
 - SRFI 8: receive - Binding to multiple values
 - SRFI 17: Generalized set!
 - SRFI 19: Time Data Types and Procedures
 - SRFI 27: Sources of Random Bits
 - SRFI 28: Basic Format Strings
 - SRFI 31: A special form rec for recursive evaluation
 - SRFI 35: Conditions
 - SRFI 41: Streams
 - SRFI 48: Intermediate Format Strings
 - SRFI 63: Homogeneous and Heterogeneous Arrays
 - SRFI 64: A Scheme API for test suites
 - SRFI 121: Generators
 - SRFI 128: Comparators
 - SRFI 132: Sort Libraries
 - SRFI 133: Vector Library
 - SRFI 134: Immutable Deques
 - SRFI 135: Immutable Texts
 - SRFI 142: Bitwise Operations
 - SRFI 152: String Library
 - SRFI 158: Generators and Accumulators
 
From an architectural perspective, LispKit consists of:
- a compiler translating LispKit expressions into bytecode, and
 - a virtual machine for interpreting the generated bytecode. The virtual machine is stack-based, handles tail calls and continuations, and provides a garbage collector.
 
Details can be found in the LispKit Wiki.
The project provides a read-eval-print loop in form of a command-line tool. This command-line tool that can be used to try out and experiment with the framework. The read-eval-print loop parses the entered LispKit expression, compiles it to bytecode, executes it, and displays the result.
First, clone the LispKit repository via git. The following command will create a
directory swift-lispkit.
> git clone https://github.com/objecthub/swift-lispkit.git
Cloning into 'swift-lispkit'...
remote: Counting objects: 1849, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 1849 (delta 9), reused 0 (delta 0), pack-reused 1806
Receiving objects: 100% (1849/1849), 689.43 KiB | 666.00 KiB/s, done.
Resolving deltas: 100% (1430/1430), done.Fetch dependencies and build them from scratch via carthage:
> cd swift-lispkit
> carthage bootstrap
*** Checking out swift-numberkit at "1.6.0"
*** xcodebuild output can be found in /var/folders/c_/h31lvvtx72s3zhc9bvxd0p480000gn/T/carthage-xcodebuild.46W8Z7.log
*** Building scheme "NumberKit (shared)" in NumberKit.xcodeprojNow, it's possible to switch to Xcode and build the read-eval-print loop via
scheme LispKitRepl:
> open LispKit.xcodeprojA debug binary can be built in the following way:
> cd swift-lispkit
> swift build -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.11" \
  -Xswiftc "-D" -Xswiftc "SPM"
Compile Swift Module 'NumberKit' (6 sources)
Compile Swift Module 'LispKit' (75 sources)
Compile Swift Module 'LispKitRepl' (2 sources)
Linking ./.build/x86_64-apple-macosx10.10/debug/LispKitReplA release binary can be built like this:
> cd swift-lispkit
> swift build -c release -Xswiftc -static-stdlib -Xswiftc "-target" \
  -Xswiftc "x86_64-apple-macosx10.11" -Xswiftc "-D" -Xswiftc "SPM"
Compile Swift Module 'NumberKit' (6 sources)
Compile Swift Module 'LispKit' (75 sources)
Compile Swift Module 'LispKitRepl' (2 sources)
Linking ./.build/x86_64-apple-macosx10.10/release/LispKitReplThe read-eval-print loop can be built using the Swift Package Manager. Nevertheless, it is recommended to use Xcode 9 in combination with Carthage:
