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

gabelang

v3.1.1

Published

A high level, interpretted and garbage collected programming language

Readme

Gabelang

Overview

This is a language I am writing in rust for fun and to learn more about lexers, parsers, interpreters, and to dymistify programming languages in general. The Writing an Interpreter in Go book by Thorsten Ball was used as a reference and insperation for this project as well as mkdb by Antonio Sarosi.

BNF / Language Grammer

<program> = <statement> | <program> <statement>
<statement> = <let_statement> | <if_statement> | <while_loop> | <func_decl> | <expression>
<let_statement> = let <identifier> = <expression>;
<assign_statement> = <assignable> = <expression>;
<if_statement> = if <expression> <code_block>
<while_loop> = while <expression> <code_block>
<for_loop> = for(<statement> <expression>; <statement>) <code_block>
<func_decl> = fn <identifier> <param_idents> <codeblock>
<code_block> = {<program>}
<param_idents> = (<_param_idents>)
<_param_idents> = <identifier> | <_param_idents>, <_param_idents>
<identifier> = <ident_char> | <ident_char><identifier>
<indent_char> = <ALPHACHAR> | _
<expression> = <group_expression> | <operation_expression> | <assignable> | <func_call> | <object_literal> | <array_literal>  | <number_literal>
<group_expression> = (<expression>)
<operation_expression> = <expression> <op> <expression>
<op> = + | - | * | /
<assignable> = <identifier> | <array_index> | <object_prop>
<array_index> = <assignable>[<expression>]
<object_prop> = <assignable>.<identifier>
<func_call> = <assignable>(<expression_list>)
<object_literal> = {<object_field_literals>}
<object_field_literals> = <identifier>: <expression> | <object_field_literals>, <object_field_literals>
<array_literal> = [<expression_list>]
<expression_list> = <expression> | <expression_list>, <expression_list>
<number_literal> = <number> | <number><number_literal>
<number> = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

Commenting

Comment your code using the //comment syntax Any text to the right of a double slash does not make it to the parser or interpretter and will not be evaluated as code

// This function doubles a number
fn double_num(num) {
    // Multiplies num by 2 to get the answer
    return num * 2;
}

Variable Behavior

  • When a variable is used as an expression/rvalue it is deep cloned

Built in Functions

len(obj) -> number

  • returns the length of an array or string
  • returns the number of keys in an object
  • throws an error if provided with something other than an array, object, or string

reverse(obj) -> array | string

  • returns a new reversed array or string without changing the parameter object
  • throws an error if provided with something other than an array or string

abs(number) -> number

  • returns the absolute value of a passed in number
  • throws an error if provided with something other than a number

open(path) -> string

  • returns the contents of the file at path as a string
  • throws an error if file reading fails
  • throws an error if provided with something other than a string

print(any) -> null

  • prints a value to stdout followed by a newline
  • accepts any value (numbers, strings, arrays, objects, booleans, null, functions)

prompt(string) -> string

  • prints the prompt message to stdout (no trailing newline), reads a line from stdin, and returns it with the trailing newline stripped
  • throws an error if the argument is not a string or if reading stdin fails

char_code(string, index) -> number

  • returns the byte value (0-255) at the given index of the string
  • throws an error if the first argument is not a string or the second is not a number
  • throws an error if the index is negative or out of bounds

substring(string, start, end) -> string

  • returns the substring from start (inclusive) to end (exclusive)
  • throws an error if string is not a string or start/end are not numbers
  • throws an error if start < 0, end < 0, start > end, or end exceeds the string length

concat(a, b) -> string

  • returns the string formed by concatenating the string representations of a and b
  • accepts any combination of value types; both are stringified before joining

Build

Build with

cargo build --release

Build for wasm target

Requires wasm-pack to be installed

cargo install wasm-pack

Build with

wasm-pack build --features wasm

Install

Requires cargo to be installed

Install gabelang with

cargo install gabelang

Run

Run as repl with

gabelang

or run a script with

gabelang [script name]
gabelang --file [script name]

Test

Run tests with

cargo test

Todo

  • Better Documentation
  • Built in Functions(print, file, fetch, input)
  • Add tests to ast and eval modules
  • Add fun language syntax
  • Improve garbage collector to use mark and sweep

Todo Reach

  • Add tooling/language server
  • Add bytecode compiler
  • Create VM that can run bytecode