News for hackers. Stuff that matters.
Re:Python 3 Q&A by a prolific core developer by qznc on Friday June 29, 2012 @04:26AM (#4175765)
I agree that static typing would helps for such bugs.

However, not "in general". The general problem is that bogus data leads to an irreparable situation. To fix that bug, you have to find out who broke the data. Consider for example, a circle in a linked list. You would need quite an expressive type system to prevent that statically (dependent types might suffice? Theorem provers are the ultimate hammer).

Re:Python 3 Q&A by a prolific core developer by DannoHung on Friday June 29, 2012 @05:08AM (#4175847)
Uhh, how would you make a linked list with a circle in it with the Haskell List type?
Re:Python 3 Q&A by a prolific core developer by dbaupp on Friday June 29, 2012 @05:31AM (#4175895)

  a = 1:a
Re:Python 3 Q&A by a prolific core developer by ufo on Friday June 29, 2012 @09:29AM (#4176491)
This trick is often called "Tying the Knot", if anyone is interested.
Re:Python 3 Q&A by a prolific core developer by qznc on Friday June 29, 2012 @05:33AM (#4175897)

  makeCircle rst = rst ++ makeCircle rst
The thing is that a circular list is actually an infinite list in Haskell. ;)
Re:Python 3 Q&A by a prolific core developer by DannoHung on Friday June 29, 2012 @11:27AM (#4177077)
If you want to prevent that then you want to take general recursion out of your programming language and if you're gonna do that you might as well make it Turing incomplete.

These aren't "circles" per se, they are partially evaluated recursive structures. If you expand them you end up with evaluated list structures that are non-self referential.

Re:Python 3 Q&A by a prolific core developer by ufo on Friday June 29, 2012 @09:31AM (#4176494)
This is not a real circular list though, since it does not tie the knot as in dbaupp's comment.
Re:Python 3 Q&A by a prolific core developer by zanny on Friday June 29, 2012 @04:43AM (#4175807)
Different implementations for different use cases in different situations :P