# softwaremill/macwire

Zero-cost, compile-time, type-safe dependency injection library.

Repository: https://github.com/softwaremill/macwire
Canonical: https://ross.abutalabs.com/products/macwire
Homepage: https://softwaremill.com/open-source/
Language: Scala
License: Apache-2.0
License Family: permissive
Topics: dependency-injection, scala, macwire
Last push: 2026-08-25T00:15:06+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 45, longevity 100
- inputs: {"age_days": 4917, "days_push": 9, "days_rel": 366, "gap_med": 9, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1314, forks 77 (observed 2026-08-28T04:04:20.506878+00:00)

## What it is
MacWire is a zero-cost, compile-time, type-safe dependency injection library for Scala built on macros. It generates instance-creation code automatically, avoiding boilerplate and runtime overhead while keeping classes free of annotations or conventions.

## Use cases
- wire dependencies in a Scala application without runtime reflection
- eliminate boilerplate `new` instance creation code in Scala modules
- get compile-time errors for missing dependencies instead of runtime failures
- autowire class graphs using constructors and apply methods
- collect all instances of a type into a List or Set for multi-binding
- compose application modules with scopes and lazy initialization

## When to choose
- you write Scala and want type-safe DI with no runtime overhead
- you prefer constructor-based wiring without annotations or container configuration
- you want dependency errors caught at compile time
- you target Scala JVM, JS, or Native platforms

## When to avoid
- you need runtime- or container-based DI with dynamic service lookup
- your project is not in Scala
- you need features unavailable for your specific Scala version
- you rely on runtime plugin discovery or late binding

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, backend, programming-languages
- platform: jvm, cross-platform
- tags: dependency-injection, scala, macros, compile-time, type-safe, zero-cost

## Member repositories
- softwaremill/macwire (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:20.506878+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:48:48.169835+00:00, confidence not recorded.
  - readme: https://github.com/softwaremill/macwire (fetched 2026-08-28T04:04:20.506878+00:00, sha 9817bfac4c81)
  - homepage: https://softwaremill.com/open-source/ (fetched 2026-08-29T12:07:23.496649+00:00, sha ebbb9106d79a)
  - site_page: https://softwaremill.com/about-us (fetched 2026-08-29T12:07:23.499879+00:00, sha 3bf9cbf7100c)
  - site_page: https://softwaremill.com/how-we-work (fetched 2026-08-29T12:07:23.502303+00:00, sha 36a836a630d7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
