• Trends
  • Topics
  • Nodes
Search for keywords, #hashtags, $sites, add a dash to exclude, e.g. -$theonion.com

From swift.org

[Pitch] Last expression as return value

1 1

I think this pitch identifies a genuine pain point. The question is what is the best way to address it. @Ben_Cohen mentioned here that the thread has proposed a continuum of options: To me each option has tradeoffs, and none of them feel like the one. My opinion keeps changing, but I tend to...

#SwiftLang

5h ago

From swift.org

[Pitch] Add `remove(where:)` Method for `Set` and `Dictionary`

1 1

@jordanekay I thought I was the only one noticing, felt like I was doing a Turing test šŸ˜… Also this seems wrong. Iteration order is not deterministic in Set and Dictionary.

17h ago

From swift.org

[Pitch] Add `remove(where:)` Method for `Set` and `Dictionary`

1 1

This proposal introduces a new method, remove(where:), for the Set and Dictionary data structures in Swift. The method provides a streamlined way to remove elements that satisfy a given condition, improving code readability, performance, and developer experience.

18h ago

From swift.org

[Pitch] Last expression as return value

0 4

Attention conservation notice: long post, sorry. I want to take a step back for a moment and talk about a more general principle that's behind this and many evolution proposals, which is the pursuit of an overarching goal of Swift as a low-ceremony language. As a way to illustrate this I want...

on Sun, 11PM

From swift.org

[Pitch] strict concurrency checking for async functions

0 0

A common, borderline universal experience when starting with Swift concurrency is to begin with Swift 5 mode and with strict-concurrency set to minimal. This allows developers to use quite a lot of concurrency features without getting any feedback from the compiler. By the time you do get...

on Jan 4

From swift.org

[Pitch] Explicit Specialization

0 0

Hi Swit Evolution, A proposal to formalize an attribute that has existed since fairly early Swift in underscored form, that gives more control over generic performance. Explicit Specialization Proposal: SE-NNNN Authors: Ben Cohen Review Manager: TBD Implementation: Available in nightly...

on Jan 2

From swift.org

[Pitch] Last expression as return value

0 0

Happy New Year, Swift Evolution! This is a new pitch for a rule that would allow multi-statement if and switch expressions, as well as introduce do expressions. It does this via a new rule that the last expression in a function or branch is the return value, without a keyword (either return for...

on Jan 2

From swift.org

[Prospective Vision] Accessors

0 0

Hello, Swift Community. The Language Steering Group would like to gather feedback on a prospective vision for accessors in Swift. Vision documents help describe an overall direction for Swift. The actual Swift changes for executing on the vision will come as a series of separate proposals, so...

on Dec 18

From swift.org

Swift Language focus areas heading into 2025

0 0

With Swift 6.0 and the Swift 6 language mode now released, Swift language development under the Language Steering Group is now focused on three major areas: making Swift Concurrency easier to approach and adopt, providing powerful low-level language and library tools for high-performance...

on Dec 14

From swift.org

Testing Closure-based asynchronous APIs

0 0

I've been trying to migrate my existing XCTest based suites to Testing and whenever I do swift concurrency dependent tests, everything seems fine. However, if I need to test some closure based APIs, then I can't find a way. Let's imagine we have a ViewModel class with a sync interface function...

on Dec 12

From swift.org

Objc XCTest target unable to see ProductModuleName-Swift.h

0 0

I'm trying to follow this guide to import my Swift code into an external Objc target. I chose an XCTest target because hey, tests, two birds one stone. My Swift code is in a static library target. It consists of one class: @objcMembers public class Foo { var bar = "foo" } In my objc test...

on Dec 9

From swift.org

[Pitch] Add `insertOrRemove(_:)` Method to `Set` and `SetAlgebra` in Swift

0 0

Introduction This proposal suggests adding an insertOrRemove(_:) method to the SetAlgebra protocol in Swift, and by extension to the Set type. This method provides a concise and intuitive way to toggle the presence of an element in a Set or any SetAlgebra conformer, either inserting it if absent...

on Nov 25

From swift.org

[Prospective Vision] Improving the approachability of data-race safety

0 0

Hello Swift Community! The Language Steering Group would like to gather feedback on a prospective vision for improving the approachability of data-race safety that @John_McCall and I have been working on. Vision documents help describe an overall direction for Swift. The concrete Swift changes...

on Nov 23

From swift.org

Feature proposal: Accessing non-public C++ members from Swift

0 0

Hey folks, I'm working on a feature that will allow Swift to access non-public C++ members, and I'm interested in hearing your feedback. You can find the full pitch here. The tl;dr is to introduce a C++ class annotation, SWIFT_PRIVATE_FILEID, which will specify where Swift extensions of that...

on Nov 22

From swift.org

Error: no such module 'Testing'

0 0

I've updated the Swift Toolchain:$ swift -version swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2) Target: arm64-apple-macosx15.0 Swift 6 supposedly now includes Swift-Testing; It is no longer necessary to add swift-testing into a Package.swift. ...

on Nov 21

From swift.org

Ladybird Browser and Swift - Garbage Collection

0 0

Hello! I've been chatting about this with several Swift team members over the past few weeks/months, but I figured a post here on the forums was due. At the Ladybird Browser project we've been experimenting with more and more Swift C++ Interop lately. In general our goals with Swift fall into...

on Nov 20

From swift.org

Historical relationship to Rust?

0 0

As I've been giving presentations about the origins of Hylo and its position in the language ecosystem as a descendant of Swift, I've been digging more deeply into the history of Rust, because it inhabits an adjacent niche. It seems as though Swift and Rust are converging substantially these...

on Nov 19

From swift.org

Round-tripping Swift async tasks through Objective-C interfaces

0 0

The problem By default, Swift interprets Objective-C functions with block completion handlers as async APIs. Suppose that we have an Objective-C function with a signature like this: - (void) fooWithBar: (NSString* __nonnull) bar completion: (void (^)(NSString* __nonnull)) completion; ...

on Nov 15

From swift.org

[Review] SF-0011: Concurrency-Safe Notifications

0 0

Hello Swift community, The review of SF-0011 Concurrency-Safe Notifications begins now and runs through Nov. 19, 2024. Pitch Thread Reviews are an important part of the Swift-Foundation evolution process. All review feedback should be either on this forum thread or, if you would like to keep...

on Nov 15

From swift.org

[Pitch] Modify and read accessors

0 0

I put forward "edit" as a candidate alternative for modify: it has the quality of describing an ongoing activity. most importantly, it has 4 letters, same number as "read". With get/set being a pair of 3-letter words, and borrow/mutate being a pair of 6-letter words, we'd achieve ultimate...

on Nov 14

From swift.org

Fatal: cannot use bare repository

0 0

This is a security restriction that prevents cve-2022-24765. Basically, I create a Git hook, let other users access, then the hook will execute with the permissions of other users. Any of the following solutions will fix it: Disable this security feature for all folders if your machine is...

on Nov 13

From swift.org

[Review] SF-0010: Concurrency-Safe Notifications

0 1

Hello Swift community, The review of SF-0010 Concurrency-Safe Notifications begins now and runs through Nov. 19, 2024. Reviews are an important part of the Swift-Foundation evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback...

on Nov 13

From swift.org

Why "error: covariant 'Self' type cannot be referenced from a stored property initializer"

0 1

struct Foo { let blah: String } class Bar { static let ala = "Me" let foo = Foo(blah: Self.ala) // error: covariant 'Self' type cannot be referenced from a stored property initializer let foo2 = Foo(blah: Bar.ala) // this is okay } What is "covariant 'Self' type"? Why this...

on Nov 9

From swift.org

Can Character.lowercased() return multiple characters?

0 0

The documentation of Character.lowercased() states: Because case conversion can result in multiple characters, the result of lowercased() is a string. and I am looking for an example where this actually happens. I know that converting the ā€œGerman eszettā€ to upper case results in two...

on Nov 8

From swift.org

Editing and debugging a SwiftPM plugin?

0 0

Yeah that's the challenge, right?

on Nov 8

From swift.org

Safe and efficient C++ interoperability via non-escapable types and lifetimes

0 0

Introduction Safely interacting with unsafe code is challenging. The C++ interoperability layer has limited safeguards in place to mitigate some sources of unsafety including hiding some APIs (like methods returning iterators) and exposing them with an ā€œUnsafeā€ suffix. Unfortunately, these are...

on Nov 8

From swift.org

Two New Website Workgroup Projects

0 0

The Swift Website Workgroup has begun work on two related but separate projects. Each project focuses on an important aspect of improving how information is presented to the Swift community. Swift Information Architecture Project The goal of this project is to design a unified information...

on Nov 6

From swift.org

SE-0452: Integer Generic Parameters

0 0

Hi Swift community, The review of SE-0452: Integer Generic Parameters begins now and runs through 19th of November, 2024. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private,...

on Nov 5

From swift.org

Forums Policy on "Memes" and Other Expressive Images

0 0

Hello, Swift community. The Core Team has decided to impose a new policy on the use of expressive images on these forums. Most importantly, this policy would forbid the use of ā€œmemesā€ and similar images. The primary purpose of these forums is to foster open and productive technical discussion....

on Oct 31

From swift.org

Should ObservationRegistrar willSet/didSet Always Be Paired?

0 0

For future proofing I would strongly suggest to always pair will/did set calls.

on Oct 29

From swift.org

Should ObservationRegistrar willSet/didSet Always Be Paired?

0 0

I'm in the process of migrating my data persistence library Boutique from being an ObservableObject supporting @Observable types. For the most part the process has been straightforward, but I have two property wrappers (@StoredValue and @SecurelyStoredValue that now work, with one outstanding...

on Oct 29

From swift.org

Swift Forums

0 0

Swift Forums

on Oct 26

From swift.org

[Pitch] Modify and read accessors

0 0

Hi Swift evolution, We are proposing modify and read accessors for properties and subscripts. The proposal would formalize the underscored _modify and _read accessors that have been unofficially available since Swift 5.0. These accessors allow copies to be avoided when changing and viewing a...

on Oct 26

From swift.org

Swift-Foundation 2024 Annual Update

0 1

Hi everyone, I'd like to share the first-ever yearly update from Swift-Foundation workgroup. Let's review what we've accomplished in the last year and look to what's next. Year in review This was a big year for the open source Swift-Foundation package! As we announced earlier,...

on Oct 25

From swift.org

SE-0450: Package traits

0 0

Hello Swift community, The review of SE-0450: Package traits begins now and runs through November 7th, 2024. Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to...

on Oct 25

From swift.org

Hummingbird 2

0 0

We're really pleased to announce the release of version 2 of Hummingbird. This is a complete rebuild of the server framework, built on top of structured concurrency. This makes the code easy to read, maintain and reason about and this transfers to the backends built with it. The framework...

on Oct 25

From swift.org

Swift @ FOSDEM?

0 0

I'm happy to report that this year, our request was accepted šŸŽ‰ We'll have a half-day devroom on Saturday February 1, in the afternoon. The CfP should open soon (we're waiting for instructions), and will only be open for a few weeks, so start preparing your proposals šŸ˜ƒ We would like to use...

on Oct 24

From swift.org

Best practices for long term dependency access

0 0

I donā€™t disagree with the suggestions but Iā€™m also surprised this is what people recommends. Isnā€™t it just simpler to let the tool that promises to manage your dependencies let you define the checkout directory? This has worked flawlessly for cocoapods for many years, solves a real problem and...

on Oct 19

From swift.org

Vector, a fixed-size array

0 0

Just to add to this - you can already avoid array copies by using borrow parameters to suppress implicit copying. Unfortunately, lots of operations require copies when they really shouldn't (like for loops): // Why do I have to copy an Array to iterate over its contents? func foo(_ input:...

on Oct 19

From swift.org

Swift 5.10 Concurrency and XCTest

0 0

@jonreid In addition turning on the upcoming feature for "global actor usability" will allow you to make a subclass of XCTestCase a @MainActor. The only thing I don't understand is, if you then try to access a property on your subclass from within the async throws version of setUp it requires...

on Oct 17

From swift.org

Vector, a fixed-size array

0 0

Hi Evolution, with the recent pitch for Integer Generics, we finally have a way to express counts, capacities, and more for types. The most natural extension from that pitch in my opinion is finally letting Swift have fixed-size arrays. Here is my pitch for such a construct for the standard...

on Oct 10

From swift.org

Signal safe Swift concurrency

0 0

Hi, I've been learning more about Swift concurrency and it's great to see all the ways it can help avoid typical race conditions. One kind of race condition that I run into a lot is related to reentrancy and signal handling. Definitely not a "typical" race conditions, but I have some projects...

on Oct 9

From swift.org

Region isolation of array elements

0 0

Hello! I have another question about concurrency isolation checks that I would like to clarify. Given a non-isolated type as follows: class File { func read() -> String { "" } } That is part of an old library not ported yet to Swift 6. So it's used in our codebase with a @preconcurrency...

on Oct 9

From swift.org

Passing values to an Task/Actor in serial manner

0 0

Hi, I have a really simple code, which send some values from synchronous func to async func. Values received in async func are not in order. func sendValues() { for i in 0..<1000 { Task { await count(i) } } } func count(_...

on Oct 6

From swift.org

Preventing regressions when conforming to `Sendable` with `@unchecked`

0 0

Hi @josephduffy, unfortunately writing a truly concurrency safe class is a bit harder than just locking each property. The class you have shared is "safe" to use from multiple threads in that it won't lead to data corruption, but it is not safe in the sense that it is free from race conditions....

on Oct 5

From swift.org

[Pitch] Controlling the ABI of a declaration

0 0

I've written up an early draft proposal for a new @abi attribute. This idea originated as a way to make subtler changes than @preconcurrency allows, but it looks like it will be a very flexible tool. It's sort of like a safer, more ergonomic version of @_silgen_name that's compatible with a...

on Oct 3

From swift.org

[Prospective vision] Optional Strict Memory Safety for Swift

0 0

Hello Swift Community, The Language Steering Group would like to gather feedback on a prospective vision for optional strict memory safety for Swift. Vision documents help describe an overall direction for Swift. The actual Swift changes for executing on the vision will come as a series of...

on Oct 2

From swift.org

[Pitch] Custom Test Execution Traits

0 0

Hi everyone, One of the primary motivations for the trait system in Swift Testing, as described in its vision document, is to provide a way to customize the behavior of tests which have things in common. If all the tests in a given suite type need the same custom behavior, init and/or deinit...

on Oct 1

From swift.org

How would you test an arbitrary value for ā€œboolnessā€?

0 0

How would you write this? SomeValueProtocol is a protocol that covers Bool, all Swift integer types, as well as non-related types. I would like to do something like this, but I am having trouble with the integer part. func boolValue(_ someValue: SomeValueProtocol) -> Bool? { if let value =...

on Sep 30

From swift.org

GRDB 7 beta

0 0

Hello, I'm pleased to announce a new release of the Swift toolkit for SQLite databases. GRDB 7.0.0-beta is Xcode 16 and Swift 6 ready! To upgrade, please follow the migration guide. Raising the Swift concurrency checkings of Swift 6 can create compiler warnings. The new Swift Concurrency and...

on Sep 29