[swift-evolution] Pitch: Progress Tracking in Swift
cocoadev at charlessoft.com
cocoadev at charlessoft.com
Mon Jan 18 22:13:21 CST 2016
It's completely platform independent. Notifications would be possible
via closures that are given to the progress object as handlers. Those
closures could do whatever is appropriate for the GUI framework that the
app is using.
Tying progress notifications to GUI frameworks is a bad idea, because it
precludes low-level functions that are independent of the GUI from being
able to report progress effectively.
Charles
On 2016-01-18 22:45, Tim Hawkins wrote:
> How would this work on linux or windows?, on linux there are several
> dozen possible GUI targets, this sounds far more like a standard
> patterm recomendation that GUI binding library authors should provide
> than something that should be a language feature.
> On Jan 19, 2016 11:39 AM, "Charles Srstka via swift-evolution"
> <swift-evolution at swift.org> wrote:
>
>> On 2016-01-18 22:24, FĂ©lix Cloutier wrote:
>>
>>> In terms of which functions need it, I think that reporting
>>> progress
>>> is a relatively niche feature.
>>
>> How is it niche? Very few apps don't have any places where progress
>> tracking (and user cancellation) would be useful, and it's currently
>> something that has to be done with workarounds that are either
>> clunky or unsafe.
>>
>>> I would by far prefer that we work on
>>> infrastructure to implement a library-driven solution. To me, it
>>> would
>>> be a missed opportunity to show off what the language can (will
>>> be
>>> able to) do without having to bake it into the compiler.
>>>
>>> For instance, this could probably be solved without specific
>>> compiler
>>> support if Swift had a macro system and resumable functions.
>>
>> Apple has repeatedly stated in the past that the lack of macros/a
>> preprocessor is supposed to be a feature, not a bug (cf.
>> https://developer.apple.com/swift/blog/?id=4 [1]). I know there have
>> occasionally been some statements on the lists contradicting the
>> official stance, but nonetheless I'm not sure we can count on Swift
>> gaining a macro system. Also, implementing things like this via
>> macros seems a bit... icky to my personal tastes.
>>
>> Are there any plans to add resumable functions to Swift? I know
>> it's been pitched a few times, but it didn't seem to me like it
>> gained much traction.
>>
>>> Also, the first two arguments have merit, but it's highly
>>> improbable
>>> that you'll be able to use whatever solution we come up with in
>>> OSes
>>> older than OS X 10.11 or iOS 9 anyway.
>>
>> All additions to Swift so far have been back-portable to 10.9,
>> given that the runtime gets bundled into the app.
>>
>> Charles
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution [2]
>
>
> Links:
> ------
> [1] https://developer.apple.com/swift/blog/?id=4
> [2] https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list