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

mex-ml

v0.3.3

Published

A beginner-friendly ML learning language that teaches machine learning through clean, readable code. Zero dependencies.

Readme

MEX — Machine Learning EXpression Language

npm version license

A beginner-friendly programming language that teaches machine learning concepts through interactive code. Write clean, readable code that converts to real TensorFlow.js or Python.

No dependencies required — includes a minimal neural network built from scratch.


Quick Start (2 minutes)

Install

npm install -g mex-ml

Create Your First Project

mex init my-first-ml
cd my-first-ml
mex run hello.mx

That's It!

You now have a working ML project with:

  • hello.mx — your first program
  • examples/ — example files
  • datasets/ — your data files
  • README.md — documentation

Features

  • Simple Syntax — reads like English
  • Zero Dependencies — runs anywhere Node.js runs
  • 100+ Built-in Functions — math, statistics, arrays, strings, data
  • DataFrame API — Pandas-like data manipulation with method chaining
  • Visualization — ASCII charts (bar, line, scatter, histogram, pie)
  • Dual Export — generate TensorFlow.js or Python code
  • Smart Debug — catches NaN, exploding loss, overfitting
  • Interactive Playground — web-based editor with syntax highlighting
  • REPL Mode — interactive command line for experimenting
  • Type System — optional type annotations with runtime checking
  • Package Manager — install and share MEX packages
  • Learning System — 6 lessons, challenges, achievements

Commands

Getting Started

mex init <project>     # Create new project
mex new <name>         # Create new .mx file
mex run <file.mx>      # Run a .mx file
mex repl               # Start interactive REPL
mex --help             # Show all commands
mex --version          # Show version

Learning

mex lesson 1           # Start lesson 1
mex challenge 1        # Try challenge 1
mex lessons            # List all lessons
mex status             # Check your progress
mex achievements       # View achievements

Code Generation

mex --generate file.mx # Generate TensorFlow.js
mex --python file.mx   # Generate Python
mex --show-tf file.mx  # Show TF.js alongside
mex --stats file.mx    # Show compression stats

Example: Linear Regression

Write MEX Code

data points
  (1, 2)
  (2, 4)
  (3, 6)
  (4, 8)

model simple
train 100 epochs
predict 5

Run It

mex run hello.mx

Output

Data loaded: 4 points
Model created: simple (linear)
Training for 100 epochs...
Training complete! Error: 0.001234
Prediction for 5: 9.9876

Convert to Python

mex --python hello.mx
# Generated by MEX → Python/TensorFlow
import tensorflow as tf
import numpy as np

xs = np.array([1, 2, 3, 4]).reshape(-1, 1)
ys = np.array([2, 4, 6, 8]).reshape(-1, 1)

model = tf.keras.Sequential([
    tf.keras.layers.Dense(1, input_shape=[1])
])

model.compile(optimizer='sgd', loss='mse')
model.fit(xs, ys, epochs=100, verbose=0)

pred = model.predict(np.array([[5]]))
print(f"Prediction: {pred.numpy()[0][0]:.4f}")

Language Syntax

Data

data points (1, 2) (3, 4)       # Inline data
data csv "houses.csv"            # CSV file

Models

model simple                     # Linear regression
model sequential                 # Neural network
  dense 8 relu                   # Hidden layer
  dropout 0.2                    # Regularization
  dense 1 sigmoid                # Output layer

Training

train 100 epochs                 # Basic training
train 200 epochs learning_rate 0.01  # Custom learning rate

Prediction

predict 5                        # Single value
predict [5, 10, 15]              # Multiple values

Control Flow

if (x > 5) { ... } else { ... }
for i in range(10) { ... }
while (x > 0) { ... }

Functions

fn add(a, b) {
  return a + b
}

let doubled = map([1, 2, 3], fn(x) { return x * 2 })

Type Annotations (Optional)

let x: number = 42
fn add(a: number, b: number) -> number {
  return a + b
}

DataFrame Chaining

data csv "houses.csv"

let result = data
  .filter("size", ">", 2000)
  .sort("price", false)
  .head(3)

print(result.to_json())

Built-in Functions (100+)

Math

sqrt, pow, abs, sin, cos, tan, log, exp, floor, ceil, round, random

Statistics

mean, sum, std, variance, median, mode, min_arr, max_arr

String

len, upper, lower, trim, split, join, replace, includes, type

Array

sort, sort_by, reverse, unique, flatten, slice, head, tail, zip

Higher-Order

map, filter, reduce, each, find, find_index, every, some, group_by

Data

column, columns, select, where, limit, offset, sample, shuffle, distinct

Visualization

bar_chart, line_chart, scatter_plot, histogram, pie_chart


Learning Path

| Lesson | Topic | Duration | |--------|-------|----------| | 1 | What is Data? | 20 min | | 2 | Finding Patterns | 25 min | | 3 | Classification | 25 min | | 4 | Neural Networks | 30 min | | 5 | Real Data | 30 min | | 6 | Advanced Topics | 35 min |


Interactive Playground

Open playground/index.html in your browser:

  • Syntax highlighting
  • Autocomplete (50+ functions)
  • 12 built-in examples
  • File tabs with auto-save
  • CSV import/export

Documentation

| Document | Description | |----------|-------------| | DOCS.md | Complete language reference | | CHANGES.md | Changelog | | CONTRIBUTING.md | How to contribute |


System Requirements

  • Node.js: v14 or higher
  • OS: Windows, macOS, Linux

License

MIT License — see LICENSE for details.


Support