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

@wyrd/compiler

v0.0.1-alpha3

Published

[![Build Status](https://travis-ci.org/Maxwell-Alexius/Wyrd-Lang.svg?branch=master)](https://travis-ci.org/Maxwell-Alexius/Wyrd-Lang) [![Coverage Status](https://coveralls.io/repos/github/Maxwell-Alexius/Wyrd/badge.svg?branch=master)](https://coveralls.io

Downloads

4

Readme

Wyrd

Build Status Coverage Status

Wyrd is a strongly-typed toy programming language whose syntax is partially inspired by Ruby lang.

Although it may be a personal project, it is evolving in high speed. 🔥

Check out new released Wryd documentation here! 🚧Under Construction 🚧

Wyrd programming language compiles its code into JavaScript. The primary goal would be to write Front-End code and Back-End code (NodeJS) using Wyrd programming language. I may want to try writing React (or Vue) component code using Wyrd lang if possible.

Why the "Wyrd" Name?

Wyrd although officially pronounced as "weird", but sometimes I accidentally pronounce it as "w-ei-rid". However, personally I think both of them are okay.

Wyrd is a concept in Anglo-Saxon culture roughly corresponding to fate or personal destiny. The word is ancestral to Modern English weird, which retains its original meaning only dialectically.

The cognate term in Old Norse is urðr, with a similar meaning, but also personalized as one of the Norns, Urðr and appearing in the name of the holy well Urðarbrunnr in Norse mythology.

Install CLI

Install the CLI globally:

npm install -g @wyrd/cli

Check if the CLI is installed successfully:

which wyrd

Create a simple "Hello world!" program and the file name will be hello.wyrd:

# hello.wyrd

def greet(msg: Str): Str => msg
def greet(prefix: Str, msg: Str): Str do
  prefix.concat("! ").concat(msg)
end

greet("Hello", "Wyrd is awesome!")
greet("Wyrd is created by Alexius!")

Run the program:

wyrd -e hello.wyrd

It should compile into hello.js file with the following content:

function greet(msg) {
  return msg;
}

function greet_1(prefix, msg) {
  return prefix.concat('! ').concat(msg);
}

greet_1('Hello', 'Wyrd is awesome!');
greet('Wyrd is created by Alexius!');

Congratulations! You've just compiled your first Wyrd program!

You can also view the wyrd-cli repository for more information about the usage of CLI.

@wyrd/cli is in early development, there will be more features released such as more compilation options. (e.g. the minify option which compiles the minified version of the program)

Table of Content [WIP]

  • Variable Declarations
    • Constant Declaration
    • Mutable Variables Declaration
    • "maybe" Types Declaration
  • Built-in Types
    • Primitives
      • Numbers, Strings and Booleans
      • Concept of "Empty" - Null
    • Lists
      • List Literal
      • Encourages Homogeneous Typed List
  • Arithmetics
    • Arithmetic Expressions
    • Precedence
    • Prioritization
  • Logical Expressions
    • Comparison Operators
    • Comparison Operators Accept Identical Types Only
    • Logical Chaining
  • Conditional Expressions
    • Basic Syntax
      • "One-Liner" If-Arrow Expression
      • "Single-Line-Block" If-Then Expression
      • "Multi-Line-Block" If-Do Expression
    • Conditional Expression Returns Value
    • If-Condition Must Receive Boolean Type
    • Return Type of Each Branch Must Be Identical
    • Conditional Expression Without Else Part Returns "Maybe" Types
  • Function Declaration
    • Components of Function's Declaration
    • Declaration Syntax
      • "Do-Block" Declaration
      • "One-Liner Arrow" Declaration
      • Functions Without Arguments
      • Returned Result Type Checking
    • Function Overriding
      • Function Redeclaration is Prohibited
      • Overriding Function
      • Before and After Override Function
      • Allows Change of Output Types
    • Function Overloading
      • Identical Function Name with Different Arguments Pattern
      • Overriding Overloaded Function
  • Method Invocation (Legacy)
  • Functions (Legacy)
  • Comment (Legacy)

Supported Syntax Rules

Method Invocation

Wyrd Code

# Builtin Methods for Primitives
"Hello world".repeat(3)
"Wyrd Lang is Awesome".upcase()
(1 + 2 * 3).toStr()

# Chained Invocation
"Hello".concat(" world").concat(", Wyrd-Lang!")

# Invocation as Parameter
"Hello".concat(" world".concat(", Wyrd-Lang!"))

Compiled Result

('Hello world').repeat(3);
('Wyrd Lang is Aweseom').toUpperCase();
(1 + (2 * 3)).toString();
('Hello').concat(' world').concat(' , Wyrd-Lang!');
('Hello').concat((' world').concat(' , Wyrd-Lang!'));

Function Invocation

Wyrd Code

funcA("Hello world")
funcB(1, 2, 3)
funcC(1, 2, funcD(3, 4), 5)
funcE(1, funcF(2, 3, funcG(4)), 5)
funcI(1, (funcJ(2, 3) + 4) * funcK(5))
funcL(1 / (funcM(2, 3) - 4), 5)
funcN((1 - funcO(2) * 3) / 4, funcP(5))

Compiled Result

funcA('Hello world');
funcB(1, 2, 3);
funcC(1, 2, funcD(3, 4), 5);
funcE(1, funcF(2, 3, funcG(4)), 5);
funcI(1, (funcJ(2, 3) + 4) * funcK(5));
funcL(1 / (funcM(2, 3) - 4), 5);
funcN((1 - (funcO(2) * 3)) / 4, funcP(5));

Comment

Wyrd Code

foo = 123 # Singleline comment

##
Multiline comment
##

bar = ## Comment between expression ## 456

Compiled Result

const foo = 123;
const bar = 456;

Maintainers