Skip to main content

Interpreter for the JunkLang esolang

Project description

JunkLang

JunkLang is a junk food-themed esoteric programming language where your code tastes as good as it runs. Inspired by BhaiLang and other meme langs, I won't mind if you call this a piece of junk!


Features

  • order variables and eat expressions
  • Arithmetic operations
  • whisper to print
  • reheat: to define functions, deliver() to call
  • if you like ... else: conditionals
  • until thirsty <condition> loops
  • Input with open your mouth and say
  • Custom errors with barf("message")
  • CLI interpreter (junk program.jnk)

Installation

You can install it globally via pip:

pip install junklang

Now you can run .jnk files using:

junk path/to/yourfile.jnk

Example Code

open your mouth and say burgers
order fries = 5
order meal = eat burgers + fries
whisper "You ordered a meal of " + meal

if you like meal more than 5:
    whisper "That's a big meal!"
else:
    whisper "That’s a light snack."
done

order total = 0
until thirsty total < 3:
    order total = eat total + 1
    whisper "Nom #" + total
done

reheat: make_burger
    order patty = 1
    order bun = 2
    order burger = eat patty + bun
done

order my_burger = deliver(make_burger)
whisper "I got a burger with " + my_burger + " parts"

barf("No more food for you!")

Language Syntax

Variables

order x = 5
order y = eat x + 10

Arithmetic

Supports +, -, *, / inside eat expressions.

Print

whisper "Hello World"
whisper "Value is: " + x

Input

open your mouth and say name

Conditionals

if you like x more than 5:
    whisper "x is big"
else:
    whisper "x is small"
done

Loops

until thirsty counter < 10:
    whisper counter
    order counter = eat counter + 1
done

Functions

reheat: cook
    order x = 1
    order y = 2
    order z = eat x + y
done

order result = deliver(cook)

Errors

barf("Something went wrong!")

Run a .jnk File

junk hello.jnk

Developer Setup

git clone https://github.com/yourname/junklang.git
cd junklang
pip install .

Written in Python

This language is written in Python and is intended more for learning and fun than performance.

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

junklang-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

junklang-0.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file junklang-0.1.1.tar.gz.

File metadata

  • Download URL: junklang-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for junklang-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e101deb14fe71a681fc278dde1da189021ad9b8b12d55d9e755d9b383d1fd5cf
MD5 50dbe15d771da7c86a138252181fc1be
BLAKE2b-256 334cb4c7d4164321b924a7ebab87a3eb970a07af550e1a714ba7ee64f707fea1

See more details on using hashes here.

File details

Details for the file junklang-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: junklang-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for junklang-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb84d8224670def5236f01ddb33e54d8d7f753a4f97f72a58a19229d89cd328
MD5 74e31746c5ecc740a3c5cb099b0b591a
BLAKE2b-256 20067539f0641d4a64ab4b86e6eba3222ebf6baac86e898e5193407f20bd438d

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