Skip to content

brackendev/SeasideSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeasideSwift

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).

Screenshots

macOS

Screenshot

GNU/Linux

Screenshot

TODO

  • Support the latest Pharo release.

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

Acknowledgements

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

Author

Bracken Spencer

License

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


Useful Links