markusthoemmes opened a new issue #77: Define Swift development experience URL: https://github.com/apache/incubator-openwhisk-runtime-swift/issues/77 @jberstler commented on [Tue May 10 2016](https://github.com/apache/incubator-openwhisk/issues/371) At the current moment, the possibilities for Swift development experience on OpenWhisk are wide open. Let's use this issue to discuss the right approach to make developing OpenWhisk artifacts in Swift a good experience for our users. Whatever specific decisions are made, I think we should keep in mind the following ideals: - Allow for use of standard development tools, including Xcode and the Swift CLI. - User code should compile cleanly on their development machine (not just in the OW Swift runtime). - Some amount of unit testing should be possible on the user's development machine. - User should be able to develop multiple OW artifacts (say, all artifacts within a OW package) in the same Swift package/Xcode target. - The development experience should be comparable regardless of the platform the developer is using to write their code. It may not be possible to achieve all of these ideals in the final experience, and so compromise should be carefully considered. --- @jberstler commented on [Tue May 10 2016](https://github.com/apache/incubator-openwhisk/issues/371#issuecomment-218158245) **Proposal**: Actions must declare a global `main` function The obvious advantage of this approach is simplicity. The action developer gets to see exactly what is expected of them, and the OW runtime knows exactly what code to invoke to run the action: ``` swift func main(args: [String:Any]) -> [String:Any] { // action implementation goes here } ``` This advantage extends even to having the types of the `args` object and the expected return type plainly visible to the action developer. The disadvantage to this approach is that it violates our goals of using standard tools and developing multiple OW artifacts in the same Swift package or Xcode target. If you have multiple files declaring this global `main` function, the swift compiler will complain that you are trying to redefine a global function. --- @rabbah commented on [Thu Nov 16 2017](https://github.com/apache/incubator-openwhisk/issues/371#issuecomment-344950607) @csantanapr @paulcastro @jberstler should we move this to the new swift repo?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
