~/talk

Concepts vs Typeclasses vs Traits vs Protocols

Talkat Meeting C++ 2020 · 2020-11-12..11-14· [typescript]
slides:none on file

Compares C++ concepts, Haskell type classes, Rust traits, Swift protocols and D type constraints by actually implementing two exercises: a generic add and a shapes example (circle and rectangle) across five compilers, showing which code compiles as-is and which needs bounds. Demonstrates type constraints vs type classes, notes C++ and D accept unconstrained generics while Rust/Swift/Haskell require explicit bounds, shows C++ needed a custom string concept, reports Swift is fastest to implement and Rust compiler gives precise fix suggestions, and measures LOC and implementation time.

AI-written summary · about

  1. 0:00Start
  2. 5:05Agenda
  3. 5:34Introduction
  4. 5:53Introduction to Functional Programming
  5. 6:47Protocol-Oriented Programming in Swift
  6. 10:06What Are the Similarities and Differences between C plus Plus and Swift
  7. 16:12Generics and Parametric Polymorphism
  8. 16:28Ad Hoc Polymorphism
  9. 17:02Parametric Polymorphism
  10. 24:07Swift
  11. 24:45Haskell
  12. 26:18Trailing Return Type
  13. 28:17Generic Functions
  14. 32:00Type Constraints versus Type Classes
  15. 32:14Type Constraints
  16. 35:11Constrained Generics
  17. 37:26Shapes
  18. 39:34Rust Example
  19. 40:35Swift Example
  20. 44:19Compiler Messages
  21. 44:53Swift Print Shape Info
  22. 47:22Write a Type Constraint
  23. 49:02Rust
  24. 51:02Haskell Example
  25. 53:06Conclusions
  26. 54:19Lines of Code
  27. 54:56Pleasantness
  28. 55:33Progressive Disclosure of Complexity
  29. 58:56Language Rankings
  30. 59:55Final Thoughts
~/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.