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

@arrrank/compile

v0.0.1

Published

LLM-aided Rust rewrite: compile Rank source into a self-contained agent task

Readme

@arrrank/compile

LLM-aided Rust rewrite. Compile a .ra file into a self-contained task for a coding agent. The compiler runs locally without an LLM, API key or agent. The receiving agent does not need prior knowledge of Rank.

The package prepares a task with source, parsed syntax, name/type/loop facts, numeric rules and existing tests. Your agent writes the Rust; rank-compile builds it and compares outputs with the Rank interpreter on your chosen inputs. Initial validated coverage is Project Euler 1–10 in exact and checked-i64 modes.

Use without a global install

Requires Node.js 22.12+. Rust/Cargo is needed to build and verify generated code. The exporter and verifier do not require the Rank REPL or its native dependencies.

npx @arrrank/compile program.ra > program.rust.md

Give program.rust.md to your coding agent. The file explains the Rank syntax and operations used in the initial supported examples, contains the program and parsed structure, and specifies the standalone Rust project to create.

For checked machine integers:

npx @arrrank/compile program.ra --integers i64 > program.rust.md

For a prepared project with verification inputs:

npx @arrrank/compile prepare program.ra --out rust/program

Ask the agent to implement rust/program/task.md, then compare the generated executable with Rank:

npx @arrrank/compile verify rust/program

task program.ra is an explicit alias for the default export command. Stdout can be redirected to a file or piped to an agent that accepts input there.

Agent selection and login stay with your coding agent. This package does not invoke Codex or Claude, choose a model, or charge an API account.

Verification inputs

By default prepare creates one case with no command-line arguments. Supply more cases to check other inputs. Existing _test.ra files are included as generation context; the verifier does not automatically execute those tests.

[
  {"name": "default input", "args": []},
  {"name": "small input", "args": ["--limit", "10"]},
  {"name": "invalid input", "args": ["--limit", "bad"], "error": true}
]
npx @arrrank/compile prepare program.ra --out rust/program --cases cases.json

The output directory must be new. After generation, verify builds the Cargo project and compares stdout byte-for-byte. Error cases require both programs to fail and retain any preceding stdout; diagnostic text need not be identical. The report verification.json records each comparison and source/code hashes. A failed comparison exits nonzero. Reference and generated processes each have a 30-second timeout; use verify DIR --timeout 60000 to change it.

Integers

exact is the default and uses arbitrary-precision integers like Rank. Opt into machine integers when their range is sufficient:

npx @arrrank/compile prepare program.ra --out rust/program-i64 --integers i64

The task requires checked i64 arithmetic and rejects out-of-range inputs. For a deliberate numeric-domain difference, a case may use "overflow": true: Rank must succeed and Rust must fail with an overflow/out-of-range diagnostic. This expectation is only allowed in i64 mode. Never use it to hide a mismatch. Floating-point substitution is not supported.

Scope

Version 0.0.1 exports self-contained programs using core, numbers, sequences, text, io and cli modules. It rejects source imports and unresolved names. Only Euler 1–10 have been validated end-to-end; accepting a parsed program does not prove that an agent can preserve every language feature. The syntax and binding facts are not a lowered IR or a proof of loop purity. Unsupported effects must be handled or reported by the agent. Finite tests do not establish universal equivalence, and timings vary by program and integer policy.

See the generated Euler projects and tasks and the language wiki.