WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
211270
WebKit Swift Overlay
https://bugs.webkit.org/show_bug.cgi?id=211270
Summary
WebKit Swift Overlay
James Savage
Reported
2020-04-30 18:26:01 PDT
Create Swift overlay for WebKit framework. <
rdar://problem/60549174
>
Attachments
Patch
(52.49 KB, patch)
2020-04-30 18:56 PDT
,
James Savage
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
James Savage
Comment 1
2020-04-30 18:56:53 PDT
Created
attachment 398136
[details]
Patch
Darin Adler
Comment 2
2020-05-10 15:46:50 PDT
Comment on
attachment 398136
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=398136&action=review
> Source/WebKit/ChangeLog:3 > + Create Swift overlay for WebKit framework
This change log says a lot, but it doesn’t way why we are doing this!
James Savage
Comment 3
2020-05-22 10:20:49 PDT
Comment on
attachment 398136
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=398136&action=review
>> Source/WebKit/ChangeLog:3 >> + Create Swift overlay for WebKit framework > > This change log says a lot, but it doesn’t way why we are doing this!
Such as why do a Swift overlay at all? I thought I explained that with my explanation of individual changes, but to step back this is about providing APIs that use Swift-native idioms that cannot be expressed in Objective-C. For example, Swift can have optional scalar types like Optional<CGRect>, where in Objective-C a similar concept is CGRectNull. The former provides compile-type type correctness while the latter is just a magic value. Result<T, Error> is the async equivalent of a throwing function, and enforces mutual exclusion for functions that return either a value or an error. Without it, using the direct Objective-C import of (T?, Error?) you end up with four possible states, two of which are invalid (ex: (nil, nil) and (T(), Error())). Without getting in to future plans, we could do a lot more with this too. I'm really proposing some light polish with these changes.
EWS
Comment 4
2020-05-22 17:52:04 PDT
Committed
r262089
: <
https://trac.webkit.org/changeset/262089
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 398136
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug