SeasideSwift

A cross-platform Swift web code runner served by Seaside on Pharo.

Similar commercial implementations are used at Repl.it and OnlineSwiftPlayground.run.

Installation

  1. Install and setup the Swift tools for your environment:
  2. 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 ];
       ignoreImage;
       load.
    

Usage

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!\")"

Screenshots

macOS

Screenshot

GNU/Linux

Screenshot

TODO

Acknowledgements

This project makes use of the following third-party libraries:

Author

brackendev

License

SeasideSwift is released under the MIT license. See the LICENSE file for more info.