Jump to content

User:Smokingloud/sandbox/Riff (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Smokingloud (talk | contribs) at 15:34, 1 October 2022. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Riff (programming language)

Riff, stylized as RiFF, is an esoteric programming language parodying the lyrical style of Houston rapper RiFF RAFF. The language was developed by Jeffery Wang, at the time a computer science student at the University of Houston, in 2014. Although Riff borrows heavily from Python and hence is also a general purpose, object-oriented programming language, it contains unique functionality that make it impractical for software development.[1] On his personal website, Wang stated that he was inspired to develop the language after listening to Riff Raff's debut album Neon Icon.[2]

Features

At first glance, many of Riff's modifications to Python are purely cosmetic—for example, the "def" keyword in Python (used to define a function) has been changed to "Rap Game". In reality, many of these changes involved sophisticated modifications to Python's source code and impose restrictions not found in any other programming language. These restrictions include:

  • All Riff code being in capital letters, except i (following the stylization of Riff Raff's name)
  • Variable names being two words, and either 1) alliterative, with the first word being an adjective and the second a noun, or 2) the word "Versace" followed by a noun.
  • Integers being no larger than 1,024 (due to Riff Raff's proclaimed dislike of "geek shit").[3]

There are numerous undocumented features in the language, many based on Riff Raff lyrics. If found in the contents of any variable, the string "Iceberg Simpson" is known to cause an unhandled exception; similarly the string "Macaroon moon diamonds got me feeling bipolar" will cause the interpreter to randomly delete files from the hard disk.

Programming example

Program to calculate the 100th Fibonacci number, then download a pirated copy of the 2004 film National Treasure:

RAP GAME VERSACE FiBONACCi(NEON NUM):
    iF NEON NUM iN (0,1):
        RETURN 1
    ELSE:
        RETURN VERSACE FiBONACCi(NEON NUM - 1) + VERSACE FiBONACCi (NEON NUM - 2)
        
PRiNT(VERSACE FiBONACCI(100))

PRiNT("It's a Raff Riff, Rap Game Merrill Lynch")
  1. ^ 1
  2. ^ 3
  3. ^ 2