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

soakvm

v1.0.4

Published

A Universal General Purpose Virtual Machine written in Sakura/Oaklang

Readme

Soak VM

Soak VM is a lightweight virtual machine implementation designed for executing custom bytecode instructions.

Features

  • Stack-based architecture: Operates on a stack data structure for efficient instruction execution.
  • Primitive operations: Supports basic operations like arithmetic, boolean logic, and control flow.
  • Memory management: Includes memory caching and operations for data manipulation.
  • Function calls: Implements a return address mechanism for function invocations.
  • Dynamic typing: Handles various data types including integers, floats, booleans, and strings.

Core Components

CowNode

The CowNode class represents a node in the VM's execution context. It manages:

  • Code storage
  • Register handling
  • Step navigation (next and previous)

Instruction Set

Soak VM supports a wide range of instructions, including:

  • Stack operations: drop, dup, swap, over, rot, rotcc, shuf, rshuf
  • Arithmetic: addition, subtraction, multiplication, division, modulus, power
  • Bitwise operations: AND, OR, XOR, left shift, right shift
  • Control flow: conditional jumps, goto
  • Memory operations: read, write, cache
  • Type casting: between various primitive types
  • String manipulation: concatenation, substring extraction
  • List and object operations: creation, access, modification

Special Features

  • Memoization: Caching mechanism for optimizing repeated computations
  • Custom math functions: Implementations of operations like square root and cube root
  • Character set utilities: Access to lowercase, uppercase, numeric, and symbol character sets

Usage

To use Soak VM, you typically:

  1. Initialize the VM context
  2. Load bytecode instructions
  3. Execute the instructions using the VM's interpreter
// Example usage (pseudo-code)
let soak = new Soak();
soak.loadInstructions(bytecode);
soak.execute();

Extending Soak VM

The modular design of Soak VM allows for easy extension:

  • Add new instructions by implementing them in the appropriate module (e.g., Prims for primitives)
  • Extend existing operations by modifying the relevant functions
  • Implement custom optimizations or features by leveraging the VM's architecture
  • Create custom data structures by extending the memory management model
  • Introduce new bytecode instructions for specialized tasks

Performance Considerations

Soak VM includes several optimizations:

  • Memoization for expensive computations
  • Efficient stack operations
  • Cached memory access
  • Lazy evaluation of expressions where applicable
  • Batch processing for repeated patterns in code

However, as with any interpreted language, there may be performance trade-offs compared to native code execution.

Contributing

Contributions to Soak VM are welcome. Please ensure that any new features or modifications align with the existing architecture and coding style.


Hehehe

Operations as of v0, if you care:

  • ?!, _hksqrt, rshuf, qsin, _intOrFloat
  • qand, regcl, mc_setkey, not, tostr
  • mc_getctx, c-nm, @, hksqrt, _hksqr
  • qhkrshift, add, qneq, mc_getkey, tay
  • new, ?:, mod, bor, qinc
  • std, hkmlt, abs, qpow, tsx
  • memoize, subrt, t, sub, txa
  • concat, loop, clear_cache, $
  • _hkmlt, qcos, exp, mc_delctx, append
  • c-sy, swap, qhkmlt, qbor, contains
  • if, c-up, qhkdiv, _qd_b4, drop
  • _bool, qnot, mc_addctx, mc_newctx, entries
  • f, bxor, qbxor, and, txs
  • reduce, indexOf, c-nl, over, inc
  • lshift, hkabs, mc_gc, length, c-sl
  • (), rot, qhksqrt, qsqrt, remove
  • sqrt, qhklshift, eq, keys, c-b
  • rotcc, qsub, set, qhksqr, qtan
  • qlshift, hkdiv, sin, _get_or_compute
  • rshift, qmlt, qband, tax, get
  • _qdiv, mc_haskey, ?>, shuf, tan
  • mc_hasctx, tya, substr, _cache, qmod
  • ora, addr, _ioarg, hkcub, neq
  • filter, (^) o, call, dec, qeq
  • pick, load, jump, qadd, _hkcub
  • qhkcub, band, cos, store, c-cl
  • mlt, qhkabs, qrshift, tobool, c-lw
  • fromhex, tohex, hksqr, qeor, MemCache
  • map, qhkpow, #, dup, _hkpow
  • hkpow, hkrshift, qora, jmif, c-cs
  • div, values, qabs, hklshift, _exp
  • pow, toint, has, (?), c-al
  • eor, tofloat

You're welcome!