Skip to content

Improve dim-si README for new users #4

@dyreby

Description

@dyreby

The dim-si README has a few gaps that new users hit early.

The Quick Start should be the primary onboarding path. Rather than adding separate sections for each concept, expand the Quick Start to demonstrate more operations (multiplication, division, scaling) using the fluent q() API — that's the style we want users to reach for first. Free functions get a brief mention, not a full code block.

Quick Start structure

Walk through a small coherent scenario rather than isolated snippets:

  1. Create quantities from values — show kilometer(100), hour(2), etc. and call out that this is how you wrap raw numbers (e.g., from JSON or external APIs)
  2. Compute — use q() fluent API to combine them: division for speed, addition with mixed units
  3. Extract values — show .in(unit) to get plain numbers back out, explain valueIn as the non-fluent alternative
  4. Compile-time safety — show a dimension mismatch error
  5. Affine units — brief temperature example since it has different semantics

Free functions get a one-liner mention at the end.

README section order

  1. Installation
  2. Quick Start (above)
  3. Type Annotations — how to write functions with Linear/Affine (see Make dim-si types easy to use for end users #7)
  4. Units (reference table)
  5. Custom Scaled Units
  6. Adding a New Unit (contributor-facing)

Other improvements

  • Ensure import consistency (everything comes from @isentropic/dim-si subpaths, not lower-level packages)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpkg:dim-sidim-si package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions