News for hackers. Stuff that matters.
Re:The Case for Message Passing in Swift by pohl on Friday June 27, 2014 @12:05PM (#7954646)
Along that line of thought, it looks like there are beginnings of a mirror-based reflection implementation already in there. It appears to only be there for Playground at the moment.

http://stackoverflow.com/questions/24060667/does-swift-suppo...

Re:The Case for Message Passing in Swift by pstop on Friday June 27, 2014 @12:38PM (#7954858)
Yea, I noticed this in the undocumented API's, but haven't played much with it. It's definitely cleaner than C#'s reflection implementation, but more limited as well. Though for most uses, knowing the limitations solves most of the issues the OP has.
Re:The Case for Message Passing in Swift by astigsen on Friday June 27, 2014 @12:44PM (#7954894)
This presentation covers some of the reflection API in Swift: http://www.realm.io/news/swift-unchartered-territory-swift-i...

While it is clearly still somewhat limited, it does seem like there is potential for it to evolve into a really robust reflection API.

Re:The Case for Message Passing in Swift by Glide on Friday June 27, 2014 @02:46PM (#7955622)
I disagree. Right now it doesn't seem like a lot of things aren't possible in swift unless there is a LOT of undocumented API.

Dynamic method compilation that you would need to make an equivalent of DynamicProxy just doesn't seem possible. What's funny is that the #1 thing I would state is not possible in Swift is Core Data.

Re:The Case for Message Passing in Swift by bigdubs on Friday June 27, 2014 @02:35PM (#7955552)
I am not sure how clean the reflect() function is in swift right now as it stands.

reflect(User()) requires me to new up an instance of the object to reflect. This is a static(ish) language right? Why do I need to reflect a specific instance?

In c# you just go typeof(User).GetProperties|GetMethods|GetFields etc. You don't need to new up an object, all the required information is stored as metadata for the type after compilation.

I understand in a universe where you can dynamically add methods/fields/properties etc. to a type you'd want the specific instance at runtime to reflect, but as far as I know Swift does away with this dynamism on purpose.

Re:The Case for Message Passing in Swift by josephlord on Friday June 27, 2014 @12:47PM (#7954908)
Thanks looks interesting. I do suspect that it will stay playground only because for compiled code the data may not exist to work out the types of some values.