After the tragic loss of the Custom Hotel, we wanted to dedicate our customizable language to the fallen Westchester landmark. Much like the Custom Hotel, we want our language to appeal to everyone in the community and foster an environment where people can come together to share their unique version of the language. To make this possible, Custom features keywords that you define in a customizable JSON. Each person's version of Custom is truly their own. When you see "CUSTOM," you know you are home.
-Statically-typed, object-oriented programming language
-Every keyword can be customized in the ./custom/customConfig.json
file
-Data structures such as arrays, sets, and dictionaries
-Setting a keyword to "June" causes a compile error ("Hotel June" is the inferior successor to "Custom Hotel")
https://github.com/Booker-M/Custom/blob/main/grammar/customGrammar.js
Types:
"string", "bool", "int", "float"
Keywords:
"if", "else", "return", "print", "for", "while", "in", "true", "false"
Change them to whatever you desire!
JavaScript | Default | Custom |
---|---|---|
let x = 1 |
int x = 1 |
decimalBegone x = 1 |
JavaScript | Custom |
|
|
In order of lowest to highest precedence:
Operator | Example |
---|---|
">" | ">=" | "==" | "!=" | "<" | "<=" | return x < y |
"||" | "&&" | return(true && false) |
"+" | "-" | int x = 4 + 20 |
"*" | "/" | "%" | float x = 6 % 9 |
"!" | return(!true) |
"-" | int x = -1 |
"^" | float y = 1^100 |
Array:
float[] probabilities = [0.1, 0.4, 0.5]
int[][] nestedArrays = [[1,2], [3,4], [5,6]]
Arrays allow multiples of the same value.
Set:
string{} cheese = {"brie", "cheddar", "mozzarella", "gouda"}
bool{}{} nestedSets = {{true,false}, {false}, {true}}
Dictionary:
<string, int> playersAndScores = {"Anthony" : 1, "Steve" : -1, "Gerry" : 3}
<string, <string, string>> nestedDicts = {"outer key" : {"inner key" : "inner value"}}
<string[]{}, <string[], string>> dicts = {{["this"], ["can"]} : {["get", "pretty"] : "confusing"}}
Each value in a set or key in a dictionary must be unique.
For Loop:
JavaScript | Custom |
|
|
While Loop:
JavaScript | Custom |
|
|
//this can say whatever you want!
/* this can
also say
whatever
you want! */
{
"if": "maybe",
"else": "yolo",
"for": "fosho",
"while": "whileWhileWhile",
"in": "within",
"print": "gimme",
"return": "sendIt",
"length": "whatsDaSize",
"true": "facts",
"false": "nawMan",
"string": "letterz",
"int": "decimalBegone",
"float": "floatYoBoat",
"bool": "boolin",
"void": "darkness"
}
{
"if": "iHaveSomethingToSay",
"else": "BECAUSEIMONFUCKINGVACATION",
"for": "openHerUp",
"while": "wylin",
"in": "thatsSOinRn",
"break": "GTFO",
"print": "supLilBitch",
"return": "andThemsTheFacts",
"length": "howMuchLonger",
"true": "trueShit",
"false": "fraudulentAssBitch",
"string": "wordz",
"int": "digitz",
"float": "longz",
"bool": "boolz",
"void": "leftOnRead"
}
let breeds = ["cat", "armadillo", "dog", "snake"]
let names = ["Leslie", "Ben","Andy","April"]
for (let i=0; i < breeds.length; i++) {
console.log (names[i] + " is a " + breeds[i] + "!")
}
string[] breeds = ["cat", "armadillo", "dog", "snake"]
string[] names = ["Leslie", "Ben","Andy","April"]
for (int i=0; i < length(breeds); i++) {
print (names[i] + " is a " + breeds[i] + "!");
}
cuerda[] razas = ["gata", "armadillo", "perro", "serpiente"]
cuerda[] nombres = ["Leslie", "Ben","Andy,"April"]
por (ent i=0; i < tamaño(razas); i++) {
imprime (nombres[i] + " es un/una " + razas[i] + "!");
}
chaine[] races = ["chat", "tatou", "chien", "serpent"]
chaine[] noms = ["Leslie", "Ben","Andy,"April"]
pour (ent i=0; i < dimension(races); i++) {
imprimez (noms[i] + " cette un/une " + races[i] + "!");
}
function fibonacci(n) {
if ((n < 0)) {
console.log("Number cannot be negative.");
} else if ((n === 0)) {
return 1;
} else if ((n === 1)) {
return 1;
} else {
return (fibonacci((n - 1)) + fibonacci((n - 2)));
}
}
fibonacci(3);
${languageConfig.int} fibonacci (${languageConfig.int} n) {
${languageConfig.if}(n<0) {
${languageConfig.print}('Number cannot be negative.')
}
${languageConfig.else} ${languageConfig.if} (n == 0) {
${languageConfig.return}(1)
}
${languageConfig.else} ${languageConfig.if} (n == 1) {
${languageConfig.return}(1)
}
${languageConfig.else} {
${languageConfig.return}(fibonacci(n-1) + fibonacci(n-2))
}
}
fibonacci(3)
function main(x, y) {
if ((x < y)) {
console.log("please work");
} else if ((x > y)) {
console.log("cry");
} else {
console.log("cry more");
}
return 1;
}
${languageConfig.int} main (${languageConfig.int} x, ${languageConfig.int} y) {
${languageConfig.if}(x < y) {
${languageConfig.print}('please work')
}
${languageConfig.else} ${languageConfig.if}(x > y) {
${languageConfig.print}('cry')
}
${languageConfig.else} {
${languageConfig.print}('cry more')
}
${languageConfig.return} 1;
}