Skip to content

Sweaterdog/YankoviC

Repository files navigation

🎡 YankoviC Programming Language v1.1.1

A Programming Language for those who "Dare to be stupid"

Welcome to YankoviC, the most ridiculously awesome programming language inspired by the legendary "Weird Al" Yankovic! YankoviC combines the power of structured programming with the whimsy of polka music and the humor of the world's greatest musical parodist.

βœ… What's Working:

  • Complete CLI and IDE - Full development environment with AI assistant
  • Graphics Programming - UHF graphics library with animations and games
  • Web Development - Like_a_Server library with real HTTP server functionality
  • Math Library - Comprehensive Albuquerque math functions
  • File Management - Project structure with examples and documentation
  • Cross-Platform - Works on Windows, macOS, and Linux

πŸŽͺ Table of Contents

πŸš€ Quick Start

// Your first YankoviC program
spatula want_a_new_duck() {
    perform_a_parody("Welcome to YankoviC! Dare to be stupid!\n");
    twinkie_wiener_sandwich 27;
}

🎯 Installation & Setup

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

Git may lock your access to the code / folders in the project! In that case you must download the ZIP manually instead of running git clone Run the following command to install all dependencies, set up the environment, and add YankoviC to your PATH for global CLI use:

./install.sh

This installer only works for Linux (Maybe MacOS idk), windows users will have to open it up and do it all manually

To remove from PATH

./uninstall.sh

Starting the Accordion IDE

You can run the accordion anywhere!

yankovic --accordion

CLI Usage

You can now run YankoviC programs globally using:

yankovic program.yc

Help

If you need to figure out something with YankoviC, use the help command!

yankovic --help

Demos

The examples folder has plenty of examples, but if you want to see the full power of YankoviC, run this!

yankovic --demo

πŸ†• Latest Features - v1.1.0 Release

🌐 Web Development Ready!

YankoviC now includes a complete web development stack:

#eat like_a_server.hat

spatula want_a_new_duck() {
    // Start a real HTTP server
    amish_barn_raising(3000);
    
    // Set up routes  
    amish_buggy_trail_get("/", "welcome_page");
    amish_barn_delivery_post("/api/data", "handle_data");
    
    // Keep server running
    polka (its_a_fact) {
        jeopardy (amish_barn_still_standing()) {
            wait_for_a_moment(1000);
        }
    }
    
    twinkie_wiener_sandwich 27;
}

Real HTTP Server Features:

  • βœ… GET, POST, PUT, DELETE routes
  • βœ… JSON and HTML responses
  • βœ… CORS support
  • βœ… Middleware/helpers
  • βœ… Session management
  • βœ… Database operations

🎨 Enhanced Graphics Programming

#eat UHF.hat

spatula want_a_new_duck() {
    start_the_show(800, 600, "My Game");
    
    polka (!the_shows_over()) {
        roll_the_camera();
        
        // Draw animated graphics
        pick_a_hawaiian_shirt(AL_RED);
        draw_a_spamsicle(100, 100, 50, 50);
        
        // NEW: Display images and play media
        fat_frame("al.jpeg", 200, 100, 400, 400);
        Lossless_Laughter("background_music.mp3", "audio");
        
        that_is_a_wrap();
    }
    
    twinkie_wiener_sandwich 27;
}

πŸ”§ Improved CLI

  • Global Installation: yankovic program.yc works anywhere
  • Better Error Messages: More helpful debugging information
  • Cross-Platform: Works on Windows, macOS, and Linux
  • Graphics Modes: PNG export, Electron windows, ASCII art, headless

οΏ½ Organized Project Structure

YankoviC/
β”œβ”€β”€ πŸ“„ README.md              # Main documentation  
β”œβ”€β”€ πŸ“„ WORDS.md               # Complete language reference
β”œβ”€β”€ πŸ“„ UHF_CHANNELS.md        # Graphics mode documentation
β”œβ”€β”€ πŸ”§ install.sh             # Automated installer
β”œβ”€β”€ πŸš€ yankovic               # Global CLI command
β”œβ”€β”€ πŸ“ backend/               # Backend server
β”œβ”€β”€ πŸ“ frontend/              # Web IDE interface  
β”œβ”€β”€ πŸ“ electron/              # Desktop app components
└── πŸ“ examples/              # Working example programs
    β”œβ”€β”€ like_a_server/        # βœ… Web server examples
    β”œβ”€β”€ weird_wide_web/       # βœ… Client-side web development
    β”œβ”€β”€ uhf_graphics/         # βœ… Graphics programming
    β”œβ”€β”€ albuquerque_math/     # βœ… Mathematics examples
    └── basic/                # βœ… Language fundamentals

πŸ§ͺ All Examples Tested & Working

  • βœ… Web Server: Real HTTP server with routes and endpoints

  • βœ… Graphics: Animations, games, and interactive UIs

  • βœ… Math: Complex calculations and algorithms

  • βœ… Basic: Core language features and syntax

  • βœ… Web Development: Client-side page generation

  • βœ… Multimedia: Image display and audio/video playback

  • Improved CLI Output Handling: The cli_output folder is now only created in PNG mode.

  • Updated Web Server Example: The amish_web_server.ycw example now uses a polka loop to keep the server running.

  • Streamlined Installation: The install.sh script now handles all setup steps, including adding YankoviC to the PATH.

