Category Archives: Sideblog

Sideblog posts. Usually links to news stories with a quick comment by me.

Error Handling in Swift

Better error handling in Swift. (HT: Brent Simmons indirectly) Very cool. Even better than returning tuples as in Python.

Related Posts

  • 49
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still very beta. Most of the…
    Tags: swift, python

Euler

Euler — custom math operators using unicode operators. (HT: ManiacDev) I think some go a bit much. Why on earth use × instead of * for multiplication? Why not save × for cross product of vectors? But the logic and set notation is very elegant. I like the dot product operator but suspect it’d be hard to read since it looks so much like a period. I also like the ± operator which returns a tuple with the range just like you’d expect from science. Again this is the sort of thing you use for inspiration but wouldn’t want to use the whole thing.

Swift Speed Revisted

Swift speed revisited. Surprised it’s improved that much, although I think some of the initial problem was a naive ARC optimizer that has been fixed. (i.e. retain release code where it didn’t need to be)

Related Posts

  • 42
    I’d mentioned in passing in one of my Swift posts about using it as a scripting language. Someone on Twitter asked me if I’d convert from using Python to Swift for my scripts. It’s an excellent question that I really can’t answer fully at this stage. The language is still very beta. Most of the…
    Tags: swift, code