A cross-platform Swift web code runner served by Seaside on Pharo.
Similar commercial implementations are used at Replit and OnlineSwiftPlayground.run.
- Pharo 8 reference platform.
- Requires:
- macOS (tested with 10.15.4) or GNU/Linux (tested with Ubuntu 14.04, 64 bit).
- Swift tools (see Installation below).
- Support the latest Pharo release.
-
Install and setup the Swift tools for your environment:
- macOS: Install the Command Line Tools for Xcode.
- GNU/Linux: Install Swift from swift.org.
-
In a Playground, Do It:
Metacello new repository: 'github://brackendev/SeasideSwift:v1.0.0/src'; baseline: 'SeasideSwift'; onConflict: [ :ex | ex useIncoming ]; onUpgrade: [ :ex | ex useIncoming ]; onDowngrade: [ :ex | ex useLoaded ]; load.
In a Playground, Do It:
"Start the service"
SeasideSwift shared start.
WebBrowser openOn: 'http://127.0.0.1:8080/SeasideSwift/'.
"Stop the service"
SeasideSwift shared stop.
Additionally, HTTP POST requests are supported with Teapot. For example, the following curl command returns Hello, World!
.
curl -X "POST" "http://127.0.0.1:8081/swift" \
-H 'Content-Type: text/plain; charset=utf-8' \
-d "print(\"Hello, World!\")"
This project makes use of the following third-party libraries:
Bracken Spencer
SeasideSwift is released under the MIT license. See the LICENSE file for more info.
- @pharoproject [Twitter]
- @swiftlang [Twitter]
- pharo.org
- swift.org