Burlesque

From Esolang
Jump to navigation Jump to search

Burlesque is a concatenative, dynamic typed, lazy programming language by User:Feuermonster, and the successor of Stlang but less feature bloated. The name means what it means. The main design goals of Stlang still apply. Burlesque evolved to be a programming language used for both serious applications and golfing too. For a complete description of the language please refer to the Moonpage.

I/O

The language specification suggests to push STDIN at program start and display remaining elements on the stack in the order they can be removed from the stack on program termination. This is - however - not a requirement but recommended.

Example programs

These require STDIN.

See anarchy golf for tons of example programs.

Calculate Fibanocci numbers 1..10:

1J{.+}10!C

Analyze frequencies of letters:

"hello world"F:sp


Quines

Quines are trivial in Burlesque. It however might depend on your interpreter.

{qu in e.}

A more non-cheating quine is:

,#Q2 SH ~- ",#Q" \/ .+ sh

Brainfuck Interpreter

 ".""X"r~"-""\/^^{vvvv}c!!!-.256.%{vvvv}c!sa\/"r~"+""\/^^{vvvv}c!!!+.256.%{vvvv}c!
 sa\/"r~"[""{"r~"]""}{\/^^{vvvv}c!!!}w!"r~">""+."r~"<""-."r~"X""\/^^{vvvv}c!!!L[+]
 \/+]\/+]^^3\/.+1RAp^\/+]\/0RA1RA^^-]\/0RA\/"r~"\'\'1 128r@{vv0}m[0"\/.+pse!vvvv<-sh

128 is the amount of cells. However, this implementation does not provide the ","-Instruction.

Computational class

Burlesque is turing-complete as you can translate Underload's instructions :()^ to Burlesque. Given below is a translation table:

: → ^^
( → {
) → }
^ → e!
! → vv
* → .+
a → {}\/[+
~ → \/
S → ? - Burlesque has no I/O.

The translation of the following Underload program (factorial):

(:::::::):(:((^:()~((:)*~^)a~*^!!()~^))~*()~^^)~(^a(*~^)*a~*()~^!()~^)a~**^!!^

is:

{^^^^^^^^^^^^^^}^^{^^{{e!^^{}\/{{^^}.+\/e!}{}\/[+\/.+e!vvvv{}\/e!}}\/.+{}\/e!e!}\/{e!{}\/[+{.+\/e!}.+{}\/[+\/.+{}\/e!vv{}\/e!}{}\/[+\/.+.+e!vvvve!

Using HELP it is possible to automate this conversion process. The following directives must then be inserted:

# \( := {
# \) := }
# \! := vv
# \^ := e!
# \: := ^^
# \* := .+
# a  := {}\\/[+
# \~ := \\/

External resources