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

vir-lang

v0.4.0

Published

Vir Programming Language — Multilingual syntax (VI/EN/ZH/JA/KO), Q-IR VM, JIT, self-patching binary, SIMD native core. Includes Virgex pattern matching engine.

Readme

vir-lang

Vir — Ngôn ngữ lập trình đa cú pháp (Multilingual Syntax Programming Language). Viết code bằng tiếng Việt, Trung, Nhật, Hàn, Anh — cùng biên dịch sang Q-IR và mã máy giống nhau. Tích hợp JIT, self-patching binary, SIMD-accelerated native core.

Kiến trúc / Architecture

Layer 1: Multilingual Frontend  (N-Gram Tokenizer → Parser → AST)
Layer 2: Virtual Machine        (Q-IR with SSA form)
Layer 3: Self-Patching Backend  (x86_64/ARM64 codegen, Jump Table)
Layer 4: Runtime & Security     (JIT Engine, Binary Patcher, HMAC-SHA256)

Cài đặt / Install

# npm
npm install -g vir-lang

# pnpm
pnpm add -g vir-lang

# yarn
yarn global add vir-lang

# pip (Python package)
pip install vir-lang

Sử dụng / Usage

# Chạy file .vir
vir hello.vir

# REPL tương tác
vir --interactive

# Xem IR trung gian
vir --dump-ir hello.vir

# Xem mã máy
vir --dump-asm hello.vir

# Xuất binary .sri
vir --emit-sri output.sri hello.vir

# Khởi động server
viron --serve

Cú pháp v1.2 / Syntax v1.2

# Hàm (function)
func add:
    in(a:int; b:int; result:int)
    result = a + b;
    out result;
end

# Cấu trúc dữ liệu (entity)
entity User:
    name:string;
    age:int;
end

method User.greet:
    print "Hello " + name;
end

# Điều kiện (conditions)
if x > 10:
    print x;
eif x > 5:
    print "medium";
else
    print "small";
end

# Vòng lặp (loop)
when x > 0 loop
    x = x - 1;
end

# Async task
async func fetchData:
    in(url:string)
    out data;
end
task result wait fetchData("https://api.example.com");

# Xử lý lỗi (error handling)
out divide(a, b) try 0 error DivisionError end

Đa cú pháp / Multilingual — cùng 1 chương trình, 5 ngôn ngữ:

🇻🇳  Nếu máy rảnh, tính tổng A và B bằng thanh ghi.
🇨🇳  如果 机器空闲 加 A 和 B 用 寄存器
🇯🇵  もし CPU空き 足す A と B レジスタで
🇰🇷  만약 CPU여유 더하기 A 와 B 레지스터로
🇬🇧  if cpu_idle add A and B register

Tất cả biên dịch ra cùng Q-IR và mã máy.

Virgex — Pattern Matching Engine

Virgex (Vir + Regex) thay thế regex truyền thống bằng Vir Pattern Syntax (VPS) — chỉ 8 ký hiệu cốt lõi, dễ đọc hơn regex.

| Ký hiệu | Ý nghĩa | Ví dụ | Regex tương đương | | -------- | -------- | ----- | ----------------- | | @ | Atom (lớp ký tự) | @Az | [A-Za-z] | | ! | Lặp (postfix) | @0!3 | [0-9]{3} | | ~ | Phạm vi lặp | @Az!2~5 | [A-Za-z]{2,5} | | ? | Tuỳ chọn (prefix) | ?@Az | [A-Za-z]? | | :( :) | Nhóm | :(A \| B:) | (?:A\|B) | | \| | Anchor hoặc OR | \| @0!3 \| | ^[0-9]{3}$ | | $ | Escape | $- | literal - | | - | Khoảng trắng | @Az - @0 | [A-Za-z] [0-9] |

import virgex

# Số điện thoại VN: 09x hoặc 03x, 10 chữ số
virgex.fullmatch("| :( 09 | 03 :) @0!8 |", "0912345678")  # ✅

# Username 3–12 ký tự
virgex.fullmatch("| @Az0!3~12 |", "user123")  # ✅

# Chuyển sang regex truyền thống
virgex.to_regex("@Az0!3~12")  # → ^[A-Za-z0-9]{3,12}$

Thống kê / Stats

  • C/ASM native core: ~9,900 LOC (27 sources + 27 headers)
  • Python compiler pipeline: 26,840 LOC (152 modules)
  • Standard Library: 233 modules · 72,724 LOC .vri · 71 categories
  • Virgex engine: ~1,400 LOC (Python) + 708 LOC (.vri)
  • GPU: CUDA PTX + Apple Metal (10 kernel templates)
  • Tests: 700/700 pass
  • Domains: Server · IoT · AI · Kernel/OS · Network · Crypto

Yêu cầu / Requirements

  • Node.js >= 16 (for npm wrapper)
  • Python >= 3.11 (for full runtime — fallback if native binary unavailable)

Gói npm tự động tải native binary đúng nền tảng khi cài đặt.

Nền tảng hỗ trợ / Supported Platforms

| Platform | Architecture | Status | | -------- | ------------ | ------ | | macOS | ARM64 (M1+) | ✅ | | macOS | x86_64 | ✅ | | Linux | x86_64 | ✅ | | Linux | ARM64 | ✅ | | Windows | x86_64 | ✅ | | Windows | ARM64 | ✅ |

Giấy phép / License

MIT