Swift is an interesting language. I kind of like the syntax. I think it's a little more clear than C++. Xcode seems to be very helpful in pointing out errors, so I've gotten away without making any dumb mistakes. I'm a little unsure about the performance of things like their dynamically scaling Array. I got to a point where the C++ sample in my book was using a obj **ptr, for a list of objects, so I'm substituting a dynamic Array type in Swift instead. Maybe I'll play around with profiling at some point to see how performance between Swift and C++ compares. I think the source code for this book is available online, so I should be able to dig into it. The only major departures in my implementation right now is I'm doing everything with structs instead of classes. Found out I should be able to pass a struct by reference explicitly: func dilly(x: inout megastruct) -> void {}, then call the function as dilly(x: &mystruct), or at least that's how I think it should work.
Tonight I should have the next step working, which is rendering multiple spheres in the scene. After that I'm on to anti-aliasing and then materials. Materials will be a big decision point, because I'll have to choose between an abstract base class with multiple sub-classes for each material, a Swift protocol with structs implementing the protocol, or one big material function with all of the available material parameters. The book uses the abstract base class.
I'm definitely struggling a bit to see how I'd implement this in the data-oriented way. I've been thinking about it as I've gone along, but it's definitely hard not to think in an object-oriented manner, since that was what the professors evangelized to me in school. Maybe I'll go through once, and then see if I can start over in a data-oriented implementation, after fully understanding everything,