Paradigm | Stack-oriented |
---|---|
Designed by | Cliff L. Biffle |
Developer | Cliff L. Biffle |
First appeared | 2001 |
OS | Cross-platform |
Website | cliffle |
Influenced | |
l33t [1] |
Beatnik is a simple stack-oriented esoteric programming language, by Cliff L. Biffle. A Beatnik program consists of any sequence of English words. Each word is assigned the score one would get for it in a Scrabble game. The value of the score determines what function is performed. Functions include pushing the score of the next word onto the stack, testing the stack and skipping forward or backward in the program and other stack operations. [2] [3] [4] [5] [6] [7] [8]
The interpreter reads the words in the poem, ignoring punctuation and whitespace and newlines. Some functions are one word, other functions have an argument (they are two-word functions). Two-word functions are described below in the form "5,n
". This means both the word whose value is 5 and the next word (whose value is 'n
') are read. [2] [3]
Word value | Pseudo-code | Description |
---|---|---|
<5 | NOOP | Optional: Interpreter may mock you |
5,n | push(n) | Push the next word's value onto the stack. |
6 | pop() | Pop a number from the stack and discard it. |
7 | push(pop()+pop()) | Pop two numbers, add them, and push the result. |
8 | push(input()) | Input a character and push its value. |
9 | print(pop()) | Pop a number and output it as a character. |
10 | push(pop()-pop()) | Pop two numbers, subtract the first one popped from the second one popped, and push the result. |
11 | a = pop(); b = pop(); push(a); push(b) | Pop two numbers, swap them, and push them back. |
12 | a = pop(); push(a); push(a) | Pop a number and push it twice. |
13,n | if(top()==0) jump(+n) | Pop a number and skip ahead n (actually n+1) words if the number is zero. |
14,n | if(top()!=0) jump(+n) | Pop a number and skip ahead n (actually n+1) words if the number isn't zero. |
15,n | if(top()==0) jump(-n) | Pop a number and skip back n words if the number is zero. |
16,n | if(top()!=0) jump(-n) | Pop a number and skip back n words if the number isn't zero. |
17 | exit() | Stop the program. |
18-23 | NOOP | Optional: may mock you, but only if it has had a bad day. |
>23 | — | Generates "Beatnik applause". |
Pseudo-code | Meaning |
---|---|
NOOP | No operation |
pop() | remove the value off the top of the stack, and return it |
push(x) | place x on the stack |
print(x) | print the character x |
input() | read a character from the user. Blocks until character is read. |
; | separates multiple statements. They are run in order. |
if(expression) statement | if and only if the expression is true, execute the statement |
jump(x) | move the reading location forward or backwards by x words. |
Here are the scrabble letter values, for reference.
A "Hello World" example in the Beatnik language. [9]
Soars, larkspurs, rains. Indistinctness. Mario snarl (nurses, natures, rules...) sensuously retries goal. Agribusinesses' costs par lain ropes (mopes) autos' cores. Tuner ambitiousness. Flit. Dour entombment. Legals' saner kinking lapse. Nests glint. Dread, tied futures, dourer usual tumor grunts alter atonal garb tries shouldered coins. Taste a vast lustiness. Stile stuns gad subgroup gram lanes. Draftee insurer road: cuckold blunt, strut sunnier. Rely enure pantheism: arty gain groups (genies, pan) titters, tattles, nears. Bluffer tapes? Idle diatom stooge! Feted antes anklets ague? Remit goiter gout! Doubtless teared toed alohas will dull gangs' aerials' tails' sluices; Gusset ends! Gawkier halo! Enter abstruse rested loser beer guy louts. Curtain roams lasso weir lupus stunt. Truant bears animate talon. Entire torte originally timer. Redo stilt gobs. Utter centaurs; Urgent stars; Usurers (dilute); Noses; Bones; Brig sonar graders; Utensil silts; Lazies. Fret arson veterinary rows. Atlas grunted: "Pates, slues, sulfuric manor liaising tines, trailers, rep... unfair! Instant snots!" Sled rested until eatery fail. Ergs fortitude Indent spotter Euros enter egg. Curious tenures. Torus cutlasses. Sarong torso earns cruel lags it reeled. Engineer: "Erase handbag -- unite ratification!" oaring oaten donkeys unsold, surer rapid saltest tags BUTTERED TIBIA LUGS REWIRING TOILETS anion festers raring edit epilogues. DIRGE ROTOR. linnet oaring. GORE BOOTIES. Ironed goon lists tallest sublets -- Riots, Raucous onset. Ignobly, runners' diet anguishes sunrise loner. Erode mob, slier switcher! Loaners stilt drudge pearl atoll, risking hats' ends. Rebind sitters. Toga epistles -- crud lard. (Pager purse dons souls.) glob title a curio hired rites shed suds lade grease strut arctic revs toad unless idlers rind stilt region land GERMICIDES SULTANA GUTS gill siting leans nice spurs tests gloves roused asp Holes! Moles! (Sores!) Hygienists! Scars! (Asses!) Smells spell rares. Cubs instant sing in parse goodies. Rosin. Unhelpful sisal acres. Slope told. MALENESS PASTA LAB. "Infirmary vine," rang illiterates (beans). Rosin sours, insults truss abalones, nailed rules, helical atlases. Dear remodeling stings mar rents. Sunless shiner orb (silly idol.) Clarity disses senna. Vagabonds sauted; sloes performed gelds. Alter post radial lip sectioning gums. Saint Towellings. Larger aeons telephone stolid char, pal! Boats Dean forsook, rosters, tunas, terrariums -- united, traced. Nude pagoda careens.
Brainfuck is an esoteric programming language created in 1993 by Urban Müller.
Forth is a procedural, stack-oriented programming language and interactive environment designed by Charles H. "Chuck" Moore and first used by other programmers in 1970. Although not an acronym, the language's name in its early years was often spelled in all capital letters as FORTH.
A "Hello, World!" program is generally a computer program that ignores any input and outputs or displays a message similar to "Hello, World!". A small piece of code in most general-purpose programming languages, this program is used to illustrate a language's basic syntax. "Hello, World!" programs are often the first a student learns to write in a given language, and they can also be used as a sanity check to ensure computer software intended to compile or run source code is correctly installed, and that its operator understands how to use it.
Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019.
Rebol is a cross-platform data exchange language and a multi-paradigm dynamic programming language designed by Carl Sassenrath for network communications and distributed computing. It introduces the concept of dialecting: small, optimized, domain-specific languages for code and data, which is also the most notable property of the language according to its designer Carl Sassenrath:
Although it can be used for programming, writing functions, and performing processes, its greatest strength is the ability to easily create domain-specific languages or dialects
Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.
Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle. It has been described as "a cross between Forth and Lemmings".
A worthy companion to INTERCAL; a computer language family which escapes the quotidian limitation of linear control flow and embraces program counters flying through multiple dimensions with exotic topologies.
An esoteric programming language is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, as software art, as a hacking interface to another language, or as a joke. The use of the word esoteric distinguishes them from languages that working developers use to write software. The creators of most esolangs do not intend them to be used for mainstream programming, although some esoteric features, such as visuospatial syntax, have inspired practical applications in the arts. Such languages are often popular among hackers and hobbyists.
Whitespace is an esoteric programming language developed by Edwin Brady and Chris Morris at the University of Durham. It was released on 1 April 2003. Its name is a reference to whitespace characters. Unlike most programming languages, which ignore or assign little meaning to most whitespace characters, the Whitespace interpreter ignores any non-whitespace characters. Only spaces, tabs and linefeeds have meaning. A consequence of this property is that a Whitespace program can easily be contained within the whitespace characters of a program written in another language, except possibly in languages which depend on spaces for syntax validity such as Python, making the text a polyglot.
Malbolge is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's Inferno, the Malebolge. It was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic, and self-altering code. It builds on the difficulty of earlier challenging esoteric languages, but takes this aspect to the extreme, playing on the entangled histories of computer science and encryption. Despite this design, it is possible to write useful Malbolge programs.
Non-English-based programming languages are programming languages that do not use keywords taken from or inspired by English vocabulary.
Factor is a stack-oriented programming language created by Slava Pestov. Factor is dynamically typed and has automatic memory management, as well as powerful metaprogramming features. The language has a single implementation featuring a self-hosted optimizing compiler and an interactive development environment. The Factor distribution includes a large standard library.
In computer programming, whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area on a page. For example, the common whitespace symbol U+0020 SPACE represents a blank space punctuation character in text, used as a word divider in Western scripts.
String functions are used in computer programming languages to manipulate a string or query information about a string.
In computer programming, homoiconicity is a property of some programming languages. A language is homoiconic if a program written in it can be manipulated as data using the language, and thus the program's internal representation can be inferred just by reading the program itself. This property is often summarized by saying that the language treats "code as data".
.properties is a file extension for files mainly used in Java-related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization; these are known as Property Resource Bundles.
The structure of the Perl programming language encompasses both the syntactical rules of the language and the general ways in which programs are organized. Perl's design philosophy is expressed in the commonly cited motto "there's more than one way to do it". As a multi-paradigm, dynamically typed language, Perl allows a great degree of flexibility in program design. Perl also encourages modularization; this has been attributed to the component-based design structure of its Unix roots, and is responsible for the size of the CPAN archive, a community-maintained repository of more than 100,000 modules.
Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful. Tcl casts everything into the mold of a command, even programming constructs like variable assignment and procedure definition. Tcl supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles.
Leet is an esoteric programming language based loosely on Brainfuck and named for the resemblance of its source code to the symbolic language "L33t 5p34k". L33t was designed by Stephen McGreal and Alex Mole to be as confusing as possible. It is Turing-complete and has the possibility for self-modifying code. Software written in the language can make network connections and may therefore be used to write malware.
JSFuck is an esoteric subset of JavaScript, where code is written using only six characters: [
, ]
, (
, )
, !
, and +
. The name is derived from Brainfuck, an esoteric programming language that also uses a minimalistic alphabet of only punctuation. Unlike Brainfuck, which requires its own compiler or interpreter, JSFuck is valid JavaScript code, meaning that JSFuck programs can be run in any web browser or engine that interprets JavaScript. JSFuck is able to recreate all JavaScript functionality using such a limited set of characters because JavaScript is a weakly typed programming language, and it allows the evaluation of any expression as any type.