Skip to content

raihanaza/YeOldeDragon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ye Olde Dragon

yeoldedragon logo

Introduction

Ye Olde Dragon is a statically-typed, object-oriented scripting language whose name was inspired by its parent languages, Python🐉, Javascript 📜, and Swift (like a dragon 🏃‍♂️💨). We intend to bring together the best of all three worlds to create a highly effective and readable language that combines our favorite features and strengths from each. Ye Olde Dragon’s easily understandable syntax makes it an accessible language for beginners and experienced programmers alike, due to its powerful and versatile functionalities.

Ye Olde Dragon is brought to you by Raihana Zahra, Lauren Campbell, Cecilia Zaragoza, and Z Anderson.

Features

  • .yod File Extension
  • Static and strong typing
  • Manifest typing
  • Ternary Conditional Statement
  • Truthy/Falsy types
  • Switch statements without fall-through

Types

Name Type
YeOldeDragon JavaScript
string String
int Number
float Number
boolean Boolean
zilch null, undefined

Data Structures

Structure JavaScript Syntax dragonCafe Syntax
Lists [a, b, c, d] [dragon, dragin, dragen]
Objects { 'a': 'b', 'c': 'd' } { "dragon": "a", "drugon": "b" }

Operators

Operator Symbol Type Compliance
Optional Chaining ?. Object
Optional Type ? All
Ternary Operator ?? All
Addition + Int, Float, String
Subtraction - Int, Float
Multiplication * Int, Float, String, List
Division / Int, Float
Increment ++ Int, Float
Decrement -- Int, Float
Exponentiation ^ Int, Float
Modulus % Int, Float
Greater Than > Int, Float
Greater Than or Equal To >= Int, Float
Less Than < Int, Float
Less Than or Equal To <= Int, Float
Equal To == All
NOT Equal To != All
Boolean OR `
Boolean AND && Boolean
Boolean NOT ! Boolean, List
Attributor . Object
List Indexer [] List
Assignment = All

Code Examples

Here are some examples, Ye Olde Dragon on the left, JavaScript on the right.

Comments

YeOldeDragon JavaScript
~ This is a comment // This is a comment
~ This is a multiline comment
That takes up multiple lines
/* This is a multiline comment
That takes up multiple lines */

Hello World

YeOldeDragon JavaScript
proclaim("Hello, dragons!!!!"); console.log("Hello, world");

Variable Binding

YeOldeDragon JavaScript
thine gold_cups: int = 8; let goldCups = 8;
fact pi: float = 3.14159; const pi = 3.14159;

Type Conversions

YeOldeDragon JavaScript
thine beverages: int = 5; let beverages = 5;
thine beveragesButAString: string = toString(beverages); let beveragesButAString = String(beverages);

Loops

YeOldeDragonJavaScript
thine coins: [string] = [“gold”, “silver”, “bronze”];
fortill (coin in coins) {
    proclaim(“We have a “ + coin.length + “ today!”);
}
let coins = [“gold”, “silver”, “bronze”];

for (coin in coins) {
    console.log(“We have a “ + coins.length + “ today!”);
}
thine dragons: int = 10;
whilst (dragons > 0) { 
    proclaim(“There are “ + toString(dragons) + “ left in the café”);
    dragons--;
}
let dragons = 10;
while (dragons > 0) {
    console.log(“There are “ + dragons + “ left in the café”);
    dragons--;
}

Conditionals

YeOldeDragonJavaScript
doth (caféIsOpen == shall) {
    proclaim(“It is open!);
} doth not (caféIsOpen == shant) {
    proclaim(“It is closed!);
} not {
    proclaim(“Lowkey, we don’t know what happened here…”);
} 
if (caféIsOpen == true) {
    console.log(“It is open!)
} else if (caféIsOpen == false) {
    console.log(“It is closed!)
} else {
    console.log(“Lowkey, we don’t know what happened here…”)
} 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •