[swift-users] Bls: module (de)-initialization
pak.lebah at yahoo.com
Wed Dec 21 21:11:17 CST 2016
> Unloading Swift modules will likely never be supported, since this would impose a ton of complexity and performance cost on the runtime for little benefit.
Hmmm… so Swift will only support static linking? I thought Swift is a modern programming language with modern and advance features. Even Pascal/Delphi has had those features since ages ago.
Pada Kamis, 22 Desember 2016 1:06, Joe Groff via swift-users <swift-users at swift.org> menulis:
> On Dec 20, 2016, at 8:54 AM, Jens Alfke via swift-users <swift-users at swift.org> wrote:
> Also, AFAIK there is no mechanism in Swift (yet) to load or unload a module at runtime, so a module load occurs when the program starts up, and an unload occurs when the program exits.
dlopen works fine, though the only supported ways of getting a callable symbol out of the loaded image are currently to use a C entry point or look up a type defined in the module by name. Unloading Swift modules will likely never be supported, since this would impose a ton of complexity and performance cost on the runtime for little benefit. (Apple's ObjC runtime does not support unloading dylibs after classes inside them have been reified either.)
swift-users mailing list
swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users