Wyrd
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:
Check if the CLI is installed successfully:
Create a simple "Hello world!" program and the file name will be hello.wyrd
:
Run the program:
It should compile into hello.js
file with the following content:
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 and Constant Declarations
Constant Declaration
Variable Declaration
"maybe" Types Declaration
Primitives
Numbers, Strings and Booleans
Concept of "Empty" - Null
Lists
List Literal
Encourages Homogeneous Typed List
Arithmetic Expressions
Precedence
Prioritization
Comparison Operators
Comparison Operators Accept Identical Types Only
Logical Chaining
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
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
Compiled Result
Function Invocation
Wyrd Code
Compiled Result
Comment
Wyrd Code
Compiled Result
Maintainers
Last updated