CommentComment

Hello!

I’ve just finished recording a video about Firebase Authentication on the web using the latest version of the [Firebase JavaScript SDK](https://github.com/firebase/firebase-js-sdk, and it is quite interesting to see how different programming languages implement concepts like async/await.

For example, would you be able to tell if the following code snippet is written in JavaScript or Swift?

try {
  let userCredential = await createUserWithEmailAndPassword(auth, loginEmail, loginPassword)
}
catch(error) {
  showLoginError(error)
}

You probably guessed it - this is a piece of code from the sample app for the video, written in JavaScript, but it could just as well be valid Swift code. In fact, a JavaScript linter would probably scold me for not using ; at the end of each statement…

The evolution of Swift and JavaScript couldn’t be more different, though - JavaScript is a language that has to walk a fine line of browser compatibility, whereas early versions of Swift seemed to follow the principle of “move fast, and break things”. You can still painfully see the results of this process when looking as StackOverflow answers that provide solutions for several versions of Swift, because of slight differences between language versions.

I am happy Swift has reached a state of relative stability now, while still being able to add new concepts such as async/await.

I hope you enjoy this fifth edition of Not Only Swift Weekly - if you do, please share it with a friend. And as always, feel free to share your feedback with me!

Thanks for reading!

Peter  

What I am working on

FirebaseFirebase

SwiftSwift

Back-deploying Concurrency

The Swift team (and Doug Gregor in particular) seems to be putting some serious amount of work into making back-deployment of async/await a reality. Adding an option to build the concurrency library for back-deployment was one of the first PRs people noticed, and Back-deploy concurrency is another step to make this happen. Doug provides some context in this thread: “we’re not ready to commit to an answer to [whether concurrency will be back deployed to older OSes] because, as we said before, it’s technically challenging and we’re not 100% sure it’ll work out.” If you’re interested in this, follow along on GitHub at https://github.com/apple/swift

Not Only Swift  


Tools


Conferences