#DJKHALED
#WETHEBEST
An emoji-based programming language designed to satisfy a curiosity around language-parsing and inspired by the idiolect of DJ Khaled. Designed over a few days at Swarthmore College.
Other programming languages, they don't want you to win. That's why we're bringing you 🔑++, the key to more success.
They don't want you to code your way to more success. We do. They don't want you to code with 🔥emoji. We do. They don't want you always have another one. We do. Another one.
And guess what? We've changed – a lot.
Welcome to 🔑++, the programming language for winners and champions. We the best.
🔥 "Hello World"
they don't want you to fizzbuzz max
🔑 n 0
ride wit me
if n % 3 == 0 and n % 5 == 0:
🔥 "FizzBuzz"
elif n % 3 == 0:
🔥 "Fizz"
elif n % 5 == 0:
🔥 "Buzz"
else:
🔥 n
if n >= max:
you played yourself
another one
major 🔑 👍
🙏
In order to run 🔑++ on your local machine, you'll want to set up an alias so you can run code from anywhere.
Add the following code to your ~/.profile
or ~/.bash_profile
(check out StackOverflow for more information).
alias 🔑++="PATH_TO_DIRECTORY/🔑++/bin/🔑++"
You can change the alias if you'd prefer not to type emojis – we recommend "key++". Then you can just run
$> 🔑++ examples/hello_world.liooooon
Hello world - WE THE BEST!
This language is called 🔑++ because it's the key to more success, and another one.
All 🔑++ programs must begin with the following two-line comment:
#DJKHALED
#WETHEBEST
🔑++ naturally supports integers, floats, and strings. Booleans are 👍
, true, and 👎
, false.
🔑++ accepts all standard operators, +
, -
, *
, \
, %
, **
, etc. Anything you could find in Python ;)
1
3.14
👍
"another one"
To print a value, simply prefix it with 🔥
.
🔥 3.14
🔥 "another one"
🔑++ uses the following notation for assigning variable values:
🔑 x 1
You can read this as "The key to x is 1". The right term can include operators, so 🔑 x x + 1
will assign the value x + 1
to x
.
Function definitions begin with they don't want you to [name] [args]
and are closed with 🙏
. To specify the return value, use major 🔑 [optional value]
. 🔑++ does not yet support anonymous functions.
An example implementation of Fibonacci is below:
they don't want you to fibonacci n
🔑 acc1 0
🔑 acc2 1
ride wit me
🔑 temp acc2
🔑 acc2 acc2 + acc1
🔑 acc1 temp
🔑 n n - 1
if n < 1:
you played yourself
another one
major 🔑 acc1
🙏
Don't play yourself. 🔑++ makes it easy to write code and easy to call another one
. All 🔑++ loops are initialized with the tag ride wit me
and default behavior is always another one
.
ride wit me
...
another one
To exit a loop use the command you played yourself
. Thus we can write a traditional loop as follows:
ride wit me
[...]
if [condition]:
you played yourself
another one
DJ Khaled has the best fans in the world. You can access local Python libraries via fanluv [libname]
.
We're currently working on implementing struct support in 🔑++.
We are also working on O'Khaled, a JIT compiler for 🔑++.
Good question. Razi Shaban and Alec Pillsbury put this project together after a late-night brainstorming session. Hope you unlock more success
Yeah, yeah, whatever. Another one.