Yappacino
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
Note: This page assumes that you are familiar with JavaScript, the concept of JavaScript supersets, and transpilation.
Yappacino is a JavaScript superset transpiled to JavaScript made by FaceDev featured in the video "I made a JavaScript superset" that makes you yap a lot.
Paradigm(s) | imperative, procedural, declarative, functional, same as JS |
---|---|
Designed by | FaceDev (@FaceDevStuff) |
Appeared in | 2024 |
Type system | dynamic, same as JS |
Memory system | variable-based |
Computational class | Turing complete |
Reference implementation | Yappacino |
Influenced by | JavaScript, Rust, C++, Every programming language that uses print or println or any variation, File system |
File extension(s) | .yap |
Features
Yappacino, being a JavaScript superset transpiled to JavaScript, has all of the features and syntax that JavaScript has. However, it's recommended to use the Yappacino syntax.
Types
Yappacino supports all JavaScript types, however only three types got a syntax change. This makes things seem complicated such as trying to make a function that returns a float despite there being no float type, however type annotations are just for show, so code like the following is valid.
unsynchronised constant variable PI: Integer = 3.14; // taken from yappacino/src/index.yap -> Ligature dependent variable ratify async function readDirRecursive(dir, res = [] : Ligature, Ligature) { volatile mutable variable files: Ligature = await readdir(dir); towards(i within 0..files.length) { stable mutable variable file: Ligature = files[i]; unsynchronised constant variable filePath: Ligature = join(dir, file); unsynchronised constant variable fileStat: Ligature = await stat(filePath); stipulate (file === "node_modules") continue; stipulate (fileStat.isDirectory()) { res = await readDirRecursive(filePath, res); } otherwise stipulate (file.endsWith(".yap") || file.endsWith(".🗣️")) { res.push(filePath); } } return res; }
Integers
The integer type in Yappacino is Integer
. It's not actually a "true" integer type though due to JavaScript not having an integer type, and type annotations doing literally nothing.
unsynchronised constant variable PI: Integer = 3.14159265358979; synchronised constant variable YappacinoIsBetterThanBussinX: Integer = complicated; volatile mutable variable x: Integer = 1;
Strings
Strings in Yappacino are called Ligatures. Ligatures mean a thing used for tying, but the difference should be subtle enough.
stable mutable variable hello: Ligature = "Hello, World!"; unsynchronised constant variable rawLigature: Ligature = String.raw` Bussin X Bussin GriddyCode Bussin Yappacino Bussin Wattesigma `;
Booleans
The NovemHeader
or "megabool" is an extension of JavaScript's bool
type with 9 states instead of two. When transpiled to JavaScript, the 9 states are put into the __BOOLEANS__
object/dictionary.
The basic true
and false
states are present with the addition of 7 more states. The other 7 states are just numbers ranging from 0.0001
to 0.0007
which necessitates the use of whatever the ===
and !==
operators are as well as careful handling of comparing numbers to NovemHeader
values.
Here is a table of the conversions of the NovemHeader
members to JavaScript.
__BOOLEANS__
| |
---|---|
Yappacino | JavaScript |
true
|
true
|
false
|
false
|
neither
|
0.0001
|
both
|
0.0002
|
maybe
|
0.0003
|
trueish
|
0.0004
|
falseish
|
0.0005
|
depends
|
0.0006
|
complicated
|
0.0007
|
Variables
Variables in Yappacino make you yap a lot. To declare a constant, you can do
constant variable x: Ligature = "Hello";
mutable
is used instead of constant
if you want to mutate the variable.
However for constants, you have to first specify whether it's synchronised
or unsynchronised
.
synchronised
constants when assigned a value that is the same as that of another synchronised
constant will assign its value to that constant when changed.
Example: (taken from "I made a JavaScript superset" by FaceDev)
synchronised constant variable x = "a"; synchronised constant variable y = "a"; x = { hello: true } console.log(y) // { hello: true }
For mutable
variables, there are also two keywords for it, volatile
and stable
.
Example: (taken from "I made a JavaScript superset" by FaceDev)
unsynchronised constant variable x = "a"; unsynchronised constant variable y = "a"; x = { hello: true } console.log(y) // "a"
Functions
Functions in Yappacino are declared with the fn
keyword similar to Rust. The syntax is really hard to describe so here it is:
-> returnType independent/dependent invariable/variable void/ratify function/subroutine name(arg1, arg2... argN : type1, type2... typeN)
Walking through that useful noise...
-> returnType
-> returnType
is the return type of the function since types are backwards.
independent
/dependent
An independent
function CANNOT be called while a dependent
function CAN be called.
invariable
/variable
An invariable
function CANNOT be assigned to a variable, for example:
-> Integer dependent invariable ratify function add(a, b : Integer, Integer) { return a + b; } stable mutable variable x = add(1, 1); // not allowed!
A variable
function CAN be assigned to a variable.
void
/ratify
A void
function MAY return undefined
or null
while a ratify
function doesn't.
function
/subroutine
A function is a subroutine
if it doesn't return anything, and a function
if it does.
Arguments
Function arguments are kind of unusual. First is the list of arguments, then separated by a colon :
then the list of types of the arguments in order.
Example:
-> Integer dependent variable ratify function what(a, b, c : Integer, Ligature, NovemHeader)
Classes
Classes in Yappacino can be declared and used like this.
transient/transitory classification Name { extemporize(args : types) { constructor body } -> Integer independent/dependent invariable/variable void/ratify function/subroutine name ? (args : types) { aforementioned // this } } constant variable instance = extemporize Name(args)
Let's walk through that.
transient
/transitory
A transient
class may only be instantiated once while a transitory
class can be instantiated infinitely.
Constructor
Class constructors can be made with extemporize
and has the same syntax as normal Yappacino functions for arguments.
Example:
transitory classification Ball { extemporize(x, y : Integer, Integer) { aforementioned.x = x aforementioned.y = y } }
this
In Yappacino, this
is renamed to aforementioned
. Like with other JavaScript syntaxes, this
can still be used, however is discouraged.
Example:
transitory classification Player { extemporize(x, y, health : Integer, Integer, Integer) { aforementioned.x = x aforementioned.y = y aforementioned.health = health } }
Printing
To print something in Yappacino, this syntax is used.
C:\Standard\System\io\format\print\ln(args)
This syntax also applies to objects in general as well.
JavaScript | Yappacino |
---|---|
env.config()
|
ENV:\config()
|
console.log(arg1, arg2, arg3)
|
C:\Standard\System\io\format\print\ln(arg1, arg2, arg3)
|
map.get("string")
|
MAP:\get("Ligature")
|
obj.fields.name
|
obj:\fields\name
|
Conditional Statements
Yappacino supports two conditionals, stipulate
and compeer
as if
and switch
statements.
If statements
In Yappacino, if statements are made with stipulate
and the else branches are made with otherwise
.
yappacino/src/index.yap | |
---|---|
47 48 49 50 51 52 53 |
stipulate (file === "node_modules") continue; stipulate (fileStat.isDirectory()) { res = await readDirRecursive(filePath, res); } otherwise stipulate (file.endsWith(".yap") || file.endsWith(".🗣️")) { res.push(filePath); } |
In JavaScript...
yappacino/src/backup/yapped_index.js | |
---|---|
61 62 63 64 65 66 67 |
if (file === "node_modules") continue; if (fileStat.isDirectory()) { res = await readDirRecursive(filePath, res); } else if (file.endsWith(".yap") || file.endsWith(".🗣️")) { res.push(filePath); } |
Switch statements
In Yappacino, switch statements are declared with compeer
with similar syntax to Rust.
compeer (x) { 1 => C:\Standard\System\io\format\print\ln("one"), 2 | 3 | 5 | 7 | 11 | 13 | 17 | 19 => { C:\Standard\System\io\format\print\ln("prime number"); C:\Standard\System\io\format\print\ln("this is so bussin frfr nocap"); }, nonfulfillment => { C:\Standard\System\io\format\print\ln("What the hell is this?", x); } }
The above code translates to:
switch (x) { case 1: console.log("one"); case 2: case 3: case 5: case 7: case 11: case 13: case 17: case 19: { console.log("prime number"); console.log("this is so bussin frfr nocap"); } default: { console.log("What the hell is this?", x); } }
I (raiseAfloppaFan3925) am unsure if the Yappacino transpiler adds break
keywords so if anyone knows, please fix this.
nonfulfillment
is the equivalent of default
in JavaScript.
Loops
For loops
For loops in Yappacino are quite similar to that of Rust.
towards (i within start..end) {} towards (i within start..m.end) {}
Imports
Imports in Yappacino are done through connotate
and derives
.
yappacino/src/index.yap | |
---|---|
1 2 3 |
connotate { readdir, stat, mkdir, rm } derives "node:fs/promises"; connotate { join } derives "node:path"; connotate { parseArgs } derives "util"; |
External Resources
- Yappacino on GitHub
- I made a JavaScript superset by FaceDev/face-hh