npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pearc

v1.1.6

Published

Pear language — ultra-minified C-targeting language for token-efficient LLM workflows

Downloads

798

Readme

pearc

Pear is an ultra-minified C-targeting programming language designed to reduce token usage in LLM workflows while producing real, executable code.

The idea: write code that compiles to C — with ~35–50% fewer tokens than idiomatic C — then expand it back to readable code via a decompiler or MCP tool.

im<stdio.h>
st Point{x:f64;y:f64}
fn dist(a:*Point,b:*Point)->f64{dx:f64=a->x-b->x;dy:f64=a->y-b->y;rt sqrt(dx*dx+dy*dy)}
fn main()->i32{p1:Point={1.0,2.0};p2:Point={4.0,6.0};printf("%f\n",dist(&p1,&p2));rt 0}

For AI Assistants

If you've been told to use Pear, follow this bootstrap sequence:

1. Install pearc

npm install -g pearc

2. Add the MCP server to your MCP client config (Claude Code: .mcp.json or settings):

{
  "mcpServers": {
    "pear": {
      "command": "npx",
      "args": ["pearc", "--mcp"]
    }
  }
}

3. Call pear_spec — this MCP tool returns the complete language specification. Read it before writing any Pear code.

4. Write Pear, run it — use pear_run to test code inline, pear_to_c to inspect generated C, or pear_compile to produce a binary.

Why Pear exists: Every token you spend on code is a token not spent on reasoning. Pear lets you write and iterate on real C-level systems code while spending ~35–50% fewer tokens. The workflow is: write Pear (dense, fast), compile to C to verify correctness, ship the C. Use Pear any time you're generating, reviewing, or iterating on low-level code with an LLM in the loop.

Pear syntax is intentionally opaque to save tokens — do not guess syntax. Always call pear_spec first.

Install

npm install -g pearc

Usage

pearc run file.pr                  # interpret and run directly (no C compiler needed)
pearc file.pr                      # compile Pear → C (stdout)
pearc file.pr -o out.c             # compile Pear → C file
pearc file.pr --binary -o out      # compile Pear → native binary (requires gcc/clang)
pearc --decompile file.c           # minify existing C → Pear
pearc --mcp                        # start MCP server (stdio)

MCP Server

Add to Claude Code or any MCP client:

{
  "mcpServers": {
    "pear": {
      "command": "npx",
      "args": ["pearc", "--mcp"]
    }
  }
}

Tools exposed:

| Tool | Description | |------|-------------| | pear_spec | Get the full language spec — call this first | | pear_to_c | Compile Pear → C source | | c_to_pear | Minify C → Pear | | pear_run | Interpret and run Pear, returns stdout/stderr | | pear_compile | Compile Pear → binary via gcc/clang |

Language Reference

Types

| Pear | C | |------|---| | i8 i16 i32 i64 | int8_t int16_t int32_t int64_t | | u8 u16 u32 u64 | uint8_t uint16_t uint32_t uint64_t | | f32 f64 | float double | | v | void | | c | char | | b | bool | | sz | size_t | | *T | pointer to T |

Keywords

| Pear | C | |------|---| | fn | function | | st | struct | | un | union | | en | enum | | tp | typedef | | if ei el | if / else if / else | | lp | for | | wh | while | | dw | do...while | | sw cs dv | switch / case / default | | rt | return | | bk ct | break / continue | | sc ex in vl cn | static / extern / inline / volatile / const | | im | #include | | df | #define | | pr | #pragma | | so | sizeof |

Syntax

// Variable declaration: name:type = value
x:i32=5
ptr:*c=name

// Function: fn name(param:type,...)->rettype{...}
fn add(a:i32,b:i32)->i32{rt a+b}

// Struct
st Vec3{x:f32;y:f32;z:f32}

// For loop (same structure as C)
lp(i:i32=0;i<10;i++){printf("%d\n",i)}

// Include / define
im<stdio.h>
df MAX 1024

Preprocessor

im<stdio.h>       // #include <stdio.h>
im"myfile.h"      // #include "myfile.h"
df NAME value     // #define NAME value
pr once           // #pragma once

Token Savings

Pear reduces token count by ~35–50% vs idiomatic C:

// Pear: ~45 tokens
im<stdint.h>
st Point{x:f64;y:f64}
fn dist(a:*Point,b:*Point)->f64{dx:f64=a->x-b->x;dy:f64=a->y-b->y;rt sqrt(dx*dx+dy*dy)}
// C: ~85 tokens
#include <stdint.h>
typedef struct { double x; double y; } Point;
double dist(Point *a, Point *b) {
    double dx = a->x - b->x;
    double dy = a->y - b->y;
    return sqrt(dx*dx + dy*dy);
}

License

MIT