Get the latest tech news

Fear Not the Association of Types


— Gavin Gray Rough data hit my eyes recently and the takeaway was unsurprising: Rust associated types are misunderstood. In Chapter 17 of the Rust Book Experiment Will Crichton decided to inject questions on API design.

I’ve been knee-deep in Rust traits recently and feel I have enough energy to chan­nel some pas­sion into a post on asso­ci­ated types. The real rea­son is that Rust’s type sys­tem affects how the code runs in a deeper way than Java’s. All of these indi­vid­ual pieces of Rust’s type machin­ery are in place so that the com­piler can replace calls like into_iter and fmt with spe­cific func­tion addresses.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of types

types

Photo of association

association

Related news:

News photo

Types as Interfaces

News photo

Atash Behram – Types of Fire

News photo

Show HN: Sum (algebraic) types for C in one 100 line header