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

dialect-lang

v1.0.1

Published

A modern, opinionated programming language that compiles to JS.

Readme

Dialect

A modern, opinionated programming language that compiles to JS.


Install

npm i -g dialect-lang

CLI reference

The CLI has two modes, compile and run.
dialup <mode>

Compile

Compile generates an output javascript file you can run with node! (Notes on web further down in the options section.)

Usage:

dialup compile [-o output] [options] <file> If you specify an output, then it will be saved there, otherwise it saves to out.js.

Options:

Currently, compile only has one extra option, that being --skip-cps.
This does what it says, and skips the CPS phase, which is useful for using the generated JS in web.
!!! NOTE !!! This breaks the normal standard library, but dom has been written with this in mind. This also breaks let nodes, so make sure to make all variables global.

Run

Run just... runs the code!
Note, no standard libraries are included, import them yourself!

Usage:

dialup run <file>


Structure

The compiler is built from multiple modular components. They are used as follows:

  1. The raw file data is given to the preprocessor, which handles imports.
  2. The sanitized data is then passed into an InputStream, which handles per-letter errors.
  3. The InputStream is then fed into a TokenStream, which creates token out of the characters.
  4. That is fed into the parser, which generates a basic AST for further use.
    Note-- at this phase the AST is theoretically able to be compiled to JS, and that's exactl what --skip-cps does.
  5. The AST is then given to the CPS generator, which will transform our normal code to CPS code.
  6. Then we run the optimizer over that CPS AST, creating an optimized AST.
  7. Lastly we feed the optimized AST into a code generator, which currently just generates JS, but maybe will do other languages in the future.

Syntax overview

with

with is how functions are defined (refered to as lambdas in source). You can have a function 'with' no inputs, or have inputs:

noInputs = with() |
    30 + 20;
|;

inputs = with(n) |
    n + 30;
|;

if/then/else

These follow the normal way these work in other languages.

a = 2;
b = 3;

if b > a |
    print("yay");
|;
if a > b |
    print("nay");
|;

*** Result
yay

Or, inline!

a = 2;
b = 3;

print(if b > a then "yay" else "nay")
*** Result
yay

js:raw

This allows you to provide raw javascript code in the program, and it's what most of the standard library is!

print = js:raw "function(k, text) {
    console.log(text);
    k();
}";

len = js:raw "function(k, object) {
    k(object.length);
}";

Note the use of k() here. This is a byproduct of CPS, as normal returns don't work. If you have CPS diabled (ie. for the web), then these wont work becuase there's not continuation to call. This is why the normal standard library breaks when used without CPS.


Quirks

If you have recursive imports (smth like this):

        test1                        test2
 ┌───────────────────┐       ┌───────────────────┐
 │                   ├──────►│                   │
 │  import test2;    │       │  import test1;    │
 │                   │       │                   │
 │                   │◄──────┤                   │
 └───────────────────┘       └───────────────────┘

Then you'll get a RangeError: Maximum call stack size exceeded during the Preprocessing phase