SlideShare a Scribd company logo
1 of 23
Download to read offline
Welcome to New SWIFT
Library Evolution and LSP Support
G Abhisek



What are we going to discuss
• ABI Stability

• Module Stability

• Library Evolution Support

• LSP Support
How does a SWIFT file compile
Swift Source
Code
Assembly
Language
AST SIL
IR
Parse Sema Clang
Importer
SIL
Generation
Optimisations and
Analysis
IR Gen
What does an Assembly Language contain
• Opcodes

• Data layout

• Type metadata

• Functions respect calling conventions
SWIFT source
code
Standard
Library Core
SWIFT Runtime
SDK Overlays
SWIFT Standard Library
What was happening earlier to SWIFT 5.0
App executable


SWIFT standard library
App Size
Why was this happening?
Application Binary Interface(ABI)
• An interface that defines rules that
compilers and linkers adhere to in
order to compile your program
and execute properly

• Interface for app to use external
library at OS at binary level

• Specifies the calling conventions
that the libraries should respect to

• Specifies the in memory layout of
data types, classes, structs, etc
Binary 1 Binary 2
When a language becomes ABI stable
• The function interfaces shall not
change i.e the order of arguments,
return types, etc

• Interface for a library should be
forward compatible for future versions
of the compiler

• Stable definition of data type and data
structures

• Data structures should have a definite
data layout

• Application built with a specific swift
version will be compatible with
different Swift versions
5.0
6.x
5.0
Swift ABI components
• Types(structs and classes) must have a defined in-memory layout for instances

• Type metadata must either have a defined memory layout, or have a set of
defined APIs for querying the metadata of a type

• Exported libraries need to have unique names which binaries should agree
and this achieved via name mangling.

• Calling conventions should be respected by every exposed functions of
external libraries

• Runtime API should be stable

• Swift standard library should expose stable APIs
Data Layout of Types
• Specifies layout of objects of given type

• Size, Offset and Alignment of an object in memory

• Static and Opaque Layout

• Eg - Non final Class Instances(Opaque) and Struct
layout(Static) in memory
Type Metadata
• Contains information about the data itself

• ABI is how to access this information

• To stabilise metadata need to provide metadata read/write
functions alongside the runtime to interact with the
metadata

• Eg. Function Metadata, Class Metadata(V tables)
Name Mangling
• Used to produce unique names of functions, properties,
types, etc

• ABI stability means a stable mangling scheme

• Introduction of Compact Manglings
Calling Convention
• Implementation of how subroutines receive parameters
from their caller

• Says how are parameters, return values and return
addresses placed on register

• Order of argument passing

• What metadata of arguments represents
Module Stability
• Deals with linking libraries at compile
time

• Swift module file - Binary equivalent of C
or Obj C header file

• Swift module is tied to current compiler
version

• Interface for a Swift 5 framework will
work with >Swift 5 compiler

• Includes API declaration and inlinable
code

• Swift Interface - Generated by Xcode if -
enable-library-evolution flag is enabled
7.x
6.x
6.x
Library Evolution Support
• Shipping a new library without
having to recompile its clients

• Giving library authors the
flexibility to add to their public
interface and to change the
implementation details

• Eg of language features
enabling these - @frozen
enums and structs
6.x
7.x
Language Server Protocol(LSP)
What problem LSP aims to resolve
• Editors supported compatibility for
fewer languages

• Integration code of specific
languages are written down in IDEs

• Implementation are different across
different languages and IDEs

• Performance of language varies
from one IDE to another
Language Server Protocol(LSP)
How LSP would help?
• No need to implement support for
each language

• Provides common set of
functionality for supported
languages

• Provides language specific smarts
inside a server that can
communicate with development
tool

• Provide support for feature such as
autocompletion, go-to definition,
etc
Language Server Protocol(LSP)
How LSP works?
How are these gonna help
• Make language changes more stable

• Make build times faster with the help of module stability

• Swift can readily be used for cross platform development

• With LSP, Swift can be written on different IDEs
References
• https://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md

• https://github.com/apple/swift/blob/master/docs/CallingConvention.rst#high-
level-semantic-conventions

• https://en.wikipedia.org/wiki/Calling_convention

• https://nshipster.com/language-server-protocol/

• https://swift.org/blog/abi-stability-and-more/

• https://www.youtube.com/watch?v=a5-WaD8VV38

• https://blog.gopheracademy.com/advent-2018/llvm-ir-and-go/

• https://forums.swift.org/t/plan-for-module-stability/14551/5
Thanks

More Related Content

What's hot

Using the Java Client Library by Noah Crowley, DevRel | InfluxData
Using the Java Client Library by Noah Crowley, DevRel | InfluxDataUsing the Java Client Library by Noah Crowley, DevRel | InfluxData
Using the Java Client Library by Noah Crowley, DevRel | InfluxDataInfluxData
 
Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureBoldRadius Solutions
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core DemosErik Noren
 
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Scala & Spark Online Training
Scala & Spark Online TrainingScala & Spark Online Training
Scala & Spark Online TrainingLearntek1
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2Erik Noren
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed CodeMicro Focus
 
Grizzly summit: Quantum API
Grizzly summit: Quantum APIGrizzly summit: Quantum API
Grizzly summit: Quantum APIsalv_orlando
 
Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadAmanda Folson
 
Apache Cayenne: a Java ORM Alternative
Apache Cayenne: a Java ORM AlternativeApache Cayenne: a Java ORM Alternative
Apache Cayenne: a Java ORM AlternativeAndrus Adamchik
 
Localizing kibana for the global language landscape
Localizing kibana for the global language landscapeLocalizing kibana for the global language landscape
Localizing kibana for the global language landscapeShikha Srivastava
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Arnaud Bouchez
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedbackJeff Squyres
 
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Peer council 2013_presentation
Peer council 2013_presentationPeer council 2013_presentation
Peer council 2013_presentationWiLS
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel ZikmundKarel Zikmund
 

What's hot (20)

Using the Java Client Library by Noah Crowley, DevRel | InfluxData
Using the Java Client Library by Noah Crowley, DevRel | InfluxDataUsing the Java Client Library by Noah Crowley, DevRel | InfluxData
Using the Java Client Library by Noah Crowley, DevRel | InfluxData
 
Domain Driven Design Through Onion Architecture
Domain Driven Design Through Onion ArchitectureDomain Driven Design Through Onion Architecture
Domain Driven Design Through Onion Architecture
 
ASP.NET Core Demos
ASP.NET Core DemosASP.NET Core Demos
ASP.NET Core Demos
 
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Scala & Spark Online Training
Scala & Spark Online TrainingScala & Spark Online Training
Scala & Spark Online Training
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed Code
 
Grizzly summit: Quantum API
Grizzly summit: Quantum APIGrizzly summit: Quantum API
Grizzly summit: Quantum API
 
Your API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel BadYour API is Bad and You Should Feel Bad
Your API is Bad and You Should Feel Bad
 
Apache Cayenne: a Java ORM Alternative
Apache Cayenne: a Java ORM AlternativeApache Cayenne: a Java ORM Alternative
Apache Cayenne: a Java ORM Alternative
 
Understanding linport
Understanding linportUnderstanding linport
Understanding linport
 
OASIS OAXAL Presentation
OASIS OAXAL PresentationOASIS OAXAL Presentation
OASIS OAXAL Presentation
 
Localizing kibana for the global language landscape
Localizing kibana for the global language landscapeLocalizing kibana for the global language landscape
Localizing kibana for the global language landscape
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
Ekon20 mORMot Legacy Code Technical Debt Delphi Conference
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback
 
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Peer council 2013_presentation
Peer council 2013_presentationPeer council 2013_presentation
Peer council 2013_presentation
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
 

Similar to Welcome to New Swift: Library Evolution & LSP Support

What will be new in Apache NiFi 1.2.0
What will be new in Apache NiFi 1.2.0What will be new in Apache NiFi 1.2.0
What will be new in Apache NiFi 1.2.0Koji Kawamura
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update referencesandeepji_choudhary
 
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...InfluxData
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)Alexander Goida
 
OSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical UpdateOSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical Updatemfrancis
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler ConstructionAhmed Raza
 
Ballerina- A programming language for the networked world
Ballerina- A programming language for the networked worldBallerina- A programming language for the networked world
Ballerina- A programming language for the networked worldIntegration Meetups
 
Ballerina- A programming language for the networked world
Ballerina- A programming language for the networked worldBallerina- A programming language for the networked world
Ballerina- A programming language for the networked worldAsangi Jasenthuliyana
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CAaron Taylor
 
Skillwise Elementary Java Programming
Skillwise Elementary Java ProgrammingSkillwise Elementary Java Programming
Skillwise Elementary Java ProgrammingSkillwise Group
 
RAPID - Building a highly usable API Design language with XText
RAPID - Building a highly usable API Design language with XTextRAPID - Building a highly usable API Design language with XText
RAPID - Building a highly usable API Design language with XTextTed Epstein
 
RepreZen DSL: Pushing the limits of language usability with XText
RepreZen DSL: Pushing the limits of language usability with XTextRepreZen DSL: Pushing the limits of language usability with XText
RepreZen DSL: Pushing the limits of language usability with XTextTatiana Tanya Fesenko
 
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...HostedbyConfluent
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabadrevanthonline
 
Stop Building It From Scratch: Creating Reusable eLearning Components
Stop Building It From Scratch: Creating Reusable eLearning ComponentsStop Building It From Scratch: Creating Reusable eLearning Components
Stop Building It From Scratch: Creating Reusable eLearning ComponentsChad Udell
 

Similar to Welcome to New Swift: Library Evolution & LSP Support (20)

What will be new in Apache NiFi 1.2.0
What will be new in Apache NiFi 1.2.0What will be new in Apache NiFi 1.2.0
What will be new in Apache NiFi 1.2.0
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
 
Babel.pptx
Babel.pptxBabel.pptx
Babel.pptx
 
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...
2.0 Client Libraries & Using the Java Client by Noah Crowley, Developer Advoc...
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)
 
OSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical UpdateOSGi Community Event 2010 - OSGi Technical Update
OSGi Community Event 2010 - OSGi Technical Update
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Ballerina- A programming language for the networked world
Ballerina- A programming language for the networked worldBallerina- A programming language for the networked world
Ballerina- A programming language for the networked world
 
Ballerina- A programming language for the networked world
Ballerina- A programming language for the networked worldBallerina- A programming language for the networked world
Ballerina- A programming language for the networked world
 
Hibernate
HibernateHibernate
Hibernate
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-C
 
.Net Standard 2.0
.Net Standard 2.0.Net Standard 2.0
.Net Standard 2.0
 
Skillwise Elementary Java Programming
Skillwise Elementary Java ProgrammingSkillwise Elementary Java Programming
Skillwise Elementary Java Programming
 
RAPID - Building a highly usable API Design language with XText
RAPID - Building a highly usable API Design language with XTextRAPID - Building a highly usable API Design language with XText
RAPID - Building a highly usable API Design language with XText
 
RepreZen DSL: Pushing the limits of language usability with XText
RepreZen DSL: Pushing the limits of language usability with XTextRepreZen DSL: Pushing the limits of language usability with XText
RepreZen DSL: Pushing the limits of language usability with XText
 
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
 
