4 ms·
Happy to see that my collection of Swift compiler crashes (see https://github.com/practicalswift/swift-compiler-crashes https://github.com/practicalswift/swift-
by practicalswift 11y ago
Happy to see that my collection of Swift compiler crashes (see https://github.com/practicalswift/swift-compiler-crashes https://github.com/practicalswift/swift-compiler-crashes) has been part of the official Swift repo since September 2014: https://github.com/apple/swift/commit/e5ca8be1a090335d401cd1d7dfcf9b2104674d5b https://github.com/apple/swift/commit/e5ca8be1a090335d401cd1... :-)
A previous HN thread about the swift-compiler-crashes project: https://news.ycombinator.com/item?id=9020206 https://news.ycombinator.com/item?id=9020206
- Arjuna 11y agoWow, congratulations, that's really cool! Speaking of errors, I remember receiving the "Expression was too complex to be solved in reasonable time" error when I was first implementing Catmull-Rom splines for calculating flight paths in a game that I developed. I translated that to, "The math is making the room spin up in here." Definitely the "coolest" error I've hit working with Swift.
- pa5tabear 11y agoI recognized the name Catmull from Steve Jobs biographies... lo and behold you're talking about the Pixar President Edwin Catmull.
- Arjuna 11y agoIndeed; that's him! Edwin Catmull [1], along with Raphael Rom [2], created the Catmull-Rom spline. It was perfect for the Galaga-like level in my game. I only need to define a few control points to create a robust flight path for the enemy drones. The cool thing about the Catmull-Rom algorithm is that the spline passes through the control points. [1] https://en.wikipedia.org/wiki/Edwin_Catmull https://en.wikipedia.org/wiki/Edwin_Catmull [2] https://en.wikipedia.org/wiki/Raphael_Rom https://en.wikipedia.org/wiki/Raphael_Rom
- copperx 11y agoCurious -- were you implementing the drawing algorithm by scratch? or were you using any libraries?
- Arjuna 11y agoThanks for asking... I used Apple's SpriteKit framework [1][2]. It's essentially a 2D graphics rendering framework that primarily acts as an abstraction layer for OpenGL ES. In addition, it also offers several other "nice-to-have" features with regard to 2D game development (e.g., collision detection, particles, physics, etc.) Of course, you could do all of the above without SpriteKit. For example, for all of the rendering, you would simply write everything directly in OpenGL ES. There are also cross-platform options, like Cocos2d-x [3] and Marmalade [4]. Finally, if you've read this far, you might be interested in reading my general thoughts and feelings from when I finished the game [5]. Cheers! [1] https://developer.apple.com/spritekit https://developer.apple.com/spritekit [2] http://www.raywenderlich.com/category/sprite-kit http://www.raywenderlich.com/category/sprite-kit [3] http://www.cocos2d-x.org http://www.cocos2d-x.org [4] https://www.madewithmarmalade.com https://www.madewithmarmalade.com [5] https://news.ycombinator.com/item?id=8888107 https://news.ycombinator.com/item?id=8888107
- cballard 11y agoWhen that happens, try adding type signatures to any closures that are currently using inferred types. It often fixes it.
- practicalswift 11y agoI'm really impressed by the attentiveness of the Swift compiler team. Found this in the repo: https://github.com/apple/swift/commit/666646fee95bc75ca81e1dc5131989d56bfb0742 https://github.com/apple/swift/commit/666646fee95bc75ca81e1d... One tweet and the bug is fixed within a couple of hours. Wow! Found that issue while working on the Pythonic.swift project: https://github.com/practicalswift/Pythonic.swift https://github.com/practicalswift/Pythonic.swift (btw, contributors welcome! Know Python? If so, a very good way to jump into Swift programming is by contributing to Pythonic.swift: a Swift implementation of selected parts of Python standard library)