🎼 Language Syntax

Basic Program Structure

Every YankoviC program must have a main function called want_a_new_duck:

spatula want_a_new_duck() {
    // Your code here
    twinkie_wiener_sandwich 27; // Return success
}

Data Types

YankoviC uses Weird Al-themed data types:

Type Description Example
spatula Integer numbers spatula count = 42;
lasagna Floating-point numbers lasagna price = 3.14;
lyric Single character lyric grade = 'A';
verse Text strings verse song = "Eat It";
horoscope Boolean values horoscope is_weird = its_a_fact;
accordion_solo Arrays/collections accordion_solo items;

Boolean Values:

  • its_a_fact = true
  • total_baloney = false

Variable Declarations

// Mutable variables
spatula age = 25;
verse name = "Alfred";

// Immutable variables (constants)
stupid spatula MAX_POLKAS = 100;
stupid verse ALBUM_NAME = "Dare to be Stupid";

Functions

// Function with return type and parameters
verse make_parody(verse original, spatula intensity) {
    verse result = "β™ͺ " + original + " β™ͺ";
    twinkie_wiener_sandwich result;
}

// Function call
spatula want_a_new_duck() {
    verse my_song = make_parody("Beat It", 11);
    perform_a_parody("New song: %verse\\n", my_song);
    twinkie_wiener_sandwich 27;
}

Control Flow

If Statements (Jeopardy):

jeopardy (age >= 18) {
    perform_a_parody("You're an adult!\\n");
} another_one {
    perform_a_parody("Still a kid!\\n");
}

For Loops (Hardware Store):

hardware_store (spatula i = 0; i < 10; i = i + 1) {
    perform_a_parody("Count: %spatula\\n", i);
}

Game Loops (Polka):

// Frame-based animation loop
polka (!the_shows_over()) {
    roll_the_camera();
    // Draw stuff here
    that_is_a_wrap();
}

Comments

// Single-line comments
/* Multi-line
   comments */

// Comments can appear anywhere, even above import statements!
// This is totally fine:
#eat "my_library.hat"

Operators

Operator Description Example
+ - * / % Arithmetic result = a + b * c % d;
== != < > <= >= Comparison jeopardy (x == 42)
&& ! Logical jeopardy (x > 0 && y < 10)
= Assignment x = 5;

πŸ“š Standard Libraries

UHF Graphics Library

Import with: #eat <UHF.hat>

Window Management:

start_the_show(800, 600, "My Awesome Window"); // Create window
cancel_the_show();                            // Close window
horoscope over = the_shows_over();            // Check if window closed

Drawing Functions:

roll_the_camera();                     // Start new frame
paint_the_set(YELLOW_MUSTARD);         // Set background color
pick_a_hawaiian_shirt(ORANGE_CHEESE);  // Set draw color
draw_a_big_ol_wheel_of_cheese(x, y, radius);  // Draw circle
draw_a_spamsicle(x, y, width, height); // Draw rectangle
that_is_a_wrap();                      // End frame

Built-in Colors:

  • YELLOW_MUSTARD - Classic yellow
  • ORANGE_CHEESE - Bright orange
  • TWINKIE_GOLD - Golden yellow
  • SKY_BLUE_FOR_YOU - Light blue

Animation Loop:

#eat <UHF.hat>

spatula want_a_new_duck() {
    start_the_show(800, 600, "Bouncing Ball");
    set_polka_speed(60); // 60 FPS
    
    spatula x = 100;
    spatula dx = 5;
    
    polka (!the_shows_over()) {
        roll_the_camera();
        paint_the_set(SKY_BLUE_FOR_YOU);
        pick_a_hawaiian_shirt(ORANGE_CHEESE);
        draw_a_big_ol_wheel_of_cheese(x, 300, 50);
        
        x = x + dx;
        jeopardy (x > 750 || x < 50) {
            dx = -dx;
        }
        
        that_is_a_wrap();
    }
    twinkie_wiener_sandwich 27;
}

Note on 3D Support: Currently, UHF only supports 2D rendering. 3D support might be added in future versions if there's demand!

Weird Math Library

Import with: #eat <albuquerque.hat>

Functions:

spatula random_spatula();                    // Random number 0-99
lasagna sin(lasagna angle);                  // Sine function
lasagna cos(lasagna angle);                  // Cosine function
spatula yoda(spatula a, spatula b);          // Modulus operation (remainder)
// More functions coming in future versions!

πŸ“ File Management & Imports

Hat Files (.hat)

Hat files are YankoviC's library format.

// my_utilities.hat
on_the_menu verse make_joke(verse setup) {
    verse punchline = setup + "... NOT!";
    twinkie_wiener_sandwich punchline;
}

private_stash spatula secret_number() {
    twinkie_wiener_sandwich 42; // Only visible within this file
}

