Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Swift development experience #371

Closed
jberstler opened this issue May 10, 2016 · 3 comments
Closed

Define Swift development experience #371

jberstler opened this issue May 10, 2016 · 3 comments

Comments

@jberstler
Copy link

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
Copy link
Author

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:

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
Copy link
Member

rabbah commented Nov 16, 2017

@csantanapr @paulcastro @jberstler should we move this to the new swift repo?

@markusthoemmes
Copy link
Contributor

Issue moved to apache/incubator-openwhisk-runtime-swift #77 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants