jizz-lang
v1.4.5
Published
JIZZ Programming Language - A modern, expressive programming language with clean syntax frfr
Downloads
1,563
Maintainers
Readme
JIZZ Programming Language
██╗██╗███████╗███████╗
██║██║╚══███╔╝╚══███╔╝
██║██║ ███╔╝ ███╔╝
██ ██║██║ ███╔╝ ███╔╝
╚█████╔╝██║███████╗███████╗
╚════╝ ╚═╝╚══════╝╚══════╝
JIZZ is a modern programming language designed for developers with a sense of humor and a flair for the unconventional. With its unique "brainrot" syntax inspired by internet culture and memes, JIZZ offers a refreshing and entertaining approach to coding while maintaining powerful functionality.
BrainRot Philosophy
JIZZ embraces the "brainrot" philosophy, replacing traditional programming terms with internet slang and meme-inspired keywords:
- Use
frfr
instead oftrue
(for real for real) - Use
cap
instead offalse
(that's cap/no cap) - Use
skibidi
instead ofwhile
for loops - Use
too
instead offor
in loop constructs - Use
buss
for printing to console (bussin')
These unconventional keywords make JIZZ code instantly recognizable and add a layer of humor to your programming experience.
Quick Start
# Install globally
npm install -g jizz-lang
# Run a file
jizz run your-file.jizz
# Start REPL
jizz repl
# View examples
jizz examples
# Install VSCode syntax highlighting
jizz vscode
# Update to latest version
npm update -g jizz-lang
VSCode Syntax Highlighting
Make your JIZZ code pop with our official "JIZZ Brainrot Syntax Highlighter" extension for Visual Studio Code.
Option 1: Install via Marketplace (recommended)
- Open VS Code
- Click the Extensions icon in the sidebar (or press Ctrl+Shift+X / Cmd+Shift+X)
- Search for "JIZZ Brainrot"
- Click "Install" on the "JIZZ Brainrot Syntax Highlighter" by JasstejSingh
Or just run this command in VS Code:
ext install JasstejSingh.jizz-language
Option 2: Install via Command Line
If you've installed JIZZ globally:
jizz vscode
The extension provides:
- Syntax highlighting for all JIZZ keywords (
frfr
,cap
,typeshii
, etc.) - Custom file icons for .jizz files in the file explorer
- Proper color-coding for strings, numbers, and comments
- Bracket matching and code folding
To enable the custom file icons:
- Go to File → Preferences → File Icon Theme (or Code → Preferences → File Icon Theme on macOS)
- Select "JIZZ Icons" from the list
Features
- Meme-inspired syntax for maximum entertainment
- Strong type inference
- Built-in string manipulation functions
- Interactive REPL environment
- Detailed error messages with line numbers
- Function declarations and calls
- If-else statements with elif support
- Variables and constants
- Object literals with property access
- Rich standard library
- Custom boolean keywords (
frfr
for true,cap
for false) - Custom loop constructs (
skibidi
andtoo
loops) - User input with ask() function
- Type conversion functions (int, str)
- Logical operators (AND, OR, NOT) with short-circuit evaluation
- Comparison operators for complex conditions
- Comprehensive array operations with built-in methods
- Ternary operator for concise conditional expressions
- JizzMath module with mathematical functions and constants
- Full support for negative numbers
- Error handling with try-catch and throw
Array Operations
JIZZ provides a comprehensive set of array operations that let you manipulate arrays with ease. These operations are designed to be familiar to developers coming from other languages, while maintaining the JIZZ philosophy.
Creating and Accessing Arrays
// Create an array
ts numbers = [1, 2, 3, 4, 5];
// Access elements by index
ts firstElement = numbers[0]; // 1
ts lastElement = numbers[4]; // 5
// Modify elements
numbers[2] = 99;
buss(numbers); // [1, 2, 99, 4, 5]
// Get array length
ts length = arrayLength(numbers); // 5
Array Manipulation Methods
JIZZ provides the following methods for array manipulation:
push(array, element1, element2, ...)
Adds one or more elements to the end of an array and returns the new length.
ts arr = [1, 2, 3];
push(arr, 4); // Adds a single element
buss(arr); // [1, 2, 3, 4]
push(arr, 5, 6, 7); // Add multiple elements
buss(arr); // [1, 2, 3, 4, 5, 6, 7]
pop(array)
Removes the last element from an array and returns that element.
ts arr = [1, 2, 3, 4];
ts last = pop(arr); // Removes and returns 4
buss(arr); // [1, 2, 3]
shift(array)
Removes the first element from an array and returns that element.
ts arr = [1, 2, 3];
ts first = shift(arr); // Removes and returns 1
buss(arr); // [2, 3]
unshift(array, element1, element2, ...)
Adds one or more elements to the beginning of an array and returns the new length.
ts arr = [3, 4, 5];
unshift(arr, 1, 2); // Adds elements to the beginning
buss(arr); // [1, 2, 3, 4, 5]
join(array, separator)
Joins all elements of an array into a string using the specified separator.
ts arr = ["Hello", "JIZZ", "World"];
ts str = join(arr, " "); // Joins with space
buss(str); // "Hello JIZZ World"
ts csv = join(arr, ","); // Joins with comma
buss(csv); // "Hello,JIZZ,World"
includes(array, element)
Determines whether an array includes a certain element, returning a boolean value.
ts arr = [10, 20, 30, 40];
ts hasValue = includes(arr, 30); // frfr
ts noValue = includes(arr, 50); // cap
reverse(array)
Reverses an array in place and returns the array.
ts arr = [1, 2, 3, 4, 5];
reverse(arr);
buss(arr); // [5, 4, 3, 2, 1]
Complex Array Operations
JIZZ arrays can be used for more complex operations like:
Multidimensional Arrays
// 2D array (matrix)
ts matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
// Access nested elements
ts element = matrix[1][2]; // 6
// Modify nested elements
matrix[0][2] = 30;
Arrays of Objects
// Array of person objects
ts people = [
{ name: "Alice", age: 30 },
{ name: "Bob", age: 25 },
{ name: "Charlie", age: 35 }
];
// Access object properties in arrays
buss(people[1].name); // "Bob"
// Modify object properties
people[0].age = 31;
Dynamic Arrays
// Create an empty array and add elements dynamically
ts dynamicArray = [];
push(dynamicArray, "first");
push(dynamicArray, "second");
// Create sparse arrays (with gaps)
ts sparse = [];
sparse[0] = 10;
sparse[5] = 50;
buss(sparse); // [10, undefined, undefined, undefined, undefined, 50]
Development
If you want to contribute to JIZZ or build it from source, follow these steps:
Prerequisites
- Node.js (v14 or higher)
- npm (v6 or higher)
Setting Up the Development Environment
# Clone the repository
git clone https://github.com/JZOnTheGit/.jizz.git
cd .jizz
# Install dependencies
npm install
# Build the project (TypeScript compilation)
npm run build
# Build everything (TypeScript, VSCode extension, run tests)
npm run build-all
Available Scripts
npm run build
- Compile TypeScript to JavaScriptnpm run clean
- Remove build artifactsnpm test
- Run test suitenpm run build-all
- Complete build process including VSCode extensionnpm run package-vscode
- Package the VSCode extensionnpm run vscode-install
- Install the VSCode extension locally
Testing Your Changes
After making changes, you can run the tests to ensure everything works:
npm test
Or test a specific JIZZ file:
npm run build && node dist/src/cli.js run your-test-file.jizz
Language Features
Variables and Constants
ts x = 10;
const PI = 3.14159;
// Booleans use frfr and cap
ts isValid = frfr; // true
ts isFake = cap; // false
if (isValid == frfr) {
buss("This is frfr!");
}
String Operations
ts name = "John";
ts greeting = "Hello, " + name + "!";
buss(greeting); // Output: Hello, John!
// String methods
buss(String_length(greeting)); // Output: 12
buss(String_toUpperCase(greeting)); // Output: HELLO, JOHN!
buss(String_substring(greeting, 0, 5)); // Output: Hello
// Escape sequences in strings
buss("Line 1\nLine 2"); // Outputs two lines
buss("Name:\tJohn"); // Outputs with tab spacing
Objects
ts person = {
name: "John",
age: 30,
isStudent: cap,
city: "New York"
};
buss(person); // Output: { name: "John", age: 30, isStudent: false, city: "New York" }
Functions
typeshii add(a, b) {
ts result = a + b;
buss("Sum is:", result);
return result;
}
add(5, 3); // Output: Sum is: 8
Control Flow
ts age = 25;
if (age >= 21) {
if (age < 30) {
buss("Young adult");
} else {
buss("Adult");
}
} else {
buss("Minor");
}
// Using boolean keywords
ts canDrive = age >= 16 ? frfr : cap;
if (canDrive == frfr) {
buss("Can drive!");
}
User Input and Type Conversion
// Basic input
ts name = ask("What's your name? ");
buss("Hello, " + name + "!");
// Input with type conversion
ts age = int(ask("How old are you? "));
if (age >= 18) {
buss("You're an adult!");
} else {
buss("You're still young!");
}
// Type conversion examples
ts numStr = "42";
ts num = int(numStr); // Convert string to integer
ts strNum = str(num); // Convert number to string
ts boolStr = str(frfr); // Converts to "frfr"
ts capStr = str(cap); // Converts to "cap"
Logical Operators
// NOT operator (!)
ts isActive = frfr;
ts isInactive = !isActive; // false
buss("!true =", !isActive); // Output: !true = false
// AND operator (&&)
ts isAdult = frfr;
ts hasID = frfr;
ts canBuyAlcohol = isAdult && hasID; // true
buss("Adult AND has ID:", canBuyAlcohol);
// OR operator (||)
ts hasTicket = cap;
ts isVIP = frfr;
ts canEnter = hasTicket || isVIP; // true
buss("Has ticket OR is VIP:", canEnter);
// Comparison with logical operators
ts age = 25;
ts height = 180;
if (age > 18 && height > 160) {
buss("Can ride all attractions!");
}
// Short-circuit evaluation
ts result = cap && functionShouldNotRun(); // Function is not called
buss("Short-circuit AND:", result); // false
result = frfr || functionShouldNotRun(); // Function is not called
buss("Short-circuit OR:", result); // true
Ternary Operator
JIZZ supports the conditional (ternary) operator for concise conditional expressions:
// Basic ternary syntax
ts max = a > b ? a : b;
// Nested ternary for multiple conditions
ts message = age < 18 ? "Minor" : age < 65 ? "Adult" : "Senior";
// With function calls
ts greeting = hasPermission ? getVIPMessage() : getRegularMessage();
// Custom absolute value function using ternary
typeshii abs(n) {
return n < 0 ? -n : n;
}
Negative Numbers
JIZZ fully supports negative numbers in all contexts:
// Basic negative numbers
ts a = -10;
buss("Negative value:", a);
// Expressions with negative numbers
ts result = 5 + -3; // 2
ts product = -4 * 3; // -12
// Nested negation
ts doubleNegative = -(-5); // 5
// Functions with negative numbers
typeshii negate(num) {
return -num;
}
buss(negate(7)); // -7
JizzMath Module
JIZZ provides a comprehensive math library through the JizzMath module:
// Constants
buss(JizzMath.PI); // 3.141592653589793
buss(JizzMath.E); // 2.718281828459045
// Rounding functions
buss(JizzMath.floor(5.7)); // 5
buss(JizzMath.ceil(5.2)); // 6
buss(JizzMath.round(5.5)); // 6
// Absolute value
buss(JizzMath.abs(-10)); // 10
// Square root and powers
buss(JizzMath.sqrt(16)); // 4
buss(JizzMath.pow(2, 3)); // 8
// Min and max functions
buss(JizzMath.min(3, 7, 2, 9)); // 2
buss(JizzMath.max(3, 7, 2, 9)); // 9
// Random number generation
buss(JizzMath.random()); // Random number between 0 and 1
// Practical example: Pythagorean theorem
typeshii calculateHypotenuse(a, b) {
return JizzMath.sqrt(JizzMath.pow(a, 2) + JizzMath.pow(b, 2));
}
buss(calculateHypotenuse(3, 4)); // 5
Error Handling with Try-Catch
JIZZ provides robust error handling through try-catch blocks and the throw statement:
// Basic try-catch
try {
// Code that might cause an error
ts result = 10 / 0;
buss("This won't execute if an error occurs");
} catch (error) {
// Handle the error
buss("An error occurred:", error);
}
// Throwing custom errors
try {
ts age = -5;
if (age < 0) {
throw "Age cannot be negative";
}
buss("Age is valid:", age);
} catch (e) {
buss("Validation error:", e);
}
// Try-catch with functions
typeshii divideNumbers(a, b) {
try {
if (b === 0) {
throw "Division by zero is not allowed";
}
return a / b;
} catch (error) {
return "Error: " + error;
}
}
buss(divideNumbers(10, 2)); // 5
buss(divideNumbers(10, 0)); // "Error: Division by zero is not allowed"
// Nested try-catch blocks
try {
buss("Outer try block");
try {
buss("Inner try block");
throw "Inner error";
} catch (innerError) {
buss("Caught inner error:", innerError);
// Rethrow or throw a new error
throw "Rethrown from inner catch";
}
} catch (outerError) {
buss("Caught in outer catch:", outerError);
}
// Try-catch with objects
try {
throw { code: 404, message: "Not found" };
} catch (objError) {
buss("Error code:", objError.code);
buss("Error message:", objError.message);
}