๐Ÿ—‘๏ธ TrashScript Language Documentation

What is TrashScript?

TrashScript is a joke-style scripting language that actually runs, designed to look and feel like you are coding inside a trash can. While the theme is messy and chaotic, the language itself is simple, readable, and perfect for learning how scripting languages work.

TrashScript runs entirely in your web browser using HTML + CSS + JavaScript. No downloads, no installs.

How TrashScript Works (High Level)

TrashScript has three main parts:

  1. Editor (HTML & CSS) โ€“ Where you type your TrashScript code
  2. Interpreter (JavaScript) โ€“ Reads each line and understands commands
  3. Runtime (Variables) โ€“ Stores values while the script is running

When you click THROW IT IN ๐Ÿ—‘๏ธ, the interpreter:

  • Reads the script line by line
  • Checks each command
  • Executes it immediately
  • Stops if it hits an error

This is the same basic idea used by real scripting languages.

Running TrashScript

  1. Open trashscript.html
  2. Type TrashScript code in the editor
  3. Click THROW IT IN ๐Ÿ—‘๏ธ
  4. Output appears in the output box

If TrashScript finds a bad line, it prints a garbage-style error and stops execution.

Syntax Rules

TrashScript is line-based. Each command must be on its own line.

  • Commands are lowercase
  • Variables are simple words (letters only)
  • Numbers are integers
  • Strings must be wrapped in double quotes (")

Commands

dump

Prints text or a variable value.

Examples:

  • dump "hello world"
  • dump x

yeet

Creates a variable and assigns it a number.

Syntax:

yeet variable = number 

Example:

  • yeet x = 5

add

Adds a number to an existing variable.

Syntax:

add variable number 

Example:

  • add x 10

Example Program

yeet x = 5 dump x add x 10 dump x dump "this language smells" 

Output:

5 15 this language smells 

Errors

If TrashScript encounters a problem, it stops and prints an error like:

  • "raccoon ate this line"
  • "syntax mold detected"
  • "dumpster fire"

Errors include the line number where the problem happened.

Limitations (By Design)

TrashScript is intentionally simple:

  • No loops (yet)
  • No conditions (yet)
  • Numbers only (no math expressions)
  • Runs in-browser only

These limits make it easier to understand how interpreters work.

Why TrashScript Exists

TrashScript was made to:

  • Learn how scripting languages work
  • Practice parsing and interpreting code
  • Have fun with a cursed theme
  • Turn garbage into something functional

Despite the joke theme, the core logic is real and expandable.

Future Planned Features

Possible future upgrades:

  • iftrash (conditions)
  • looptrash (loops)
  • Functions
  • Arrays
  • Saving .trash files
  • Shaking editor on errors

Version

TrashScript v0.1-alpha-trash

Built with chaos ๐Ÿ—‘๏ธ

Published 4 days ago
StatusReleased
CategoryTool
PlatformsHTML5
AuthorRyguy1234hi
Tags2D, Indie, User Interface (UI)

Leave a comment

Log in with itch.io to leave a comment.