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++ |
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 has types and type annotations. However, type annotations are completely decorative and do absolutely nothing.
unsynchronised constant variable PI: Integer = 3.14;
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
The syntax for a function declaration in Yappacino is:
-> returnType independent/dependent invariable/variable void/ratify function/subroutine name(arg1, arg2... argN : type1, type2... typeN) { ... }
The types are reversed in both the function return type and the function parameter arguments.
Keyword | Meaning |
---|---|
independent
|
The function cannot be called from the program |
dependent
|
The function can be called from the program |
invariable
|
The function cannot be assigned to a variable |
variable
|
The function can be assigned to a variable |
subroutine
|
The function does not return a value |
Classes
Classes in Yappacino are made with transient/transitory classification
.
transient classification Person { extemporize (name: Ligature) { aforementioned.name = name; } -> Integer dependent invariable void async subroutine greet ? (){ C:\Standard\System\io\format\print\ln("buzz"); } }
Keyword | Meaning |
---|---|
transient
|
The class can be initialized only once (optional) |
transitory
|
(optional) |
classification
|
The class keyword
|
Methods in Yappacino are declared the same as normal functions, but with a ?
(question mark) between the method name and the parameter list.
aforementioned
is used as a replacement for this
and classes are constructed with extemporize
.
Members
The recommended way to access the member of an object in Yappacino is to use a Windows path. An example of this is printing, which in JavaScript is console.log
but in Yappacino, is:
C:\Standard\System\io\format\print\ln("helo");
For objects, the syntax is the object followed by a colon, preferably in all caps, followed by the member.
object:\level1\level2\level3
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 compiles down to:
switch (x) { case 1: console.log("one"); break; 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"); break; } default: { console.log("What the hell is this?", x); break; } }
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"; |
Proposals
This section contains the proposed language extensions and the people who proposed them.
Async/await
- GitHub: PR: Improve async/await syntax. #4
- Repo: PR repo
Proposal
This proposal improves the async/await syntax with asynchronous
/anticipate
.
CupertinoWasTaken/yappacino/src/index.yap | |
---|---|
365 366 367 368 ... 469 470 471 472 473 474 |
asynchronous function main() { unsynchronised constant variable { values }: Ligature = parseArgs({ args: Bun.argv, options: { ... anticipate saveToDist(contents, filePath, PATH); //console.log(_TYPES_CLASSES) //console.log(_TYPES_FUNCTIONS) //console.log(_TYPES_VARIABLES) } } |
External Resources
- I made a JavaScript superset by FaceDev/face-hh
- Yappacino on GitHub
- PR: Improve async/await syntax. #4