Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have a talk where I turn "you called a function from the wrong thread" into something caught by the type checker in C. Getting an error message at compile time pointing out the specific line with an error, rather than segfaulting at a later point in roughly 2/3 of executions, is a big improvement in developer experience.

Slides here: https://github.com/dlthomas/using-c-types-talk/tree/master/s...

The example is a toy but the technique was developed for (and very successfully used in) a production setting.



"where I turn" This wording really hilights something that I think a lot of dynamic typing proponents don't fully appreciate. Using a type system is a learned skill, not something you magically get for free. You need both a good type system and the experience/education to use it to its fullest. Encoding threading rules in the type system isn't something C ships with out of the box, and it's not something a lot of people would think of, but moving that into the type system rather than relying on unit/manual test is a huge win.


Absolutely. That's pretty much the point of the talk I mentioned (with some hope of helping the audience get better at it). The only thing I disagree with is needing a good type system - "need" is too strong; the C type system isn't good but is enough to be pretty useful if you use it right.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: