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

rapira

v0.1.2

Published

Interpreter for РАПИРА — the Soviet educational programming language (1985 Agat dialect).

Readme

Rapira

A TypeScript / Bun interpreter for РАПИРА — the Soviet educational programming language designed in the early 1980s under G. A. Zvenigorodsky as part of the Школьница (Shkolnitsa) school computing system for the Агат (Agat) microcomputer.

▶ Try it in your browser: https://begoon.github.io/rapira ▶ Run it from your terminal: npx rapira examples/factorial.rap

ФУНК ФАКТ (Н);
   ИМЕНА: Р;
   1 -> Р;
   ДЛЯ И ОТ 1 ДО Н ::
      Р * И -> Р
   ВСЕ
РЕЗ: Р
КНЦ;

ДЛЯ Н ОТ 0 ДО 6 ::
   ? "ФАКТ(", Н, ") = ", ФАКТ(Н)
ВСЕ;

What's in the box

  • Interpreter core (src/) — lexer, parser, tree-walking evaluator. Faithful to the 1985 Agat dialect: Russian-only keywords, case-insensitive identifiers, (* … *) block comments, ; statement separator, three compound types (tuples < >, sets <* *>, records <¤ ¤>), three-arrow procedure parameter scheme (name / name => / <=> name), trailing РЕЗ: for function results.
  • CLI (cli/) — rapira FILE.rap runs a program, rapira drops into a multi-line REPL, --svg PATH captures turtle graphics as SVG.
  • Web playground (web/) — vanilla HTML + CodeMirror 6 + Web Worker, light/dark theme, example selector loading from tests/snippets/. Build with bun build, output sits in docs/ ready for GitHub Pages. Live at https://begoon.github.io/rapira.
  • Snippet test pipeline (tests/snippets/) — .rap files diffed against sibling .expected.txt / .expected.svg on every run of bun test.
  • Чертёжник turtle — Soviet "Draftsman" executor exposed as ordinary Rapira procedures (ВПЕРЕД, НАЗАД, НАПРАВО, НАЛЕВО, ПЕРО_ВНИЗ, ПЕРО_ВВЕРХ, ДОМОЙ, В_ТОЧКУ, КУРС). Layered on top of the same GfxEvent stream as the documented graphics primitives (ЛИН, ПРЯМ, ОБЛ, etc.) so the CLI's SVG renderer and the playground's canvas renderer draw identical output.

Install

The CLI ships as a self-contained Node bundle. With Node ≥ 18 you can run it without cloning:

npx rapira FILE.rap                           # run a program
npx rapira FILE.rap --svg out.svg             # capture turtle graphics
npx rapira                                    # multi-line REPL (Ctrl-D to quit)

Or install globally:

npm install -g rapira
rapira FILE.rap

Develop

For local development you'll want Bun (it runs the tests and the dev server natively):

bun install
bun test                                      # 129 tests across 9 files
bun run cli/index.ts examples/factorial.rap   # ФАКТ(0..7)
bun run dev                                   # playground on http://localhost:10000
bun run cli:build                             # bundle the CLI to dist/rapira.js

If you have just installed, you can use the recipe names — just test, just dev, just run examples/turtle_star.rap --svg star.svg, etc.

Examples

| File | What it shows | | ---- | ------------- | | examples/hello.rap | canonical ВЫВОД: "Здравствуй, мир!" | | examples/factorial.rap | ФУНК with trailing РЕЗ:, ДЛЯ … ОТ … ДО, integer math | | examples/turtle_square.rap | Чертёжник draws a square via ПОВТОР … РАЗА :: ВПЕРЕД(50); НАПРАВО(90) | | examples/turtle_star.rap | five-pointed star from a single repeat loop | | examples/io_files.rap | ОТКРЫТЬ … КАК, ВЫВОД В ФАЙЛ, ВВОД ИЗ ФАЙЛА ТЕКСТОВ, ЗАКРЫТЬ | | examples/io_seek.rap | ПОЗИЦИЯ Ф = N for random-access file reading |

Documentation

  • SPEC.md — the implementation contract: lexical structure, statements, operators, built-ins, what's done vs. honestly deferred.
  • RAPIRA.MD — the canonical 1985 spec (Фг.00031-01 35 01) reformatted to Markdown from the agatcomp.ru KOI-8 source.
  • CLAUDE.md — onboarding notes for working on this codebase.

License

MIT © Alexander Demin