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

lahlang

v0.3.1

Published

A programming language for Singaporeans, by not a Singaporean yet. Can one lah!

Readme

Lahlang 🇸🇬

A programming language for Singaporeans, by not a Singaporean yet. Can one lah!

Table of Contents


Overview

Lahlang is a fun, expressive programming language inspired by Singlish and Singaporean culture. It’s designed for learning, experimentation, and joy, with syntax and keywords that reflect local slang and humor.

Documentation

For a complete guide on how to use Lahlang, check out our extensive documentation:

  1. Installation Guide: Node.js/pnpm prerequisites and global CLI installation.
  2. VS Code Extension: How to get syntax highlighting.
  3. Getting Started: Your first .lah file and "Hello World".
  4. Variables and Types: Data handling with Singlish types.
  5. Control Flow: Logic with confirm or not and which one lah.
  6. Loops: Iteration with keep going lah and every one also.
  7. Functions: Defining and calling reusable blocks.
  8. Error Handling: Wholesome and Spicy 🌶️ tiers.
  9. CLI Reference: Commands, debugging, and meta keywords.
  10. Examples Walkthrough: Deep dive into the examples/ folder.

Features

  • Singlish Syntax: Keywords like eh listen lah, ok lah bye, oi, confirm or not, keep going lah, etc.
  • Interactive REPL: Run lahlang with no arguments to enter the REPL — type Singlish code line by line with multi-line support.
  • VS Code Support: Get syntax highlighting with the Lahlang VS Code Extension.
  • Variables & Constants: eh got, confirm got
  • Control Flow: confirm or not (if), or maybe (else if), abuden (else), keep going lah (while), one by one lah (for), every one also (foreach), hantam lah...until (do-while)
  • Functions: steady lah do this, here take, eh do this, one time only, jio (casual call)
  • Error Handling: see how lah, aiyoh kena, confirm do, jialat throw, paiseh warn, hong gan lah, chao cb assert, act blur (silent try)
  • Types: words (string), nombor (number), can cannot (boolean), whole list (array), all the things (object)
  • Singlish Expressions: kaypoh (typeof), gostan (reverse), swee (pretty print), agak agak (round), makan (pop), tabao (clone), chope (freeze), sabo (delete), die die must (assert), sian/lepak (sleep)
  • Built-in Methods: String methods (.upper(), .lower(), .trim(), .split(), etc.), array methods (.push(), .pop(), .map(), .filter(), etc.), object methods (.keys(), .values(), .entries()), and global helpers (panjang, to_nombor, to_words, math functions)
  • String Escapes: \n, \t, \r, \\, \" inside double-quoted strings
  • Operators: same same (==), not same (!=), and also (&&), or can (||), add some more (+=), minus a bit (-=)
  • Comments: // shiok: (single-line), wahlau start ... wahlau end (multi-line)
  • Meta: chiong bring in (import), share out (export), eh check this (debug/inspect)
  • Spicy Error Types: JialatError, BoJioError, SiaoError, TokKokError, TanKuKuError, SuayError, WahLauError, GoneCase, CbError, LanJiaoError, CcbError

Installation

Install globally using pnpm:

pnpm i -g lahlang

Usage

Run a .lah file:

lahlang myfile.lah

Or start the interactive REPL:

lahlang
lah> oi "Hello from REPL!"
Hello from REPL!
lah> eh got x = 42
lah> oi x + 8
50

Type Singlish code directly — no need for eh listen lah / ok lah bye wrappers. Multi-line blocks (with {}) are supported. Press Ctrl+C to exit.

To close REPL with a keyword, type bye lah on its own line.

Language Examples

Hello World

eh listen lah
	oi "Hello World";
ok lah bye

FizzBuzz

eh listen lah
	one by one lah (i from 1 to 15) {
		confirm or not (i % 15 same same 0) {
			oi "FizzBuzz";
		} or maybe (i % 3 same same 0) {
			oi "Fizz";
		} or maybe (i % 5 same same 0) {
			oi "Buzz";
		} abuden {
			oi i;
		}
	}
ok lah bye

Data Structures

eh listen lah
	eh got my_list = [1, 2, "shiok", can];
	oi my_list;
	every one also (item in my_list) {
		oi item;
	}
	eh got my_bag = {
		food: "Chicken Rice",
		price: 4.5,
		tasty: can
	};
	oi my_bag;
ok lah bye

Advanced Logic

eh listen lah
	steady lah do this makeCounter(start) {
		eh got count = start;
		steady lah do this increment() {
			eh change count = count + 1;
			here take count;
		}
		here take increment;
	}
	eh got my_counter = makeCounter(10);
	oi my_counter();
ok lah bye

Singlish Expressions

eh listen lah
	// typeof
	oi kaypoh "hello";          // "words"
	oi kaypoh 42;               // "nombor"

	// reverse
	oi gostan "lahlang";        // "gnalhal"
	oi gostan [1, 2, 3];        // [3, 2, 1]

	// round
	oi agak agak 3.7;           // 4

	// pretty print
	eh got obj = { name: "Ah Beng", age: 25 };
	swee obj;

	// clone and freeze
	eh got copy = tabao obj;
	chope obj;

	// silent error handling
	act blur {
		jialat throw "this error is swallowed";
	}

	// assert
	die die must (1 + 1 same same 2);
ok lah bye

Do-While Loop

eh listen lah
	eh got i = 0;
	hantam lah {
		oi i;
		eh change i = i + 1;
	} until (i less than 5)
ok lah bye

Built-in Methods

eh listen lah
	// String methods
	eh got s = "hello world";
	oi s.upper();               // "HELLO WORLD"
	oi s.split(" ");            // ["hello", "world"]
	oi panjang(s);              // 11

	// Array methods
	eh got arr = [3, 1, 2];
	oi arr.sort();              // [1, 2, 3]
	oi arr.map(steady lah do this(x) { here take x * 2; });

	// Type conversion
	oi to_nombor("42");         // 42
	oi to_words(100);           // "100"
ok lah bye

Wall of Lah

We do it for the community one lah.

Contribute any .lah example and get featured automatically as a repository contributor on the Wall of Lah.

See contribution details in wall-of-lah/README.md.

CLI Options

  • lahlang <file.lah>: Run a Lahlang program.
  • lahlang: Start the interactive REPL.
  • Only .lah files are accepted.
  • Errors are reported in Singlish style, e.g. [TOK KOK], [RUNTIME ERROR], [FATAL], [ALAMAK].

Project Structure

lahlang/
├── src/                # Source code (lexer, parser, interpreter, CLI)
├── examples/           # Example .lah programs
├── tests/              # Unit and integration tests
├── package.json        # Project metadata and scripts
├── tsconfig.json       # TypeScript config
├── vitest.config.ts    # Test config

Architecture

  • Lexer: Tokenizes source code using Singlish keywords.
  • Parser: Builds AST from tokens, supports all language features.
  • Interpreter: Executes AST, manages environment, handles errors.
  • CLI: Entry point for running .lah files, handles file I/O and error reporting.

Testing

Run all tests with:

pnpm test
  • Uses Vitest for unit and integration tests.
  • Test coverage includes lexer, parser, interpreter, error handling, and full language features.

Contributing

Contributions are welcome! Please open issues or pull requests for:

  • Bug fixes
  • Feature requests
  • Documentation improvements
  • New examples

Star History


Support

If Lahlang helps you or made you smile, you can support the project here:

  • GitHub Sponsors: https://github.com/sponsors/suryanshkushwaha
  • Buy Me a Coffee: https://buymeacoffee.com/suryanshkushwaha

License

MIT License