News for hackers. Stuff that matters.
Re:Swift for TensorFlow Shuts Down by kortex on Saturday February 13, 2021 @09:41AM (#26123829)
> They're glorified comments

This was always kinda false (type hints can be composed unlike eg docstring param @type). But with the introduction of dataclass, this is empirically false. You can readily hook into the type hints, reflect on them, use it to marshal data, etc. Using __post_init__, you can leverage any kind of runtime checks you want to enforce invariants.

Also type hints greatly help transpilation.

You don't need 100% to reap the benefits. In fact I will annotate small bits of un-typed code and it makes it way easier to reason about.

There are no comments on this comment yet.