One morning, a young Khalid awoke and decided to finish his A.I assignment. “Gosh, I just hate python more than life itself” he muttered as he typed with a sour face. At that moment, he looked at the lemon pulp he has been collecting for the past 5 years due to his midnight lemon snack addiction. At that moment, he decided to call his much smarter and superior friend David to write him a language that everyone could enjoy. So, David formed a team with Brent, Julian, Justin, Raul, and Khalid with the intent to create a language for all lemon enthusiasts. The stage has been set. lemonScript was to be a self-explanatory, statically-typed, esoteric language with the sole purpose of saving people who had a sour taste in their mouth from using popular languages.
Brought to you by: Julian Arregoces,Raul Rodriguez, Brent Shafer, Justin Yee, David Sackler, Khalid Alghunaim
If you would like to learn more about lemonScript you can visit our official website: https://dsackler.github.io/lemonScript/
- Statically typed language
- Static scoping!
- Switch statements using keywords pick()
- Easily defined blocks of code seperated by the words BEGIN JUICING and END JUICING
- Declare functions with "When life gives you lemons try (return type) name()"
- Single line comments with ( *)
- Multiple line comments with ( *) (* )
- AND SO MUCH MORE TASTY FEATURES ITS A BITTER PILL TO SWALLOW TO LET GO OF THE FAMOUS PYTHON, BUT GIVE LEMONSCRIPT A TRY! ITS REFRESHING!
JavaScript | lemonScript |
---|---|
String | pulp |
Number | slice (for integers) or dontUseMeForEyeDrops (for floats) |
Boolean | taste |
const | lemonStain |
- Type mismatch
- Assignment to constant variable
- Continue/Break can only be used in a loop
- Number of arguments when calling a function
- Arguments passed into a function has the correct types
- Is callable
- Returns something
- Returns nothing
- The return type is correct
- Not inside a function
- Is a number
- Is an integer
- Is a boolean
- Is an array
- Is a dictionary
- All elements in an array has the same type
- All keys are unique
- Keys and Values have the correct type
JavaScript | lemonScript |
---|---|
let x = 10; | slice x = 10 |
let y = "Lemons are great"; | pulp y = "Lemons are great" |
let z = 4.20; | dontUseMeForEyeDrops z = 4.20 |
let a = true; | taste a = sweet |
const c = "blue"; | lemonStain pulp c = "blue" |
|
console.log("Hello, World!"); |
When life gives you lemons try (return type) *name*() BEGIN JUICING statements END JUICING | function name([param[, param,[..., param]]]) { [statements] } |
JavaScript | lemonScript |
---|---|
//this is a single line comment | ( *)this is a comment |
/*this is a multi-line comment | ( *)this is a multi-comment(* ) |
- sum = 2 + 4
- difference = 2 - 4
- multiplication = 2 * 4
- division = 4 / 2
- exponents = 4 ^ 2 *note we can change this to ** or something else
- modulus = 4 % 2
JavaScript | lemonScript |
---|---|
boolean | taste |
break | chop |
case | lemonCase |
const | lemonStain |
constructor | plant |
continue | nextLemon |
default | citrusLimon |
else | Toss the lemon and do |
else if | Keep juicing if |
extends | branches |
false | sour |
for | forEachLemon |
function | When life gives you lemons try (return type) name() BEGIN |
if | Squeeze the lemon if |
new | seed |
return | you get lemonade and ... |
static | trunk |
switch | Pick () |
true | sweet |
typeof | species |
void | noLemon |
while | Drink the lemonade while |
class | Limon |
import | receive |
If/Else |
|
if (x == 10) {
console.log(“Number is 10”)
} else if (x == 20) {
console.log(“Number is 20”)
} else {
console.log(“Number is not 10 or 20”)
} |
For Loops |
|
for (i = 0; i < 5; i++) {
console.log(“Number: ” + i)
} |
While Loops |
|
while (x > 0) {
console.log(x)
x--
} |
|
function helloWorld() {
console.log(“Hello World”)
} |
|
function add(a, b) {
return a + b
} |
|
let even = 4;
let twofoursixeight;
switch (even) {
case 2:
twofoursix = "two";
break;
case 4:
twofoursix = "four";
break;
case 6:
twofoursix = "six";
break;
default:
twofoursix = "Eight";
}
console.log(“Our result is ” + twofoursix); |
|
function fibonacci(num){
if(num == 0){
return 0;
}
if(num == 1 || num == 2){
return 1
}
return fibonacci(num - 2) + fibonacci(num - 1)
} |
|
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
getYear(){
return this.year
}
}
myCar = new Car("Ford", 2014);
class Ferrari extends Car {
constructor(year) {
this.name = "F8 Spider";
this.year = year;
}
} |