Skip to content

Library Design in Wyvern

Jonathan Aldrich edited this page Feb 26, 2019 · 1 revision

General principles

  • Encourage functional programming
  • Support high-performance code
  • Facilitate code that performs well over code that does not
  • Encourage type-safe code
  • Prefer objects to ADTs
  • Prefer composition over inheritance (easy, since Wyvern doesn't yet really support inheritance)
  • Group things together that vary together

Naming conventions

  • CamelCase, starting Upper for types and lower for values (Java-like)
  • Use common names
  • Avoid abbreviations

Efficiency considerations

  1. ensure operations have optimal asymptotic performance
  2. use tail recursion
  3. avoid extra allocation
  4. otherwise, keep implementations as simple and clean as possible