Swiftweekly.github.io: [125] Issue #125 - January 10, 2019

Created on 13 Dec 2018  ·  35Comments  ·  Source: SwiftWeekly/swiftweekly.github.io

To contribute to this issue, simply leave a comment here. Please also review our contributing guidelines.

The current draft for this issue in _drafts/. If you want to contribute directly, feel free to open a pull request.

full issue notes

Most helpful comment

All 35 comments

Skipping the December 27 issue; we'll be back in 2019!

https://ericasadun.com/2018/12/12/the-beauty-of-swift-5-string-interpolation/

Some cool examples what we can do with Swift 5 String Interpolation

Sent with GitHawk

https://twitter.com/AirspeedSwift/status/1073436531166048256

This is a post about really exciting new direction for Swift, using compile-time evaluation of Swift code for faster logging using string interpolation.

https://forums.swift.org/t/improving-os-log-using-custom-string-interpolation-and-compile-time-interpretation/18799

https://forums.swift.org/t/progress-apple-swift-docker-repo-is-up/18785

In previous issue I didn't write about this, but here is also a post in forums.

https://github.com/apple/swift-evolution/pull/915

This proposal is now going to be run through a review. I will merge and patch up the document for review.

Given the updates @airspeedswift and @moiseev have done on this proposal as well, I think it makes sense to add them as proposal authors as well to address any questions related to technical concerns and data compatibility issues.

You already posted that one ;)

https://forums.swift.org/t/server-logging-api/18834

Almost all production server software needs logging that works with a variety of packages. So, there have been a number of different ecosystems (e.g. Vapor, Kitura, Perfect, ...) that came up with their own solutions for logging, tracing, metrics, etc.
The SSWG however aims to provide a number of packages that can be shared across within the whole Swift on Server ecosystem so we need some amount of standardisation. Because different applications have different requirements on what logging should exactly do, we're proposing to establish a SSWG logging API that can be implemented by various logging backends (called LogHandler).

Sent with GitHawk

One of the most popular library has completely rewritten using Swift features like Codable. Also removing what @mattt thought would be in Swift language:

Previous versions of Alamofire's documentation introduced users to making requests with the Alamofire.request() API. This dates back to version 1 and I think it reflects Mattt's belief that Swift would gain qualified module references, allowing users to refer to modules that weren't imported by just using the module name. This never came to pass, so this API was actually misleading.

https://forums.swift.org/t/alamofire-5-one-year-in-the-making-now-in-beta/18865

I'm not sure if this can make it's way to newsletter, but quite big milestone for this popular library.

Good blog post by @khanlou about analyzing complexity.

The takeaway here for me is that profiling and optimizing is hard. While complexity analysis can seem a bit academic — “When am I going to use this in my real career?” one asks — understanding the time and space complexity of your algorithms can help you decide which directions to explore. In this case, understanding the time complexity of sorting led us towards a broad idea which bore fruit. Finally, benchmarking and profiling with a wide variety of data leads to the most accurate information about how your code will work in production.

And also, next time you see a sort followed by a prefix, think about replacing it with smallest(_: by:).

https://github.com/apple/swift/pull/21370

[Name lookup] Enable shadowing for type lookup and of the Swift module

Swift 5's Result type won't cause source breakages with existing uses of user-defined Result types. Amazing. 😍 https://github.com/apple/swift/pull/21370

Sent with GitHawk

RFC: Building Swift Packages in build-script

We want to be able to build, test and install SwiftPM packages along with the rest of the Swift toolchain. This needs to build and run using the just-built compiler, package manager and corelibs for a variety of reasons.

https://forums.swift.org/t/rfc-building-swift-packages-in-build-script/18920

[Proposal] Ordered collection diffing

https://github.com/apple/swift-evolution/pull/968

https://forums.swift.org/t/ordered-collection-diffing/18933

....

Let's see how far this goes.

Pitch: Strengthen Requirements for Synthesizing Decodable by @stephencelis

https://forums.swift.org/t/pitch-strengthen-requirements-for-synthesizing-decodable/18977

Improved zip API proposal pitch

https://forums.swift.org/t/improved-zip-api/18949

Great article by @twostraws how to use Result type in Swift 5 https://www.hackingwithswift.com/articles/161/how-to-use-result-in-swift

Sent with GitHawk

Pitch about "Swift should allow for suppression of warnings, especially those that come from Objective-C" It has some valid points and lot of exploration has been done.

https://forums.swift.org/t/pitch-swift-should-allow-for-suppression-of-warnings-especially-those-that-come-from-objective-c/19216

I'd like to share my in-depth article about protocols https://swiftindepth.com/2019-01-01/reasoning-about-protocols

Another great articles about String interpolation https://www.hackingwithswift.com/articles/163/how-to-use-custom-string-interpolation-in-swift from @twostraws

Sent with GitHawk

SwiftNIO Redis Client https://forums.swift.org/t/swiftnio-redis-client/19325

This package includes two modules: NIORedis and Redis, which provide clients that handle connection to, authorizing, and executing commands against a Redis server.

NIORedis provides channel handlers for encoding / decoding between Swift native types and Redis' Serialization Protocol (RESP).

Redis is an abstraction layer that wraps NIORedis to be callback based with DispatchQueue.

https://github.com/apple/swift-evolution/pull/973 by @dennisvennink

Bug SR-5754

This proposal addresses the absence of lazy versions of some Sequence-related operations by adding new types, method overloads and conditional conformances to LazySequenceProtocol on applicable types that conform to Sequence

https://twitter.com/xge_apple/status/1083251230204260353

Exposing parser details as C API allows Swift clients, such as SwiftSyntax, to reuse compiler logics in-process. Outcomes? Significant performance gain for syntax tree generation by avoiding any forms of cross-process serialization 🙌

https://twitter.com/slava_pestov/status/1083161126249078784

Missing members are now diagnosed via the new diagnostics framework - a big step forward https://github.com/apple/swift/pull/21756

Fixed this 2 year old bug: https://github.com/apple/swift/pull/21621

  • Explanation: If T is an enum or a struct, containing a case or a static property named none, then assigning .none to a variable of type T? would cause it to have the value Optional.none rather than T.none.

    Example:

    enum Foo {
      case none
    }
    
    let test: Foo? = .none // Assigned Optional.none instead of Foo.none
    let isEqual: Bool = test == Foo.none // false
    

Awesome stuff @theblixguy!

Thanks all for helping out on this one!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jessesquires picture jessesquires  ·  10Comments

jessesquires picture jessesquires  ·  10Comments

jessesquires picture jessesquires  ·  4Comments

jessesquires picture jessesquires  ·  5Comments

ColinEberhardt picture ColinEberhardt  ·  5Comments