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

rubric-lang

v0.0.1

Published

A simple, interpreted programming language designed for learning and experimentation.

Readme

Rubric Lang

Rubric Lang is a simple, dynamically-typed, interpreted programming language built with TypeScript. It's designed for educational purposes, demonstrating the core components of a language interpreter: a lexer, parser, and evaluator.

Installation

To use Rubric Lang as a command-line tool, you can install it globally via npm (once published):

npm install -g rubric-lang

Make sure you have Node.js (version 14.0.0 or higher) installed.

Usage

Once installed (or when running locally during development), you can execute Rubric Lang scripts:

rubric-lang path/to/your/script.rl

Or, for development using ts-node:

npm run dev path/to/your/script.rl

Rubric Lang files typically use the .rl extension.

Features & Syntax

Rubric Lang supports the following core programming constructs:

1. Data Types & Literals

  • Integer: 10, -5, 0
  • Float: 3.14, -0.5, 0.0
  • Boolean: true, false
  • String: "hello", 'world' (double or single quotes)
  • Internal Null: The language uses an internal NullValue for uninitialized variables or the result of empty blocks/void functions, but null is not a general-purpose literal or type keyword for direct use in variable declarations or annotations yet.

2. Variables

  • Declaration:
    • var identifier: type = value; (e.g., var age: int = 30;)
    • const identifier: type = value; (e.g., const pi: float = 3.14;)
  • Type Annotations: : int, : float, : string, : boolean, : void. Also accepts other identifiers as type names (e.g. : any) but complex type checking for these is not yet implemented.
  • Type Inference: If an initializer is provided without a type annotation, the type is inferred (e.g., var name = "Rubric"; infers string).
  • Uninitialized var: var x; (defaults to type any and internal NullValue).
  • Assignment: identifier = newValue; (only for var).

3. Operators

  • Arithmetic: +, -, *, / (integer division for int/int, float otherwise), %
  • Comparison: ==, !=, <, >, <=, >=
  • Logical: && (short-circuiting AND), || (short-circuiting OR), ! (NOT)
  • Increment/Decrement: ++identifier (prefix), identifier++ (postfix), --identifier, identifier--
  • Ternary: condition ? expressionIfTrue : expressionIfFalse

4. Control Flow

  • If-Else Statements:
    if (condition) {
      // ...
    } else if (otherCondition) {
      // ...
    } else {
      // ...
    }
  • For Loops:
    for (var i: int = 0; i < 10; i = i + 1) {
      // ...
    }
    (Initializer, condition, and update are all optional)
  • While Loops:
    while (condition) {
      // ...
    }
  • Do-While Loops:
    do {
      // ...
    } while (condition);

5. Functions

  • Declaration:
    fn functionName(param1: type, param2: type): returnType {
      // ... statements ...
      return value;
    }
  • Function Literals (Anonymous Functions):
    var myFunc = fn(param: type): returnType {
      return param;
    };
  • Return Statement: return expression; or return; (implicitly returns NullValue). The last expression in a block is also implicitly returned if no return statement is hit.
  • Recursion: Supported.

6. Scoping

  • Lexical Scoping.
  • Block Scope for var and const.

7. Output

  • display(arg1, arg2, ...); (prints arguments to console, space-separated).

8. Comments

  • Single-line: // comment
  • Block: /* comment */

Development

  1. Clone: git clone <repository-url>
  2. Install: npm install
  3. Build: npm run build (compiles TypeScript to dist)
  4. Test: npm test
  5. Run Demo File: npm run demo (builds & runs demo.rl)
  6. Dev Run: npm run dev path/to/script.rl (uses ts-node)

Future Enhancements

This list reflects some of the ideas previously discussed for future development:

  • Improved Type System:
    • More robust type inference (e.g., for function call results).
    • Proper parsing and semantic analysis for complex function type signatures (e.g., fn(int): fn(string):boolean).
    • Explicit null type and nullable types (e.g., int?).
    • Arrays/Lists, Structs/Classes, Generics.
  • Language Features:
    • Immediately Invoked Function Expressions (IIFEs).
    • String template literals.
  • Control Flow: switch, break, continue.
  • Error Handling: try...catch.
  • Modules: Import/export system.
  • Standard Library: More built-in functions.