iSwift is the kernel IPython/Notebook implementation for Swift programming language.
It can:
- Execute swift code on the Jupyter Notebook web editor, Jupyter console as well as Jupyter qtconsole.
- Import Foundatation/Dispatch and other Buildin libraries.
- Autocomplete swift code by pressing tab ↹.
- Support encryption.
- Support Linux/macOS
This project is based off KelvinJin/iSwift but makes a few changes:
- Updates to support Swift 4.1
- Base the docker image off jupyter/minimal-notebook
The preferred way of using this is via the docker image, either locally or in jupyterhub/binderhub
$ docker run -t -i -p 8888:8888 --privileged rayh/swift-notebook
And open the link you see in the console, which will start Jupyter, from there you can select New
-> Swift
You can demo a version of this on binderhub here:
- macOS/Linux
- Swift 4.1
- ZMQ + Jupyter 5.0
Clone this repo locally. And:
-
Follow this script to install the libzmq on your machine.
-
Build the project.
swift build
- Currently, in order to run swift kernel locally, you need to create a file named
kernel.json
. Put the following content to the file and replace thePath/to/iSwift
with your local clone path.
{
"argv": ["Path/to/iSwift/.build/debug/iSwift", "-f", "{connection_file}"],
"display_name": "Swift",
"language": "swift"
}
- Install Jupyter kernel: (replace the
Folder/that/has/kernel/json
with the path of the folder that contains thekernel.json
file)
jupyter-kernelspec install Folder/that/has/kernel.json
- Run Jupyter Notebook (token needs to be empty):
jupyter notebook --NotebookApp.token=
- Install Swift 3.0.
- Check if you have libzmq installed.
- Continue from step 2 in the section above.
Simply clone this repo and run docker build -t iswift .
. It will build the docker image.
Contributions are welcome. Simply create an issue if you have ideas on how we can improve iSwift.
MIT