Stop Building It From Scratch: Creating Reusable eLearning Components
Stop Building It From Scratch: Creating Reusable eLearning ComponentsStop Building It From Scratch: Creating Reusable eLearning Components
Stop Building It From Scratch: Creating Reusable eLearning Components
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Welcome to New Swift: Library Evolution & LSP Support

  • 1. Welcome to New SWIFT Library Evolution and LSP Support G Abhisek
 

  • 2. What are we going to discuss • ABI Stability • Module Stability • Library Evolution Support • LSP Support
  • 3.
  • 4. How does a SWIFT file compile Swift Source Code Assembly Language AST SIL IR Parse Sema Clang Importer SIL Generation Optimisations and Analysis IR Gen
  • 5. What does an Assembly Language contain • Opcodes • Data layout • Type metadata • Functions respect calling conventions
  • 6. SWIFT source code Standard Library Core SWIFT Runtime SDK Overlays SWIFT Standard Library
  • 7. What was happening earlier to SWIFT 5.0 App executable 
 SWIFT standard library App Size
  • 8. Why was this happening?
  • 9. Application Binary Interface(ABI) • An interface that defines rules that compilers and linkers adhere to in order to compile your program and execute properly • Interface for app to use external library at OS at binary level • Specifies the calling conventions that the libraries should respect to • Specifies the in memory layout of data types, classes, structs, etc Binary 1 Binary 2
  • 10. When a language becomes ABI stable • The function interfaces shall not change i.e the order of arguments, return types, etc • Interface for a library should be forward compatible for future versions of the compiler • Stable definition of data type and data structures • Data structures should have a definite data layout • Application built with a specific swift version will be compatible with different Swift versions 5.0 6.x 5.0
  • 11. Swift ABI components • Types(structs and classes) must have a defined in-memory layout for instances • Type metadata must either have a defined memory layout, or have a set of defined APIs for querying the metadata of a type • Exported libraries need to have unique names which binaries should agree and this achieved via name mangling. • Calling conventions should be respected by every exposed functions of external libraries • Runtime API should be stable • Swift standard library should expose stable APIs
  • 12. Data Layout of Types • Specifies layout of objects of given type • Size, Offset and Alignment of an object in memory • Static and Opaque Layout • Eg - Non final Class Instances(Opaque) and Struct layout(Static) in memory
  • 13. Type Metadata • Contains information about the data itself • ABI is how to access this information • To stabilise metadata need to provide metadata read/write functions alongside the runtime to interact with the metadata • Eg. Function Metadata, Class Metadata(V tables)
  • 14. Name Mangling • Used to produce unique names of functions, properties, types, etc • ABI stability means a stable mangling scheme • Introduction of Compact Manglings
  • 15. Calling Convention • Implementation of how subroutines receive parameters from their caller • Says how are parameters, return values and return addresses placed on register • Order of argument passing • What metadata of arguments represents
  • 16. Module Stability • Deals with linking libraries at compile time • Swift module file - Binary equivalent of C or Obj C header file • Swift module is tied to current compiler version • Interface for a Swift 5 framework will work with >Swift 5 compiler • Includes API declaration and inlinable code • Swift Interface - Generated by Xcode if - enable-library-evolution flag is enabled 7.x 6.x 6.x
  • 17. Library Evolution Support • Shipping a new library without having to recompile its clients • Giving library authors the flexibility to add to their public interface and to change the implementation details • Eg of language features enabling these - @frozen enums and structs 6.x 7.x
  • 18. Language Server Protocol(LSP) What problem LSP aims to resolve • Editors supported compatibility for fewer languages • Integration code of specific languages are written down in IDEs • Implementation are different across different languages and IDEs • Performance of language varies from one IDE to another
  • 19. Language Server Protocol(LSP) How LSP would help? • No need to implement support for each language • Provides common set of functionality for supported languages • Provides language specific smarts inside a server that can communicate with development tool • Provide support for feature such as autocompletion, go-to definition, etc
  • 21. How are these gonna help • Make language changes more stable • Make build times faster with the help of module stability • Swift can readily be used for cross platform development • With LSP, Swift can be written on different IDEs
  • 22. References • https://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md • https://github.com/apple/swift/blob/master/docs/CallingConvention.rst#high- level-semantic-conventions • https://en.wikipedia.org/wiki/Calling_convention • https://nshipster.com/language-server-protocol/ • https://swift.org/blog/abi-stability-and-more/ • https://www.youtube.com/watch?v=a5-WaD8VV38 • https://blog.gopheracademy.com/advent-2018/llvm-ir-and-go/ • https://forums.swift.org/t/plan-for-module-stability/14551/5