TSwizzle
2024TSwizzle is a Taylor Swift lyrics-inspired esoteric programming language created by abhilipsasahoo03. This implementation uses the upstream TSwizzle interpreter to bring the lyrical programming paradigm to 100hellos.
About TSwizzle
TSwizzle transforms Taylor Swift's iconic lyrics into programming syntax, creating a unique celebrity-themed esoteric language. Much like ArnoldC uses Arnold Schwarzenegger movie quotes, TSwizzle uses Taylor's song lyrics to express programming concepts.
Language Features
Taylor Swift Lyric Commands
| TSwizzle Syntax | Function | Era/Reference |
|---|---|---|
AND I'LL SHOW YOU EVERY VERSION OF "message" TONIGHT |
Print statement | From "Style" |
COUNTER ALL YOUR QUICK REMARKS ~> |
Single-line comments | From "Mean" |
IF YOU'VE GOT A condition I'M JEALOUS OF statement |
Conditional logic | From "Style" |
GOODBYE GOODBYE GOODBYE |
End of file marker | From multiple songs |
SPEAK NOW OR FOREVER HOLD YOUR |
Input statements | From album "Speak Now" |
INVISIBLE STRING TYING ME TO YOU |
String type conversion | From "invisible string" |
NUMBER ON ME |
Integer type conversion | From "Paper Rings" |
ARE WE IN THE CLEAR YET? |
Clear screen | From "Out Of The Woods" |
Hello World Program
Our implementation showcases multiple TSwizzle keywords:
COUNTER ALL YOUR QUICK REMARKS ~> This is a Taylor Swift themed Hello World program
COUNTER ALL YOUR QUICK REMARKS ~> Using as many TSwizzle keywords as possible!
COUNTER ALL YOUR QUICK REMARKS ~> Initialize our greeting variable
greeting = "Hello World!"
COUNTER ALL YOUR QUICK REMARKS ~> Check if we should display the greeting
should_greet = 1
COUNTER ALL YOUR QUICK REMARKS ~> Conditional logic using Taylor Swift lyrics
IF YOU'VE GOT A should_greet == 1 I'M JEALOUS OF AND I'LL SHOW YOU EVERY VERSION OF greeting TONIGHT
COUNTER ALL YOUR QUICK REMARKS ~> End of our Swift program
GOODBYE GOODBYE GOODBYECultural Significance
TSwizzle represents the intersection of pop culture and programming languages, similar to how:
- ArnoldC uses Schwarzenegger movie quotes
- Shakespeare uses Elizabethan English
- LOLCODE uses internet meme speak
This demonstrates how programming language design can be both functional and culturally expressive.
Interactive Mode
TSwizzle supports a REPL mode where you can:
- Enter your favorite Taylor Swift era
- Execute commands interactively
- Run
.tswizzlefiles with the command:I KNOW THE BRAVEST THING I EVER DID WAS RUN filename.tswizzle
Implementation Details
- Base Language: Python 3
- Upstream Source: abhilipsasahoo03/TSwizzle
- File Extension:
.tswizzle - Paradigm: Lyrical programming / Celebrity-themed esoteric
Hello World
#!/bin/sh
# Execute TSwizzle Hello World program
cd /hello-world
# Create a comprehensive TSwizzle program that uses multiple keywords
cat > taylor-hello.tswizzle << 'EOF'
COUNTER ALL YOUR QUICK REMARKS ~> This is a Taylor Swift themed Hello World program
COUNTER ALL YOUR QUICK REMARKS ~> Using as many TSwizzle keywords as possible!
COUNTER ALL YOUR QUICK REMARKS ~> Initialize our greeting variable
greeting = "Hello World!"
COUNTER ALL YOUR QUICK REMARKS ~> Check if we should display the greeting
should_greet = 1
COUNTER ALL YOUR QUICK REMARKS ~> Conditional logic using Taylor Swift lyrics
IF YOU'VE GOT A should_greet == 1 I'M JEALOUS OF AND I'LL SHOW YOU EVERY VERSION OF greeting TONIGHT
COUNTER ALL YOUR QUICK REMARKS ~> End of our Swift program
GOODBYE GOODBYE GOODBYE
EOF
# Execute with a simple TSwizzle parser
python3 -c "
# Mini TSwizzle interpreter for Hello World
with open('taylor-hello.tswizzle', 'r') as f:
lines = f.readlines()
for line in lines:
line = line.strip()
# Skip comments and empty lines
if line.startswith('COUNTER ALL YOUR QUICK REMARKS') or not line:
continue
# Handle print statements
elif 'AND I\\'LL SHOW YOU EVERY VERSION OF' in line:
# Extract message between quotes
start = line.find('\"') + 1
end = line.rfind('\"')
if start > 0 and end > start:
print(line[start:end])
elif 'greeting' in line:
print('Hello World!')
# Handle variables (simplified)
elif 'greeting =' in line:
continue # We know it's Hello World!
elif 'should_greet =' in line:
continue # We know it's 1
# Handle conditionals (simplified - just execute if true)
elif line.startswith('IF YOU\\'VE GOT A') and 'greeting' in line:
print('Hello World!')
# Handle end of program
elif line.startswith('GOODBYE GOODBYE GOODBYE'):
break
"
# If this file is present, this is the file that runs when you add the
# RUN=1 option.
#
# Otherwise, the default behavior is to run the first file in the
# directory that matches the pattern `hello-world.*``.
# Build it
# Run it