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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cell-lang

v1.2.1

Published

Cell, a programming language designed to have a minimally small implementation.

Readme

Cell Elementary Learning Language

Cell is a minimally simple programming language designed to demonstrate how to write a programming language.

Cell was designed by Andy Balaam. His original implementation is in Python. This repository is a new JavaScript implementation, written as the basis of a talk to Norfolk Developers, given in October 2021.

Here is an example program:

square = {:(x) x * x;};

num1 = 3;
num2 = square( num1 );

if( equals( num1, num2 ),
    {
        print( "num1 equals num2." );
    },
    {
        print( "num1 does not equal num2." );
    }
);

This prints:

num1 does not equal num2.

Build from Source

git clone https://gitlab.com/jezhiggins/jscell.git
cd jscell
npm install
./bin/cell.js             # - to run the interactive environment
./bin/cell filename.cell  # - to run a program
npm run test              # - to run all the tests

Install from NPM

npm install cell-lang

or to run directly

npx cell-lang

Work in Progress

This repository is work in progress

  • [x] Lexer
  • [x] Parser
  • [x] Evaluator
  • [x] Library
  • [x] run file
  • [x] repl (functional, but needs polish)
  • [ ] fun things to do with the AST
    • [x] constant folding
    • [x] obfuscation
    • [x] AST pretty printing
    • [x] minification
    • [ ] cross-compile to JS?
    • [ ] cross-compile to something else?

Design Principles

Cell is designed to be as complete a programming language as possible, while also being as small to implement as possible.

The implementation is intended to be straightforward to follow, since part of its purpose is to demonstrate how a program expressed in text becomes computer behaviour.

Features

Cell has:

  • Numbers (floating-point)
  • Strings
  • Functions
  • A special "None" value

That's about it.

Interacting with Cell

Cell has an interactive environment ("REPL") which can be launched by running the Cell program with no arguments:

>>> 137 + 349;
486
>>> 5/10;
0.5
>>> 21 + 35 + 12 + 7;
75
>>> if(equals(0, 1), {"illogical";}, {"logical";});
'logical'

How to write Cell programs

See the explanation of Cell Syntax, and The if function.

Building a language

Cell does not provide special syntax for things like lists, maps and objects, but they can be built up using the features of Cell functions.

The Cell library contains functions like pair that makes a simple data structure from two values (more explanation at Data Structures ).

You can also build things that behave like objects in languages like Java and C++ out of functions. There is more explanation at: Objects.

Explanations

Cell is designed to be useful to teach people how to write programming languages, so the source code is intentionally short and hopefully reasonably easy to read. To get started, follow the links below for explanations of the main parts.

In an interpreter, the program flows through several layers, starting off as textual source code, and being transformed by each layer.

The first layer is the Lexer, which reads in text characters, and spits out "tokens" like print, or {.

The second layer is the Parser, which reads in tokens, and spits out tree-structures which it does not understand.

The third layer is the Evaluator, which reads in the tree structures, understands them and "runs" them - turns them into concrete values by looking up symbols, calling functions, and obeying rules (e.g. the rules of arithmetic).

While the Evaluator is running, it has access to the Library, which is a set of standard values and functions that all programs can use.

See also

License

Copyright 2021 JezUK Ltd Licensed under the terms of the MIT License.