[swift-users] Data reflection metadata?

Joe Groff jgroff at apple.com
Thu Oct 13 12:46:30 CDT 2016


> On Oct 13, 2016, at 9:19 AM, Austin Zheng via swift-users <swift-users at swift.org> wrote:
> 
> You probably want to check out this repo: https://github.com/Zewo/Reflection
> 
> It's clever stuff. Really, really reliant on implementation details of the runtime to function, so I'd be loathe to use it in any sort of production application, but as a proof of concept it shines.

>From what I've seen, they're groveling our runtime metadata records, which are definitely subject to change without notice. I wouldn't recommend following their example, since we actively want to change the layout of things they're hardcoding. What Chris was referring to was the "remote mirror" library, which is used to support the Xcode 8 memory debugger, and is also in the long-term what we want to migrate in-process reflection facilities like the Mirror type to. The `swift-reflection-test` and `swift-reflection-dump` tools in the Swift compiler codebase might help give you a sense of what's currently available:

https://github.com/apple/swift/blob/master/tools/swift-reflection-test
https://github.com/apple/swift/tree/master/tools/swift-reflection-dump

-Joe


More information about the swift-users mailing list