${randomHeadline()}
Tabloid: The Clickbait Headline Programming Language
What?
Tabloid is a turing-complete programming language for writing programs in the style of clickbait news headlines.
Here are a few things${' '}the Top Five
Most Popular Quirks and Features of the Tabloid
programming language (Number Four Will Shock You!)
-
Print output with the keywords
YOU WON'T WANT TO MISS
followed by an expression. Everything printed by Tabloid is automatically capitalized, and an exclamation point is added. Why would you want anything else? -
Declare a function by writing
DISCOVER HOW TO ... WITH
. Truly, a more gripping way to declare a function can't possibly exist! Similarly, assign to a variable withEXPERTS CLAIM ... TO BE
. On the Internet, anyone can be an expert, and Tabloid gives YOU the power to wield that responsibility and declare anything you'd like! - There are no built-in constructs for looping. The news cycle is moving too fast! Nobody has time for yesterday's loops or last week's break statements. If you must loop, use recursion.
-
To return from a function, simply write
SHOCKING DEVELOPMENT
! You're going to—gasp!—return? How shocking! -
Every program must end with
PLEASE LIKE AND SUBSCRIBE
, because you have to grow your audience! Hashtag hustle.
But why?
Didn't want to do homework for my database systems class, and needed something to do to procrastinate. Will I finish the homework? Did I get enough sleep?
Stay tuned to find out!
Does it actually work?
Yes. Tabloid is a fully functioning, Turing complete programming language with an interpreter written in JavaScript. Tabloid currently only supports numbers, strings, and booleans, but with these elements, you can write any program you'd want to write. You can edit and run the program above, or see how it works for yourself.
Besides this online interpreter, Tabloid now also has a mostly compatible implementation in Racket and a small library of helper functions ... for some reason.
Before making Tabloid, I also created a more useful and
well-designed${' '}boring and unpopular
programming language, called Ink.
How much is there?
Here's the full list of standard keywords that Tabloid currently uses:
-
DISCOVER HOW TO...WITH
declare a function -
RUMOR HAS IT
begin a block scope -
A OF B, C
call function A with arguments B, C -
WHAT IF...LIES!
an if-else expression -
END OF STORY
end a block scope -
EXPERTS CLAIM...TO BE
declare or assign to a variable -
YOU WON'T WANT TO MISS
print output -
LATEST NEWS ON
take user input -
TOTALLY RIGHT
true -
COMPLETELY WRONG
false -
AND
,OR
and/or boolean operators -
PLUS
,MINUS
,TIMES
,DIVIDED BY
,MODULO
the obvious arithmetic operations -
IS ACTUALLY
is equal to -
BEATS
,SMALLER THAN
greater than / less than -
SHOCKING DEVELOPMENT
return from a function -
PLEASE LIKE AND SUBSCRIBE
end of program