Skip to main content

A Python project.

Project description

HeartbreakCode

Turn your emotional baggage into executable code.

License: MIT

Welcome to HeartbreakCode, the world's first esoteric programming language inspired by the raw, lyrical honesty of artists like Taylor Swift and Olivia Rodrigo. Here, you don't just write programs—you write anthems of love, loss, and logic.

HeartbreakCode is a fully-featured, interpreted programming language where the syntax is a tribute to pop music's most iconic storytellers. We've swapped out cold, impersonal keywords for the passionate, dramatic phrases that define a generation's anthems.

This project is a significant technical undertaking involving a custom-built lexer, parser, and runtime environment, all created from the ground up. It's an exploration of how we can bridge the gap between creative expression and computational thinking, making code more relatable, fun, and a little more theatrical.

Key Features

  • Lyrical & Expressive Syntax: Write code that reads like a pop song. Assign variables with The story of us is....
  • Lyrical Conditional Logic: Implement conditional branching using Would've, Could've, Should've for if, else if, and else blocks.
  • Reusable 'Verses' (Functions): Define and call functions (Verses) using Define Verse 'Chorus': ... End Verse and Perform 'Chorus'.
  • Themed Object-Oriented System: 'Albums' and 'Records': Define 'Albums' as classes and create 'Records' as instances.
  • Structured Error Handling: 'This is me trying...': Implement try/catch/finally error handling with lyrical themes.
  • "The Vault": A File System API: Interact with the local file system using built-in 'Verses' like Read The Letter and Write In The Diary.
  • "Tell Me Why": Interactive Debugging: Pause program execution at any point with Tell Me Why to inspect variable states.
  • The Record Label: A Lyrical Package Manager: Discover, distribute, and install third-party HeartbreakCode 'Albums' (libraries).
  • The Setlist: A Web Server Micro-framework: Build lightweight, interactive web applications and APIs.

Installation

You can install HeartbreakCode directly from PyPI:

pip install heartbreak-code

Usage

Once installed, you can run HeartbreakCode programs.

  1. Create a new file with the .hbc (HeartbreakCode) extension, e.g., my_song.hbc:

    # my_song.hbc
    The story of us is my_variable 1989
    Would've my_variable is 1989 Speak Now:
        Speak Now: 'It was a good year!'
    End Verse
    
  2. Run your HeartbreakCode program from the command line:

    heartbreak-code run my_song.hbc
    

Contribute

We welcome contributions! Check out our GitHub repository for more details on how to contribute to the project.

License

HeartbreakCode is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

heartbreak_code-0.0.4.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heartbreak_code-0.0.4-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file heartbreak_code-0.0.4.tar.gz.

File metadata

  • Download URL: heartbreak_code-0.0.4.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for heartbreak_code-0.0.4.tar.gz
Algorithm Hash digest
SHA256 062bbcecd122919578971f99ee62fea34ac7f98040982afb67857cb40fa3e687
MD5 7da988e373517fb80657efe55adb5b98
BLAKE2b-256 3cf4f44c0a84519004c91358287b9bdee690baf4eb8fa82e12b9bcac2d6b054b

See more details on using hashes here.

File details

Details for the file heartbreak_code-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for heartbreak_code-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 63485a4023ae0f52ac7d2b209effa7796641983f7e16b93f34274c2022f9d9e6
MD5 389b23b5aca01614ba304bfbf8b48a32
BLAKE2b-256 13e3f87ee2b77c1f1f82fc03966d261ae7d923ba8b7169a2b5d037098443e349

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page