John McCall, an engineer on Apple’s Swift team and a member of the language working group, introduced Swift’s plans for 2023 in a new blog post.

“There’s a lot of exciting work going on in Swift projects, and it’s hard to keep track of all of it because it’s happening across so many different repositories, pull requests, and forum threads. To give the community a better picture of the big picture, the core team Surveyed working groups and developers across the project and gathered information on what they’re focusing on for the next year.”

community organizationaspect,Swift core teamrecently started restructuring,In order to have more responsibility for a dedicated working group:

According to the introduction, these new working groups join the long-standing Swift on Server and Diversity working groups, so that interested users can join dedicated working groups to make contributions in a more targeted manner. The core team is looking into creating more working groups, including one dedicated to improving the cross-platform usability of Swift.

The members of the core team have also been updated,Mishal Shah Will join the core team. “As a leader and advocate for much of the underlying infrastructure that supports Swift projects, Mishal has been instrumental in supporting the growth of Swift projects for some time.”

language developmentaspect,The Language Working Group focuses on making progress in five main language areas:

  • concurrent.complete pairSendableand actors Provides language support for strict data isolation. Plans include closing many known thread safety holes, such as those around global variables and certain cross-actor calls.it also includesEquipped with some functions to solve the problem caused by strict isolation The resulting usability issues,For example to allow non-Sendable to move between isolated domains under restricted conditions.

  • generic.The language working group intends to work on variadic generics language features. This is a major feature expected to take several years to complete, initially focusing on designing the core language model and implementing the compiler and runtime infrastructure to support it. An early milestone will be to allow tuple types to conditionally conform to protocols such as Equatable if their elements conform to protocols such as Equatable.

  • ownership.

    • Exploitation features give programmers explicit control over the ownership of values ​​in memory.

    • Add basic support for non-copyable types. This will provide new ways to achieve high performance by limiting the lifetime of key values. These controls will enable new ways of working with in-memory data, combining the performance of current “unsafe” constructs with the safety of Swift’s standard library features.

  • macro.Focus onFurther support for creating rich libraries and DSLs.This work will be created from vision document To get started, design for what macros can achieve in Swift and how they fit into the language.

  • C++ interoperability.

    • Write documentation that explains how to make C++ APIs available in Swift and vice versa.

    • Stabilize the current prototype interoperability features in Swift using C++, including owned value types, trivial value types, API schemas (such as external reference types and iterators), and some information about methods, pointers, l-value and r-value references some basic questions.

    • Stabilize the current prototype interoperability features for using Swift from C++, including Swift value types, reference types, and functions exposed to The C++ way.

Additionally, the language working group is planning to finalize expected language revisions for the upcoming Swift 6 language mode. Swift regularly introduces new language modes so that the language can progress without breaking source compatibility of existing code.as well asThe compiler development team is working hard to improve how the compiler interacts with the build system and other invocations of itself.

For Package Registry,Development of the Swift package manager has focused on starting work with the community on an open source package registry server implementation. The goal is to create the technical components needed to transition the Swift package ecosystem from a source control-based ecosystem to a registry-based system, thereby enhancing the security and reliability of the ecosystem. Its plans will work with community-run projects such as the Swift Package Index.

Other Swift efforts in 2023 include:

  • Develop a Swift parser, written in pure Swift, with the functionality of the current C++ implementation. This opens up new directions for tool development that will eventually replace C++ parsers.

  • Improve type checking performance for result builders by migrating the type inference implementation to a more scalable infrastructure that supports multi-statement closure inference.

  • Improve the reliability of code completion and lookup-dependent tools such as Quick Help and Jump to Definition, especially in incomplete or ambiguous code, through tighter integration with the type checker.

  • In some cases, less code is generated when translating functions by eliminating the need for translating thunks, especially when passing closures to generic and imported functions.

  • Generates less code when copying and destroying complex structures and enums by interpreting the compact encoding of the type layout instead of emitting specialized functions.

  • Added SIL optimizer support for new language features and predictable optimizations related to object lifetimes and copies. The team is designing a new set of low-level SIL utilities to maintain ownership invariance throughout the existing optimization pipeline. This results in reliable diagnostics and predictable performance.

  • Rewrite the current interprocedural side-effect and escape analyzes in Swift, replacing the current C++ implementation. The new implementation provides more accurate results and is significantly simpler.

More detailsCan view blog.

#Swift #Emphasis #concurrency #generics #interoperability #developing #Swift #parser #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *