~/talk

C++ Concepts vs Rust Traits vs Haskell Typeclasses vs Swift Protocols

slides:none on file

Compares C++20 Concepts, Rust Traits, Haskell Typeclasses, Swift Protocols and D type constraints by implementing two concrete examples: a generic add and a shapes example (circle/rectangle). Discovers two semantic categories: type-constraint model (C++, D) where unconstrained generics already compile, and type-class consent (Rust, Swift, Haskell) where traits/protocols/typeclasses must be added; only C++ and D compile the naive generic add. Measures: implementation speed Swift > D > Rust > Haskell > C++; LOC: Haskell 25 (fewest) … C++ (most). Notes Rust compiler gives exceptionally actionable errors and fixes.

AI-written summary · about

  1. 0:00Start
  2. 24:10Ad Hoc vs Parametric Polymorphism
  3. 31:42Example #1 Adding Two Integers
  4. 44:25Type Constraints
  5. 53:37Example #2 Shapes: Circle & Rectangle
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.