Why pin

Choose the tool that fits the work

pin is for teams that read a lot of code and want the compiler to explain its mistakes. TypeScript is a mature tool with a large ecosystem. This page compares the two, using only what the repository shows.

The problem pin targets

Compile errors can be long. Code can carry more punctuation than the idea it expresses. A reader must decode a line before judging it. pin takes a different path: fewer spellings, a written test for each design choice, and errors that name the line and, often, the fix.

The design test

Every pin proposal must pass four questions. They come from section 1 of the spec.

  1. Can a reader understand each line without a lookup table?
  2. Is there exactly one spelling for this idea?
  3. Does the code say what it means?
  4. Does an error message tell the writer what to do next?

pin and TypeScript

Question TypeScript pin
Output JavaScript TypeScript, with source maps and .d.ts files
Immutable by default No. const protects a binding, not a value. Yes. mut allows a change.
Compile errors Errors may be long or hard to read. Each message names the line. Many also name the fix.
Spellings for one idea Often more than one One spelling, enforced by the spec
Editor support Mature, from many editors None yet
Ecosystem npm and the TypeScript community npm through the TypeScript output
Maturity Years of production use Early. See the status page.

When pin fits

When TypeScript fits better

What pin does not have yet

The status page lists what is tested and what is not.