Import Syntax

#eat <UHF.hat>                    // Built-in library
#eat "lib/my_utilities.hat"       // Custom library from the projects folder
#eat "./helpers/math_stuff.hat"   // Relative path

Visibility Modifiers

  • on_the_menu - Public functions (exported)
  • private_stash - Private functions (internal only)
// In a .hat file:
on_the_menu verse public_function() {
    twinkie_wiener_sandwich "Everyone can use this!";
}

private_stash verse internal_helper() {
    twinkie_wiener_sandwich "Only this file can use this";
}

🏒 The Accordion IDE

The Accordion IDE provides a complete development environment for YankoviC programming.

File Explorer ("Filing Cabinet")

  • πŸ“ Create folders: Right-click β†’ "New Folder"
  • πŸ“„ Create files: Right-click β†’ "New File"
  • πŸ—‘οΈ Delete items: Click the delete button (with confirmation)
  • πŸ”„ Refresh: Auto-refreshes when files change
  • πŸ“‚ Browse projects: Navigate through your YankoviC projects

Code Editor

  • Syntax highlighting for YankoviC keywords
  • Auto-save functionality
  • Error highlighting for syntax issues
  • Multi-file editing with tabs

Console

  • Program output from perform_a_parody() calls
  • Error messages with helpful details
  • Execution status with exit codes
  • Interactive feedback for running programs

AI Assistant

  • Code help and suggestions
  • Tab Autocomplete using pollinations, so you can code with ease
  • Syntax explanations
  • Debugging assistance with the Al-manac
  • Best practices recommendations

🎨 Graphics Programming with UHF

UHF (Ultra High Frequency) is YankoviC's graphics library, inspired by Weird Al's movie "UHF". Here's a complete graphics program:

#eat <UHF.hat>

spatula want_a_new_duck() {
    // Create a window
    start_the_show(800, 600, "Weird Al's Graphic Adventure");
    set_polka_speed(30); // 30 FPS
    
    spatula frame_count = 0;
    
    polka (!the_shows_over()) {
        roll_the_camera();
        
        // Animated background
        paint_the_set(TWINKIE_GOLD);
        
        // Draw spinning cheese wheels
        spatula angle = frame_count * 5;
        spatula center_x = 400;
        spatula center_y = 300;
        
        hardware_store (spatula i = 0; i < 8; i = i + 1) {
            spatula x = center_x + cos(angle + i * 45) * 150;
            spatula y = center_y + sin(angle + i * 45) * 150;
            
            pick_a_hawaiian_shirt(ORANGE_CHEESE);
            draw_a_big_ol_wheel_of_cheese(x, y, 30);
        }
        
        frame_count = frame_count + 1;
        that_is_a_wrap();
    }
    
    twinkie_wiener_sandwich 27;
}

πŸ“– Example Programs

Dare To Be Stupid

spatula want_a_new_duck() {
    perform_a_parody("Hello, Weird World!\\n\\nDare to be stupid!");
    twinkie_wiener_sandwich 27;
}

Random Number Generator

#eat "lib/random_helpers.hat"

spatula want_a_new_duck() {
    verse numbers = generate_random_list(5, 1, 100);
    perform_a_parody("Random numbers: %verse\\n", numbers);
    twinkie_wiener_sandwich 27;
}

Graphics Animation

#eat <UHF.hat>

spatula want_a_new_duck() {
    start_the_show(400, 300, "Polka Dots");
    set_polka_speed(60);
    
    spatula dot_x = 200;
    spatula dot_y = 150;
    
    polka (!the_shows_over()) {
        roll_the_camera();
        paint_the_set(SKY_BLUE_FOR_YOU);
        
        pick_a_hawaiian_shirt(YELLOW_MUSTARD);
        draw_a_big_ol_wheel_of_cheese(dot_x, dot_y, 25);
        
        // Move the dot randomly
        dot_x = dot_x + (random_spatula() % 21) - 10;
        dot_y = dot_y + (random_spatula() % 21) - 10;
        
        // Keep dot on screen
        jeopardy (dot_x < 25) dot_x = 25;
        jeopardy (dot_x > 375) dot_x = 375;
        jeopardy (dot_y < 25) dot_y = 25;
        jeopardy (dot_y > 275) dot_y = 275;
        
        that_is_a_wrap();
    }
    
    twinkie_wiener_sandwich 27;
}

TODO List

This is a list for things that I need to do, but feel free to open a PR with the feature!

Feature Description Why
Reverse Interpeter Converting Javascript, HTML, CSS, and Python files to YankoviC Why not port everything to YankoviC?
Try / Except Add Try / Except with do_i_creep_you_out and catching with creeped_out Everything has to work, so a lot of conditionals fail
Sleep Add a stop_forwarding_that_crap to waste time You will need to have delays eventually
Async Add saga_begins to start an async, awaited with something You need async and synchronous stuff
More I am sure I am tired, feel free to add whatever you want. If it is Weird Al inspired I will probably merge.

About

A programming language with a similar syntax to C / C++, but for "Weird Al" Yankovic

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages