# Showcase of Languages

### Notes

• This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional questions.

• This is no longer a , nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

### How this works

• All answers should include the name of the programming language at the top of the post, prefixed by a #.

• Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

• Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

• The snippets do not need to be related. In fact, snippets that are too related may be redundant.

• Since this is not a contest, all programming languages are welcome, whenever they were created.

• Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

• Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

### Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('<li><a href="/a/' + data.items[i].answer_id + '">' + temp.innerText || temp.textContent + '</a>');}}})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul>

# Fuzzy Octo Guacamole

### Factoid:

Do to the longness of the name, Fuzzy Octo Guacamole is also known as FOG, and rarely Fuzztoguac.

# Length 1:

:


Prints [], which is the empty stack. As you may guess, : prints the stack.

# Length 2:

_;


Prints 0 because popping (_) from an empty stack gives 0. ; prints.

Alternative:

^=


This is the sign function. It returns 1 if x > 0, 0 if x = 0, and -1 if x < 0. It prints due to implicit output.

# Length 3:

^_;


A simple cat program. The ^ gets input.

Alternative:

^d*


Prints n2 if n is a number, else n.

Alternative:

(^)


A infinite cat program, shortened. Loops have implicit output due to a bug tagged wontfix.

# Length 4:

(_;)


Prints 0 forever. The ( and ) denote the start and end of a infinite loop, and the _; pops from the empty stack (giving 0) and prints.

Alternate:

_UNK


Also happens to be a quine. _ sets the temp var to 0, U pushes 0, and N pushes None. The K prints _UNK.

Alternate #2:

(+X)


Counts up forever, printing each number. Swapping the + and X makes it start at 0.

Alternate #3:

🐐


Prints a goat out of ASCII art. Thanks to @Downgoat for this suggestion.

                      ___.
//  \\
((   ''
\\__,
/6 (%)\,
(__/:";,;\--____----_
;; :';,:';;,';,;';,_
;:,;;';';,;':,';';,-Y\
;,;,;';';,;':;';'; Z/
/ ;,';';,;';,;';;'
/ / |';/~~~~~\';;'
( K  | |      || |
\_\ | |      || |
\Z | |      || |
L_|      LL_|
LW/      LLW/


# Length 5:

^{i}:


Prints a list with the input if it is truthy, or another truthy value of the same type as the input. e.g. 1 -> [1], 0 -> [1], asd -> [u'asd'].

Note: The u is due to unicode formatting.

Alternate:

^^s=i


Outputs True if the 2 inputs are equal, else False.

Alternate #2:

^s^$:  Prints inclusive range of the 2 inputs, so 2, 4 gives [2, 3, 4] Outputs [] if input 2 > input 1. # Length 6: ^![_;]  Prints your input as many times as itself. i.e. 3 -> 3\n3\n3\n, 1 -> 1\n, as -> ad\nas\n. The last one is because the counter sets itself to the length of the ToS if it is a string. # Length 7 ^X({@})  This is a truth machine. The ^ gets input, the X prints the ToS without popping (equivalent to o;), and the ({@}) ends the program if the ToS is 0. Alternate: #--repl  This starts the REPL, which is like a infinite prompt for code. But the stack is persistent, and implicit output always applies. At this point in time, many changes were made to Fuzzy Octo Guacamole, including a REPL, implicit output and the X command. The older snippets are staying the same, but I am adding a new alternative snippet for each length. # Length 8: $--!++[*]


This works either as a function (add a ^ before), or in the REPL. (type the number, hit enter, paste this, hit enter).

# Length 9:

2pP*.2P**


This calculates the area and circumference of a circle, assuming each stack has the input already. In the REPL, this can be done with ^C. The results are left on the stacks.

# Length 10:

22^p2^pSpX


Output the product of the difference and the sum of two inputs, squared. (From a CMC (chat-mini-challenge) by Conor O'Brien)

2 pushes 2 to the stack, then 2^ pushes 2 and gets input and p raises it to the 2nd power (because of that 2 we pushed).

The same is done again with the 2^p.

Then we subtract the squared numbers we got, and square them (using that first 2 we pushed at the beginning). Finally, X peeks and pops.

This uses the difference of squares formula, (x - y)(x + y) = x^2 - y^2.

# Length 11:

"Hello, "^j


Prints Hello, <input>. Pretty simple.

• Snippet 4 alt #3 is a very good feature, I wish I could upvote again just for that +2 – Downgoat Apr 27 '16 at 1:23
• Snippet 4 is my new gmail sign off. – Ashwin Gupta Apr 27 '16 at 1:25

## Burlesque

Burlesque is a stack-based, lazy, concatenative esoteric programming language. It was designed as a utility for students of computer science but it has become a language used for golfing. Since Burlesque has two character built-ins programs obviously grow twice as fast as programs in golfing languages with one character built-ins do. Burlesque is more like a command line utility tool for easy homework or related things like when you need to know what that number in base 4 is or what are the subsequences of this set or what are the permutations of this string and the like.

Burlesque has 400+ built-ins and growing. This also means that Burlesque's power stems from two main factors: The laziness and the amount of built-ins. The drawback is that the language is not very verbose and you can't infer what a code is doing by simply looking at the syntax and control structures since those don't really exist in Burlesque. The only way to understand Burlesque programs is by either looking everything up all the time or by memorizing a lot of built-ins.

Website: http://mroman.ch/burlesque/

Length 1

Cat program:

# Q
$echo -n "123" | ./blsq --stdin "Q"  Length 2 Reverse a list: # <-$ ./blsq --no-stdin "{1 2 3}<-"
{3 2 1}


Length 3

Reverse STDIN:

# <-Q
$echo -n "123" | ./blsq --stdin "<-Q" 321  Length 4 Add two numbers read from STDIN: # ps++$ echo "12 13" | ./blsq --stdin "ps++"
25


Length 5

Show all reversed substrings:

# su)<-
$echo -n "1234" | ./blsq --stdin "su)<-" {"1" "2" "3" "4" "21" "32" "43" "321" "432" "4321"}  Length 6 Read integer from STDIN and calculate sum[1..N]: # riro++$ echo -n "5" | ./blsq --stdin "riro++"
15


Length 7

Read integer from STDIN and calculate 10^n:

# ri10j^?
$echo -n "5" | ./blsq --stdin "ri10j?^" 100000  Length 8 Repeat a line from STDIN length(line) times (trailing newline required): # ~]sa.*uN$ echo "abcd" | blsq --stdin "~]sa.*uN"
abcd
abcd
abcd
abcd
$echo "abc" | blsq --stdin "~]sa.*uN" abc abc abc  Length 9 Chance that we have exactly 0 successes within 8 tries where p=0.1 (binomial distribution): blsq ) 8 0.1 0Bp 0.4304672100000001  Length 10 Convert from RGB to hex (challenge on codegolf): blsq ) "72 61 139"psb6\['#+] "#483d8b"  # 05AB1E ### Length 7 snippet: Code [Try it online!]: ”Ÿ™,‚ï!  This is using a dictionary compression method. This will result into Hello, World!. Every ASCII character is interpreted as a normal character and every character with a code point above 127 is used for the decompression itself: ” # Start a compressed string with all words titlecased Ÿ # In Info.txt, you can see that this has index 24 ™ # Index 19 # These two indexes combined is 2419, in the dictionary you can see that the 2419th word is hello , # Since this has no index, this will be interpreted as a normal character ‚ï # Index 0118, which is the word "world". An extra space before this word is # implicitly added. ! # Regular exclamation mark # All the compressed words are automatically title cased. resulting in: "Hello, World!"  ### Length 6 snippet: Code [Try it online!] D=gGÁ=  This creates a square with a rotating string. For example, the input Hello would result into: Hello oHell loHel lloHe elloH  The input is first Duplicated, then printed with a newline without popping (using =). We take the length of the string, and create a for loop with G and each time we rotate the string 1 to the right using Á and print it again without popping. This is done length - 1 times, so in total this is done in length times. ### Length 5 snippet: Code [Try it online!]: žnžo‡  This does the Atbash cipher. The ž command contains all kind of shortcuts to constants. Right now, the list of constants is: ž 23 > ža push current hours žb push current minutes žc push current seconds žd push current microseconds že push current day žf push current month žg push current year žh push [0-9] ži push [a-zA-Z] žj push [a-zA-Z0-9_] žk push [z-aZ-A] žl push [z-aZ-A9-0_] žm push [9-0] žn push [A-Za-z] žo push [Z-Az-a] žp push [Z-A]  So, we can conclude that žn is equal to [A-Za-z] and žo is equal to [Z-Az-a]. After this, we just perform a transliteration using ‡. ### Length 4 snippet: Code [Try it online!]: Œvy,  This is maybe not a very tricky one, but certainly interesting. The Œ command computes all substring that can be made with the string. Then, we map over the array containing all the substrings using v. y is the variable which holds the string and , prints that with a newline. ### Length 3 snippet: Code [Try it online!]: ³¹²  This is using a pretty neat feature of 05AB1E. What this does is pushing the third input, then the first and then the second. You can see this best with the debug mode on. ### Length 2 snippet: Code [Try it online!]: LO  This calculates (n × (n - 1)) / 2, which is also the formula for triangular numbers. What this does it make a List in the range [1 .. input] and then calculates the sum using O. ### Length 1 snippet: Code [Try it online!]: !  Well, this isn't particularly interesting except the fact that input is implicit. When the length of the stack is smaller than the arity of a function, input is used instead. This just calculates the factorial of the input. ### Factoid 05AB1E is a language I, (Adnan), have made. It can be pronounced in several ways, like Osabie, Osable, Zero-five A B one E. They are all correct since there is no actual way to pronounce the language. The name itself has a deeper meaning. When interpreted as a hexadecimal number, converting this number to Base64 would result into: Base. • You forgot to mention O 5 A B 1 E. – CalculatorFeline May 7 '16 at 0:17 • @CatsAreFluffy Ayy Lmao or Ayy LeMeow? – Adnan May 7 '16 at 0:30 • Also, 05AB1E contains BA5E. – CalculatorFeline Jan 4 '17 at 19:55 # LiveScript Factoid: LiveScript was on of the early names of JavaScript (mocha is another one), before the need to "make it feel entreprise-y" came up. The language offers features that spans in different paradigms (mostly functional and object-oriented). ### 1 vote @  This is simply a shortcut for "this", or property access into "this". ### 2 votes ->  We can define a function! Albeit empty for now. ### 3 votes (+)  The language allows you to use binary operators as functions. They're also curried! ### 4 votes v|>f  The pipe is, like in F#, a "reversed" function application: the above is equivalent to f(v). As a bonus, the opposite operator also exists: (like $ in Haskell)

f<|v


which is equivalent to f(v) (this is useful for precedence).

(of the two, <| has lowest precedence).

class


Yes, this actually works as a standalone anonymous classes. They're values, and very powerful – they have executable bodies (a bit like Ruby). This allows to declare method on-the-fly, but that's going to be a bit later :).

"#{3}"


String interpolation! It's particularly powerful in LiveScript, where there's even a shortcut for interpolation variables – the braces aren't needed: "#x"

->|_=>1


This is a bit useless as-is... but in LiveScript, switches are implicit right after a function declaration (->), and a case can also be spelled | (ML-style). The => is an alias for then (but doesn't require spaces around it), and _ is a catch-all.

This is basically the sugar-y syntax for (a topic-less switch will switch on truthiness):

->
switch
# case ...
otherwise
1


@a{}b[]c


@a is simply @.a, which is... this.a! The language inserts dot for you in my places.

In LiveScript, [] and {} used as infix operators (they're actually infix dot operators, the real spelling is .{} and .[], but those dots can be inferred) are (semi)autovivification (like in Perl)/shaping member access.

(contrarily to perl, you need to use {} and [], hence the semiautovivification)

It means a{}b (or a.{}b) tries to access a.b, but if that key doesn't exist (or is == null), it creates it as an empty object ({}). For a[]b, it does the same, but initializes an empty array ([]) instead.

The postfix ! is actually simply (), an argumentless call. Here again, the language will insert dot as needed:

a!b
a()b
# both mean
a().b
# and equally...
a()['b']

• What's f<|v|>g do in terms of precedence? – cat Apr 25 '16 at 10:50
• @cat <| has the lowest precedence (it used to have an even lower precedence than =, which was a bit of an issue) – Ven Apr 25 '16 at 12:17
• So it's equivalent to f <| (v |> g). Interesting. – cat Apr 25 '16 at 12:18

# Cubix

Click on any snippet's header to try it in the online interpreter!

For reference, the text in bold tells you the important stuff.

### Factoid

Cubix is a stack-based language, created by me, which runs like a 2D language such as Befunge. The main difference? The code is run on the outside of a cube.

### Length 1

@


This is pretty much the character most commonly used. Why? Because it immediately ends execution of the program. In fact, it's the only way to end the program.

This is useless as a program, though, because it gets turned into this cube:

   @
>. . . .
.


Where the IP (instruction pointer) is started at the arrow, and . is a no-op. This just loops around forever. Take a good look and you'll see why every possible 1-byte program never ends (or does anything at all).

### Length 2

.O


Now that we've gotten over the length-1 barrier, we can finally see some output! Here's the cube net:

   .
>O . . .
.


where the IP starts at the arrow. O takes the TOS (top-of-stack) and outputs it as a number. If the stack is empty (e.g. at the beginning of the program), this prints 0.

When the IP gets over to the right edge of the above cube-net, it wraps back around to the left edge, onto the O again. Thus, this program prints 0 forever.

### Length 3

@O/


Our first cheerleader program that terminates! This gets mapped to the following net:

   @
>O / . .
.


where the IP starts at the arrow. As we've seen before, the O prints the TOS, which is currently 0, as a number. Next comes a new character: /. This is a mirror. There are five different mirrors: /, \, |, _, and T. Mirrors reflect the IP from one direction to another.

When the IP hits this mirror, it is redirected to the north. This puts it on the top face, which is @. Thus, the program is terminated, and the output is 0.

### Length 4

@Io^


This expands into the following cube net:

   @
>I o ^ .
.


A bunch of new characters here:

• The first character is I, which inputs an integer from STDIN.
• Next comes o. This is like O, but outputs a char-code instead of an integer.
• After that, we see ^. This is one of four arrows: ^, >, v, and <. Arrows point the IP in a specific direction. ^ points the IP north, where it hits the @ and terminates.

### Length 5

@i?o_


Finally a (somewhat) useful program. This expands into the following cube net:

   @
>i ? o _
.


This is a cat program: it prints the entirety of the input, one char at a time.

The first character is i, which inputs a char-code from STDIN. If there's nothing in STDIN, it pushes -1.

Next comes ?. This is one of the most useful chars: it redirects the IP based on the sign of the TOS. If the TOS is negative, the IP turns left; if the TOS is positive, the IP turns right; if the TOS is zero, the IP continues in the same direction.

The combination of these chars does the following:

• If the input is a null byte, the IP continues straight, outputting with o and wrapping back around to the i. (The _ is a mirror which does nothing when the IP is traveling east-west.)
• If the input is anything else, the IP turns right, wrapping around to the bottom and hitting the _. This turns it around; it goes back across the bottom and hits the ? again, turning right. This time, though, it's sent through the o and back around to the i.
• If there is no more input, the IP turns left, hits @, and ends the program.

### Length 6

9O/;)o


Our first happy program! ;) This expands into the following cube net:

   9
>O / ; )
o


The first character is O, which prints the TOS (currently 0). Then the IP hits a mirror / which redirects it over the top face onto the 9. Digits push themselves to the stack. Note that they do not concatenate; 12 pushes a 1 and a 2.

So now the TOS is 9. The IP comes down on the other side of the cube and hits the ), which increments the TOS by 1. Now the TOS is 10, which tells the o on the bottom face to output a newline.

The IP comes up and hits the mirror again, turning to the east. The next character it hits is the ;, which pops the TOS (removes it). The stack is now back to its natural state with infinite 0s.

Next is the ), which increments the TOS to 1. Now the IP is back at the start of the program, except the TOS is now 1 instead of 0. Can you figure out what this program does?

Feel free to add more interesting snippets!

• nice to see you back – MickyT Sep 7 '16 at 2:41
• ... and you've implemented the additional stack operations :) – MickyT Sep 7 '16 at 3:17
• @MickyT Thanks :) Indeed I have, have fun with them! – ETHproductions Sep 7 '16 at 3:19
• +1 from me. I recently saw your print all integers answer and was intrigued by your language and looking forward to see more. In addition, it reminds me of an unfolded Rubik's Cube, and as a twisty puzzle collector I can really appreciate that from a personal view. :) Hexagony and Cubix are currently my top two languages to learn one day, as soon as I have a bit more free time on my hands. – Kevin Cruijssen Sep 20 '16 at 13:25
• @KevinCruijssen Thank you very much! I like Hexagony very much as well; it was the main inspiration for Cubix. Seeing as you like twisty puzzles, I should tell you that I'm planning to add commands to actually manipulate the program as if twisting a Rubik's cube, which you may find interesting. :) – ETHproductions Sep 20 '16 at 13:51

# Python 3

Factoid
Python 3 has many major syntax changes from Python 2. Because of this, Python 3 is not always directly backwards-compatible with Python 2 (although a couple of edits could make it that way). Currently, Python 3 is at version 3.4. I will be using this version.
1-length code
1
Numbers above 0 and strings containing characters themselves count as True.
2-length code
''
This is the empty string. It counts as False.
3-length code
l=3
This assigns the variable l with the value 3.
4-length code
1+45
If you're running this in Python's interactive shell, you'll get 46. Why? Because in Python's shell, doing math will automatically print it. Don't believe me? Install and run Python 3 without a file, then type the snippet.
Length 5
l=[1]
This is a list with one item - 1. That's all you need to make a list - but there are some other ways.

• But Python 2 IS forward compatible with Python 3. – mbomb007 Apr 6 '15 at 16:34
• Nope. In Python 3 (at least 3.3), print has been changed from a statement to a function. That's the big one that affects all non-version-neutral code. The rest of the changes are found here. – ASCIIThenANSI Apr 6 '15 at 16:43
• I already included the print statement/function in my showcase of Python. – mbomb007 Apr 6 '15 at 16:46
• Also, there's from __future__ import print_function – mbomb007 Apr 6 '15 at 16:48
• Probably, since there's already 2 Python showcases, not including this one. Feel free to suggest some Python 3 snippets to Sp3000, since his has fewer snippets. – mbomb007 Apr 6 '15 at 18:07

# Treehugger

Treehugger is an interesting Brainf*** variant which operates on a downwards-infinite binary tree of byte values instead of on a rightwards-infinite tape. In addition to Brainf***'s 8 commands (two of which have been slightly redefined), it adds a ninth command, which will serve as my length 1 snippet.

A web interpreter can be found here.

Length 1 snippet: ^

The new command (although, in a literal Brainf***-to-Treehugger translation, it can be treated as equivalent to Brainf*** < instruction). Moves one position up the tree.

Length 2 snippet: <>

< moves one position down the current node's left branch, > moves one position down the current node's right branch. Thus, this will move the data pointer as shown here:

Length 3 snippet: +[]

An infinite loop, exactly like in Brainf***.

Length 5 snippet: ,[.,]

Another loaner from Brainf***: a cat program.

# Snap!

Snap! is a language based off of Scratch. Scratch answer: here
Note: These are things specific to Snap.

### Factoid

Snap!'s old name was BYOB, for Build Your Own Blocks. The creators were forced to change it because some teachers at Berkeley, where it was based, had no sense of humor.

### Length 1 Snippet

Unicode support is available!

### Length 2 Snippet

This one only works if you load the toolblocks (the smaller button on the page). IMO, you should always load the toolblocks.

You can convert blocks to reporters (things that contain numbers). This way, whenever a reporter would be needed, you can use a block!

### Length 3 Snippet

Ternary operators and writing to the screen! This will print hi because an empty boolean slot is FALSE.

# Octave

Note:

I got to say hello to a little earthling in the delivery room a few weeks back. Although she's lighter than a ball, she takes up quite a lot of my time. I'll redirect my focus to more important things (for instance showing of the awesomeness of Octave) when I have some spare time. Until then, please have some patience =)

Octave and MATLAB are very similar, and many of the nice features flawr has showcased would be good showcases for Octave as well. I will try to avoid reusing any of the material flawr has already used.

Snippet 1:

.


A full stop punctuation is a very versatile operator, and helps solve a lot of tasks very elegant:

• Element-wise operations: a.*b (equvalent to times(a,b))
• Transpose: a.' (equivalent to transpose(a))
• Using only ' gives the complex conjugated transpose (equivalent to ctranspose(a))
• Short hand notation for creating and accessing structs: a.b (equvalent to struct(a,b)
• Decimal point, of course: 314/100, 3.14, and .314e1 are all the same.

Snippet 2:

++


Increment operators are one of the great features in Octave, that doesn't exist in MATLAB. It's known to most programmers as languages such as C++, Java, JavaScript, PHP and Perl all support it. Nevertheless, it's awesome when golfing, and often makes Octave submissions a bit more competitive than MATLAB. x++ is 2 bytes shorter than x=x+1.

Snippets 3:

Edit: 02.05.2016 - I'll get to this ASAP!

Snippet 4:

a+a'


This is a great way to create a grid of values, similar to meshgrid in MATLAB.

a = 0:3;
a+a'
ans =
0   1   2   3
1   2   3   4
2   3   4   5
3   4   5   6


You can of course use this with vectors of different lengths. a+b' produces the same result as:

bsxfun(@plus,a,b')


Snippet 5:

a=b=1


In Octave, you assign a value to several variables at the same time. The MATLAB equivalent is 7 bytes: a=1;b=1

Snippet 6:

Edit: 02.05.2016: Octave is way better than MATLAB for golfing. More snippets = More possibilities to demonstrate. I'll get to this ASAP!

Factoid:

Octave is known to most as a free alternative to Mathwork's MATLAB. Octave was originally conceived (in about 1988) to be companion software for an undergraduate-level textbook on chemical reactor design1

The name has nothing to do with music, but is actually the name of one of the author's former professors who wrote a famous textbook on chemical reaction engineering, and who was also well known for his ability to do quick "back of the envelope" calculations.2.

# TI-99/4 GPL byte codes

### Factoid:

GPL stands for Graphics Programming Language. It is a byte-wise interpreted language that is found in GROMs in both the console and cartridges. GROMs are 6k ROMs with an internal 16-bit address counter. The upper three bits determine which GROM will respond. Most instructions can access CPU memory or video memory with ease. Which is important as the console only has 256 bytes of CPU RAM. It was introduced on the TI-99/4 in 1979 and also used on the TI-99/4A.

### Length 1:

03   ; SCAN


This will scan the keyboard and/or joysticks using the mode found in CPU byte 8374 and place the scan code in 8375. Joystick displacements may be placed in 8376 (x) and 8377 (y), depending on the mode.

### Length 2:

07 20    ; ALL ' '


This will fill the first 768 (32x24) bytes of video memory with spaces. In the default video memory layout, this fills the entire screen with the given character. No provisions are made for different layouts or 40 column mode which uses 960 (40x24) bytes. The TMS9918A Video Display Processor (vdp) can place the screen on 1K boundaries and the character definitions on 2K boundaries. To maximize space for tokens and variables, BASIC places both of these overlapping at the beginning of the 16K video memory. This makes the first 96 character definitions unusable, so BASIC has a bias added to the ascii values on the screen. Provisions are made in several rom routines to accommodate this bias.

### Length 3:

95 A1 23    ; DINCT V@0123


This adds 2 to video memory word 0123. A word on the TI is 2 bytes, msb first. Most instructions can operate on a byte or word, in video and/or CPU memory. For video memory addresses from 0F00 to 3FFF, the encoding takes one more byte. Address encoding can get quite involved, including indirection and indexing.

### Length 4:

A0 A1 23 10    ; ADD @8310, V@0123


This adds CPU byte 8310 to video memory byte 0123. For CPU addresses 8300 to 837F, the encoding only takes 1 byte. Also, all CPU addresses have a bias of 8300 added to the encoded value. This is because the fast 256 bytes of CPU ram is at 83xx. For two operand instructions, like this, the destination is encoded first.

### Length 5:

08       ; FMT
21 48 49 ; VTEX 'HI'
FB       ; FEND


This will draw the string 'HI' vertically at the current display location, stored in CPU byte 837E (row) and 837F (col). GPL has an alternate interpreter known as the format sub-interpreter. The first and last lines enter and exit the sub-interpreter, respectively. Most of the FMT commands use the lower 5 bits of the opcode as a count, 1 to 32, encoded as one less than the count.

### Length 6:

30 10 A0 00 80 00    ; MOVE @8310, G@8000, V@0000


This will move the number of bytes in CPU word 8310 from GROM address 8000 to the beginning of video memory. Move is possibly the most powerful GPL command. It can use GROM address space as source or destination, in addition to using the usual address encoding. It can also use the read only video controller registers as a destination.

### Length 7:

06 00 34 ; CALL BEEP
03       ; L1: SCAN
40 13    ; BR L1
0B       ; EXIT


Now we have a real program that beeps once, waits for a key, and then resets the console. TI defined several fixed entry points for GPL calls such as BEEP, which plays a 1397 Hz tone for 200 ms. SCAN was used in the length 1 snippet. It also returns the condition (cnd) bit set if a new key was detected. BR Branches to the label if the cnd bit is Reset. Individual GROMs are 6K bytes on 8K boundaries and the BR and BS (Branch if cnd is Set) instructions are limited to targets in the current GROM. Cartridges are given complete control over the console, so an EXIT resets back to the power on screen.

### Length 8:

0F 17    ; COSX2: XML VPUSH
0F 0D    ; XML SMUL
06 00 2C ; CALL COS
00       ; RTN


This makes a subroutine that returns cos(x2). Where the input and output are the floating point value in CPU ram 834A. XML is eXecute Machine Language procedure. The second byte of the XML instruction defines the table (upper nibble) and index in that table (lower nibble) to get the address to execute. The first two tables (0x and 1x) are predefined in rom. VPUSH pushes the float at 834A onto the floating point stack in video memory. SMUL multiplies the float at 834A with the top of the floating point stack. COS calculates the cosine of the float at 834A (in radians). RTN returns back to the caller. The TI floating point format is 8 bytes with the first byte the exponent and the remaining 7 bytes are base 100 digits. This yields 14 decimal digits of precision. Not bad for 1979.

### Length 9:

07 20                 ; ALL ' '
35 00 C0 A3 00 A2 FF  ; MOVE 192, V@02FF, V@0300


This is what is needed to clear the screen in 40 column mode as noted in the length 2 snippet. This assumes that the screen is at the beginning of the video memory. The move copies the last byte filled by ALL to the remainder of the screen. This trick to fill memory by setting the move destination one more than the source is used in the TI GROMs quite a bit. Here we see move with an immediate count showing how flexible this instruction can be. Also, note that the built-in BASIC cannot use 40 column mode because of the video memory layout mentioned in the length 2 snippet. Extended BASIC with the expansion ram can use all of the video memory for video.

### Length 10:

0E C2     ; PARS >C2
83 4A     ; DNEG @834A
C6 4C 63  ; CH 99, @834C
76 71     ; BS 5671
10        ; CONT


This is an actual snippet from the built-in BASIC GROM called when an unary minus token is encountered. PARS and CONT are GPL commands that are only used by BASIC. PARS parses BASIC tokens until it reaches a token that is smaller than the value given. CONT continues the BASIC interpreter. The TI floating point format indicates a negative value by negating the first word. CPU address 834A is the current floating point value as mentioned in the length 8 snippet. CH sets the cnd bit if the destination is larger (unsigned comparison) than the source. BS jumps to GROM address 5671 to display an error message if the byte at CPU address 834C is greater than 99. This is the second base 100 digit of the floating point value. Since BASIC is written in GPL and GPL is also interpreted, the BASIC interpreter is painfully slow.

### Length 11:

02 FF       ; RAND 255
BC B0 00 78 ; ST @8378, V*8300
91 00       ; DINC @8300
90 78       ; INC @8378
01          ; RTNC


This is a routine that places a random byte at video memory pointed to by CPU word 8300, increments the pointer, then returns the cnd bit set if the number was 255. RAND n puts a random number between 0 and n into CPU byte 8378. ST copies that byte to video memory. V*8300 indicates indirection into video memory, but all pointers can only be in CPU memory. DINC increments a word. INC increments a byte and sets the cnd bit if the result is zero. RTNC returns from the routine without clearing the cnd bit. Normally, calls, returns, and branches clear the cnd bit. This feature can be used to create a fixed entry point table using BR which is a byte smaller than B (unconditional branch). This was used by TI as mentioned in the length 7 snippet.

### Factoid

Your Mom is a stack-based golfing language created because of a mbomb007's chat message on TNB:

I think someone should create a language called "Your Mom", just so that during an argument over which language is a better one, they can interject that "Your mom is a better language"

Source

Since Your Mom use Unicode, the length of the snippets are in characters, not bytes

### Length 1

+


+ pop two values and return their sum. Since there is nothing on the stack, the two values are read from stdin.

### Length 2

()


Define a empty function. ) is not needed since it's the end of the program.

### Length 3

#II


# push a zero, I pop the last value, multiply it by 24 and add 18, because Your Mom use base 24. The state of the stack at the end is [ 450 ]

### Length 4

¥()@


This snippet create a infinite loop.
¥ push 1 to the stack, () define a empty function and @ pop a function and call it while the element on the top of the stack is true (but don't pop it)

### Length 5

çç#,.


This snippet create 2 array (ç), push 0 in the last array (,) and concatenate the two arrays (.)

### Length 6

çÐ,€²Ç


This snippet create a array, push to it the user input (Ð), define a 1 character function that process the sqare of it's input (€²), and map it to the array.

### Length 7

Ð(:_⊟)@


This snippet read the user input and print it, and decrement it while it's not 0

### Length 8

##21®€²Ç


This snippet create a range from 0 to 20, create a one character function that square it's argument, and map on the range.

# Ouroboros

Each line of an Ouroboros program represents a snake eating its own tail, with the beginning of the line being the head and the end being the tail. The only control flow operations are commands to eat or regurgitate characters of the tail. When the instruction pointer reaches the last part of the line that hasn't been eaten, it loops back to the beginning. To stop execution, simply swallow the instruction pointer.

### Factoid

Ouroboros has a Stack Snippet interpreter.

### Length 1

n


Outputs the top of the stack as a number. An empty stack is treated as if it contained infinite zeros, so this outputs 0. No characters are ever eaten, so the program loops (and prints) infinitely.

### Length 2

1(


Pushes a 1 and then uses ( to eat that many characters from the end of the snake. This means eating the last character. However, since that's where the instruction pointer currently is, the snake dies and the program terminates.

The program would also terminate if the number were 2, or indeed any larger number; in that case the entire snake would be swallowed. (Physically impossible, but hey--this is a metaphor.)

### Length 3

32n


Although Ouroboros processes one character per tick, it still supports multi-digit numbers in the expected way. This program will push and output 32 infinitely (rather than, for instance, pushing 3, pushing 2, and outputting only the 2).

One interesting side effect: a multi-digit number is recognized as such even when it bridges the end of the snake. The code 2n3 will first output 2, but thereafter will output 32 infinitely.

### Length 4

rnao


r reads a positive integer from input, grabbing all contiguous digits until it finds a non-digit. n outputs as a number. a pushes 10, and o outputs this as a character (newline). Thus, an input of 1 2.3 -4abc55 will yield

1
2
3
4
55


However, because this snippet doesn't terminate the loop when the input is used up, the program will continue: r will start giving -1s to signal end-of-input, and n will keep outputting them indefinitely.

### Length 5

n?2*(


Prints one or more 0s, with the exact count depending on random numbers.

n behaves as in snippet 1, outputting a 0 from the empty stack. ?2* generates a random floating-point number between 0 and 1 and doubles it. Then ( eats that many characters (rounded down). Thus, if ? generated a number >= 0.5, the program halts; if not, it loops, prints another 0, etc.

### Length 6

"oooo(


" toggles between executing characters and treating them as a string. As in other 2D languages, you can define a string using only one quote mark because the instruction pointer wraps around. A key difference with Ouroboros, however, is that the string is pushed in reverse order, so that the first character is on the top of the stack. This means we don't need to write strings backwards or have a stack-reverse operator like ><> does.

The above code pushes "oooo(" and outputs the first four characters (the os). It then uses the last number remaining on the stack (40, the charcode of () as the argument to the ( command. Eating 40 characters definitely swallows the IP, and the program halts.

### Length 7

r.*.n!(


Truth machine program.

r reads a number from input, or -1 for EOF. .* multiplies it by itself, keeping 0 and 1 the same but mapping -1 to 1. .n dups and outputs the number. Finally, !( logically negates and eats that many characters of the end of the snake. If the number was 0, this eats the ( and dies. If the number was 1, this eats zero characters, and execution loops back to the beginning of the snake, printing 1 indefinitely.

### Length 8

i.0<2*(o


Cat program.

i reads a single character from input, pushing its charcode (or -1 on EOF). .0< duplicates and tests if the value was less than 0; i.e., pushes 1 on EOF and 0 otherwise. 2*( multiplies by 2 and swallows that many characters. On EOF, this eats (o and ends the program; otherwise, nothing is eaten, and o outputs the character from input. The snake then loops back to the beginning.

In writing this snippet, I realized that cat can actually be done in four characters: i.)o. Go read the explanation on that answer for some crazy abuse of undefined behavior.

(Length 9 snippet pending)

### Length 10

.!+.@.nao+


Outputs the Fibonacci sequence, starting from 0 and continuing indefinitely.

First, we need to initialize the stack by pushing a 1. The trouble is that any initialization code at the head of a snake will run every time through (since it's at the head, we have no way of eating it). Therefore .!+ is designed to turn the top of the stack into a 1 iff it was previously 0 (which is the case when the stack is empty). .! dups and logically negates (1 if the value was 0, otherwise 0), and + adds that result to the top value.

(For a version that uses a second snake to perform the initialization, see the GitHub readme.)

Now the bulk of the program. Call the two numbers on the stack x and y, where x is smaller and y is on the top of the stack. .@.n copies y, rotates x to the top, and outputs a copy of it. ao outputs a newline (as in snippet 4), and + adds x to a copy of y. Now the stack contains y and x+y, and we proceed to the next iteration.

## Oasis

### Factoid

You can try it online here.

### Length 1

n


Not very interesting, just push n (The current argument) and print it because implicit output.

### Length 2

n1


Same as the previous snippet, but give 1 for the argument 0.

Oasis programs can have a list of hardcoded definitions for special cases.

So n1 can be described in pseudocode as:

A(n) = n
A(0) = 1


Special cases and indexes are reversed, so to make

A(0) = 1
A(1) = 4


The correct special cases definition is 41

As @Adnan pointed it out, another interesting snippet is the fibonnaci sequence:

+T


Because T is replaced with 10, so this is expanded to

+10


Which mean

A(n) = A(n - 1) + A(n - 2)
A(0) = 0
A(1) = 1


### Length 3

n*1


Finally, an useful snippet!

This calculate a factorial.

     A(n) = n * A(n - 1)
n    Push n
*   Multiply two items on the stack
Because there is only one item on the stack, A(n-1) is pushed
1  A(0) = 1


### Length 4

n*x1


Showcase the command x (Double a number).

This is basically a factorial, but double the number returned by n*A(n-1).

A(n) = n * A(n - 1) * 2
A(0) = 1


### Length 5

Tnm>1


Calculate A000533

       A(n) = 10^n + 1
T      Push 10
n     Push n
m    Power
>   Increment
1  A(0) = 1


### Length 6

Tnm<9÷


A002275 aka repunits

        A(n) = (10^n - 1) / 9
T       Push 10
n      Push n
m     Power
<    Decrement
9   Push 9
÷  Floor divide

• Another interesting 2 byte submission is +T, which is the Fibonacci sequence :). – Adnan Nov 12 '16 at 18:46
• You can also add a Length 6 snippet. – Erik the Outgolfer Nov 13 '16 at 10:45

# Golfical

Golfical is a shiny, brand-new graphical programming language I made over the past few days, and published earlier today.

It uses a stack, a tape, and a register as memory. But primarily the tape.

The included encoder utility can be used to compress programs into a raw binary form, which can then be converted back to the original image or run directly by adding the -x flag. This requires from one to three bytes for each pixel, plus three bytes extra for encoding the dimensions (length and width are encoded as twelve bits each, just in case 8 isn't enough for some reason.)

Of course, the encoding is somewhat lossy, as all other colors that don't have instructions assigned to them are changed to white (both to save space and because the specs guarantee that no instruction will ever be assigned to white.)

One pixel example:

Magnified 200x, with color labels:

When the red channel is zero, Golfical interprets the green and blue channels as an integer literal and stores it in the target of the pointer. Thus, this stores the value 255*256+255=65535 into the target of the pointer. This is the largest number that can be stored directly in this way, though cells can be set in longer ways to values as large as 231-1.

In the binary encoding generated by the included Encoder utility, this would represented by three bytes; the encoding includes an optimization that allows only two bytes to be used for this instruction when the green channel is zero.

Two pixel example:

Magnified 160x with color labels:

(10,0,0) inputs a number and (10,1,1) outputs it as a character. In the compressed binary encoding, these two instructions add one byte each.

Three pixel example:

Magnified 160x, with color labels:

(10,0,1) is like (10,0,0), except it reads a character instead of a number. (12,0,0) pushes the target of the pointer to the stack. (The binary encoding represents these instructions as 1 byte each.)

Therefore, this snippet reads a character, pushes it to the stack, and then reads another character.

Four pixel example:

Magnified 125x, with color labels:

Simulates the rolling of a d100. The two new instructions here are 02xxxx (which works like 00xxxx but as an increment instead of an assignment) and 0D0001 (13,0,1) which sets the target of the pointer to a random integer between 0, inclusive, and its previous value, exclusive. Like 00xxxx, 02xxxx is represented in the encoding using two bytes if the green channel is zero or three otherwise. 0D0001 is represented as one byte.

Five pixel example:

It took me a while to decide what to do with this one, but eventually I decided to go with this:

Magnified 125x, with color labels:

(11,0,0) through (11,0,3) are absolute turn instructions (relative turn instructions, as well as many of the conditional relative turns, are later in the 11 block). (11,0,1) is East and (11,0,3) is West.

This program prints lolololololololololololololololololo ad infininum.

Six Pixel Example

Magnified 200x, with color labels:

An infinite counter (limited, of course, by the 32-bit two's complement integer range; a proper infinite counter would be much harder to implement.) Also our first properly 2-dimensional example here.

Eight pixel example:

Magnified 100x with color labels:

A primality tester using the language's prime testing builtin (14,3,0), which makes a relative right turn if and only if the target of the pointer is prime. The official encoder program encodes this program in 13 bytes.

• Example one, please? – Conor O'Brien Dec 14 '15 at 19:21
• @CᴏɴᴏʀO'Bʀɪᴇɴ Here you go. – SuperJedi224 Dec 14 '15 at 20:43

# Batch

### Factoid

Batch uses commands that the Windows command line uses. A bunch of these were inherited from the (ancient) MS-DOS.

### Length 1

:


This creates an empty label. In Batch, empty labels are perfectly legal, even if they don't do anything.

### Length 2

at


This command schedules commands and programs to be run at a specified time. The batch file must be granted elevated administrator privileges for this to work.

### Length 3

rem


A command that discards parameters supplied after it. This essentially comments out text.

### Length 4

echo


With four characters, we can finally print text! This will print out whatever comes after it.

### Length 5

start


As one of the most simple commands, this just opens up a separate command-prompt window. Nothing too complicated about this at all.

### Length 6

chkdsk


This command also requires elevated administrator privileges. This command is short for "check disk". It does what it says; it checks a disk and provides a status report.

### Length 7

replace


This command is used to replace one file with another. The file names are passed as parameters to the command.

### Length 8

shutdown


This command can shutdown your computer. It has a variety of parameters, and like setting shutdown time, a shutdown comment, or aborting the shutdown.

• Length 9: BITSADMIN... – stevefestl Jun 24 '17 at 1:04

# ForceLang

ForceLang (name proposed by TanMath) is a programming language I published on January 12.

Functionality includes arbitrary-precision rational numbers, both console and GUI IO, and file input (file output has not yet been added, but will likely be added later)

Control flow is currently handled using gotoes, evaluated gotoes, and conditionals.

Length 1 snippet: 0

A number literal for the rational number 0/1.

Length 2 snippet: io

The io namespace contains the language's console and file IO functionality. GUI IO is located in a separate namespace.

Length 3 snippet: nil

A constant field containing the null reference.

Length 4 snippet: 0xFF

A hexadecimal number literal for the rational number 255/1 (hexadecimal literals can only be used for integers).

Hex literals are useful as color codes for the language's (currently somewhat limited) graphics library.

Length 5 snippet: 11/13

A number literal for the rational number 11/13, which is stored exactly as a BigRational.

Length 6 snippet: !!TRUE

Obviously, this returns TRUE.

Length 7 snippet: def a a

An abuse of the def instruction that causes any subsequent attempts to evaluate the expression a to result in an infinite loop.

Length 8 snippet: gui.show

A method that produces a simple gui alert.

Length 9 snippet: math.sqrt

Estimates the square root of a number as another BigRational. It does this by doing some math to find an integer which approximates this value, then applying four iterations of the Babylonian Method to this initial approximation.

Length 11 snippet: random.rand

The function random.rand can be used to produce random numbers on [0, (2^m-1)/(2^m)] for arbitrary positive integer values of m (effectively on [0,1) as m becomes large). When called with no arguments (random.rand()) it uses m=80.

Some other answers in this language:

• We need two more snippets :) – Fund Monica's Lawsuit May 5 '16 at 17:20

# KSFTgolf

I've finally finished at least a very early version of an interpreter for my golfing language KSFTgolf. It probably doesn't work very well, but I'm hoping to make it better by adding instructions that would help to solve problems here. I'll probably be updating it several times while this is posted. I'll try not to break the examples I've already posted. The interpreter is here:

https://github.com/KSFTmh/KSFTgolf

I'm pretty sure there's something wrong with nested loops in the current version of the interpreter. I'll try to fix it, but for now, some of these might not work.

## Length 4

r2eu


This takes a list of numbers as input and prints the sum of the squares of those numbers. Single-digit numerical literals like 2 push their value, e is the exponentiation function, and u pops a list and pushes the sum of its elements.

## Length 3

trm


This prints all of the primes up to 1000. t pushes 1000, and r is like a for loop.

## Length 2

on


This takes a character as input* and prints the ASCII value of it in binary. o calls Python's ord() function on the top element of the stack, and n converts the top element of the stack to binary.

## Length 1

m


This takes a number as input and prints 1 if the number is prime and 0 otherwise. Input is pushed onto the stack at the beginning of the program and the entire stack is printed at the end.

*It uses Python 2's input() function, so string inputs have to be in quotes.

## Factoid

Objects in KSFTgolf don't have types. They're converted whenever they're used.

• I don't know if this is a valid language, but I'm curious about it. – Ismael Miguel Jan 23 '15 at 15:45
• @IsmaelMiguel What do you mean by "valid"? – KSFT Jan 23 '15 at 15:49
• Well, there is no documentation. There is only your implementation in python. That is what I meant. But still, I'm curious about it! (Btw, I'm trying to write my own language too (I just get too lazy to write any code). Not a 100% golfing one but can be easily addapted.) – Ismael Miguel Jan 23 '15 at 15:55
• It will. Also, the documentation will help you to keep track of your progress and goals with the language. A basic documentation might take 2-3 hours to write. But it will be worth it! – Ismael Miguel Jan 23 '15 at 16:00
• You can write a sloppy documentation, which will take considerably less. But it will look terrible. It's always better to write a good documentation. It shows professionalism and enthusiasm! But yeah, it can take that time. Try it and you'll see I'm right. – Ismael Miguel Jan 23 '15 at 16:23

# Rebol 2

Note: There is already an answer for Rebol, but it is specific to Rebol 3, which has some significant differences. I wanted to highlight some of the features that are unique to Rebol 2 as these deserve a mention.

Factoid: Rebol stands for "Relative Expression Based Object Language". It is a homoiconic language (that is, code and data are expressed the same way).

### 1

?


This brings up the built-in help in the command-line interpreter. It is a mezzanine function.

### 2

[]


Evaluates to an empty block (type block!) which groups together values and functions and is a container for data until it is evaluated, in which case it is treated as code. Elements of blocks, even nested blocks, can be accessed via a path.

### 3

pwd


Evaluates to a value of type file! that is the current working directory, just like in the shell! Rebol provides some familiar shell commands, like cd, ls pwd and rm as mezzanine functions which behave like they would in the shell, so you can navigate around, and work with the file-system and forget that you are actually in the Rebol interpreter!

### 4

12x3


Pairs. They are everywhere, right? In spatial co-ordinates, screen dimensions, on the park bench. pair! is another built-in type that consists of two integers separated by an x, just like you write it and would like to read it. But there's more: You can slice them, dice them, add and subtract them, get at their values with /x and /y (/ being the refinement modifier that allows you to access things like values in objects or entries in arrays using a very natural, path-like syntax).

### 5

2 + 2


The + here is in fact an operator function, or infix function, taking two arguments: one on the left and one on the right. Typing ? op! at the Rebol console will give us a list of all these operators (type op!) which includes the usual suspects, like != and <> (both meaning not equal), ** (power-raiser) and xor (exclusive XOR) among others.

# Joe

### Factoid

Joe is a language I've been working on for some time. It was designed to make list mappings and interactions with functions and other lists implicit and powerful.

### Length 1

In Joe, the result of the last expression of every line that isn't a function, is printed. Thus, the following program prints 1 and exits. Note: the code is indented by 3, output by 0.

   1
1


### Length 2

Functions can take one or two arguments. If called with one argument, the argument appears on the right side of the function. Monadic R gives range from 0 to y, excluding.

   R5
0 1 2 3 4


### Length 3

If a function is called with two arguments, they surround the function. Here we call R with arguments 2 and 7. Dyadic R gives range from x to y, inclusive.

   2R7
2 3 4 5 6 7
7R2
7 6 5 4 3 2


### Length 4

Joe does have higher-order functions, but they cannot be defined by the user. Not that you would want to.

:/>c


Here, >c ("greater choose") is a function that returns the greater one of it's parameters (1>c4 returns 4). / takes it and returns a function that applies the >c between the items of it's arguments (think of rfold1). So, />c is a max function! : then saves it to name F. Let's test this out.

   F1 2 3
3
F1 3 2
3


### Length 5

Joe has some handy ways to control data flow. Let's see one of them.

   O$rMH"Shelly""Leo""Mike" Leo Mike Shelly O$rME"Shelly""Leo""Mike"
Mike
Leo
Shelly


## 5 Chars:

{:x:y}


Simple for loop, for i (that's i for Implied Imaginary) in x do y. More colons can expand this into a first, second, third C-style loop.

• Note that when I say this language is "currently in development," I mean I just started writing the spec for v0.1 yesterday and I'm less than a quarter done. I wonder how long it will be before we've got an interpreter or I can use LS on PPCG... – cat Oct 17 '15 at 16:43
• I really want to write a program in this now. :( Too bad there's no interpreter – user46167 Dec 19 '15 at 23:17
• @ev3commander oh, dear... I had abandoned this project... if you're interested (in helping?), I'll finish the spec and prototype something (because I currently have no idea how to write an interpreter, and I'm also working on mouse15) – cat Dec 19 '15 at 23:32
• @ev3commander the syntax in its current form is gonna be a pain to parse, so I need to work on that. – cat Dec 19 '15 at 23:34

# Beam

### Factoid

Beam is a 2-dimensional language designed in 2010 by an Esolangs Wiki user named Feuermonster, and was originally implemented in 2012. It was re-discovered by me while looking for an interesting language with which to answer the famous "Hello, World!" catalog. The official interpreter has been lost, but PPCG user MickyT has developed a Stack Snippet interpreter.

Beam is based off of three storage values:

• the beam, the primary storage; holds one unsigned 8-bit integer.
• the store, the secondary storage; holds one unsigned 32-bit integer.
• the memory, a (theoretically) infinite tape of unsigned 8-bit integers.

### Length 1 snippet

H


Yay, our first full program! Unfortunately, we can hardly do anything in just 1 byte. H simply halts execution of the program, so from this, we get no output at all.

### Length 2 snippet

:H


Now we get a chance to see some output. : prints the value of the beam as a number, so this program outputs 0. If we were to drop the H, it would still print 0, but it would also give us the error message Beam is lost in space. This error occurs anytime the beam travels beyond the bounds of the program.

### Length 3 snippet

r@H


First lessons in inputting: r sets the beam to the char code of the next character in STDIN. @ is like :, except that it outputs as a character instead of a number. All in all, this program outputs the next character from the input. Not that useful, but pretty decent for 3 bytes. ;)

### Length 4 snippet

++:H


Here we have the new character +. Can you guess what it does? (Hint: this program outputs the number 2.)

### Length 5 snippet

v
\:H


Finally, a chance to use Beam's 2D instruction plane! Beam has four arrows ^v<>, which set the direction of the beam, and four mirrors \/|_, which reflect the beam in another direction. It also has several conditional direction changers, which we'll get into in a little bit.

### Length 6 snippet

)n+!
H


Here we demonstrate a few of the conditional statements. ) and ( change direction to left or right if the store <> 0. ! and ? reverse the flow direction depending of the value of the beam. n and u change the flow direction to up or down if the beam != the store.
So in the snippet above, ) does not change the direction since the store is 0, the flow continues through n as the beam and store are both 0. + increments the beam. ! reverses the flow since the beam is now 1. + the beam again. n now changes the flow direction down since the beam is 2 while the store is still 0. Halt the program.

### Length 7 snippet

+P+:p:H


Bit of a boring snippet, but it demonstrates the setting and retrieving of memory values. P will set the memory at store position to the beam value. p will set the beam to the value at the stores memory position. In this example the beam is incremented to one. Memory location 0(store) is set to 1(beam). The beam is incremented and the value printed. Memory location 0 is retrieved into the beam and printed. The output is 21

• :D awesome. Yeah, I cleaned-up my vServer a while ago and most of the eso stuff got lost :(. Thanks for keeping it alive. – mroman Oct 23 '15 at 16:35
• @mroman Thanks for a fun little language to play with. I hope the snippet does what it should. – MickyT Oct 24 '15 at 1:36
• I wrote an interpreter in python for it today: gist.github.com/FMNSSun/3cc9c08e69a98eb0ae01 I hope I didn't make any mistakes. – mroman Oct 24 '15 at 13:16

# TeaScript

## Length 6 Snippet

r×ß¥l©


This looks like gibberish so here's the ungolfed version: r(x)m(#$P(l)). This returns a list of first n numbers and if they are prime. An output for the input 5 would be: false,false,true,true,false ## Length 4 Snippet £lc)  Now we're getting somewhere. This loops through each character of the input and replaces the character with it's character code. ## Length 3 Snippet ¥x)  Checks if the input is prime. Returns true or false respectively. ## Length 2 Snippet xv  x is the input, v is a function which will reverse x. This essentially reverses the input. ## Length 1 Snippet M  The M character is preset to return a random number Try any of these online ### Factoid: TeaScript was born after I got fed up with JavaScript's incredibly long String.fromCharCode function. It was originally made to have just shortened property names but TeaScript has grown quickly. # Mouse-2002 ### Length 6 &GMSUN  Pushes on the stack 1.32712438E+20 (in scientific notation!), or the gravitational mass of the sun.2 ### Length 5 &SWAP  Swaps the top two things on the stack. Concisely, ( x y -- y x ). Again, not that interesting; most mouse programs have to be somewhat longer to be interesting. ### Length 4 &DUP  Duplicates the thing on the top of the stack. That is, makes a copy, and pushes that copy. Unfortunately expensive in terms of bytes. I think it was not the first thing on Simpson's list of easy-to-access functions. Not particularly interesting. If you've ever seen or written False (or, for that matter, False!) or, indeed, Forth, you'll notice a lot of Mouse is shockingly similar. I love Forth, and my guess is False's creator had perhaps heard of Mouse (because Mouse far predates False, but is predated by Forth by 9 years). ### Length 3 &AU  Pushes "the value of one astronomical unit of distance"1 to the stack. The guy who reimplemented and updated this language had a hand on programming spaceships at NASA for the Apollo missions, so it figures he'd include a whole bunch of physics and maths related constants. My reboot of the language will also contain these constants, because they're cool. ### Length 2 A:  Takes the thing on the top of the stack and puts it in A. e.g, 1A: puts 1 into A, and 3 5/A: puts 3/5 into A. (oh yeah, Mouse uses Reverse-Polish-Notation!) ### Length 1 ?  Prompts for a number to be input, and puts it on the stack. ### Factoid: Mouse-2002 is an updated reimplementation of Mouse-83 by David Simpson. Mouse-83 was described in the book Mouse: A Language for Microcomputers by Peter Grogono. It includes a number of enhancements over the earlier version, Mouse-79, which was described in an article by Grogono in Byte magazine in July 1979. Mouse is a rather ancient, yet turing-complete stack based language, which, while no instruction uses more than a byte, is still likely less golfy than CJam or Pyth. Fixed interpreter here. I'm planning to update it and reboot it with even more concise syntax and better features; no interpreter yet, though. It will be almost as golfy as CJam (though that isn't the main intent) while being far more readable and usable outside codegolf. # LabVIEW LabVIEW is a graphical programming language mainly used for measurement technology. ### Factoid: LabVIEW used to store Bools in 2 Bytes Note: since LabVIEW is strictly graphical the sizes are in Labview Primitives ### Lenght 1 Snippet LabVIEW is used in 2 windows, the left one (Block Diagramm) where the programming happens and the right one (Front Panel) for in and output. Putting a control on the Block Diagramm automatically puts the input on the Front Panel ### Lenght 2 Snippet there is actually no working programm of size 2 apart from just putting 2 controls or constants, so ill add another fact. LabVIEW works exceptionally well with Arrays. They can be automatically indexed when put into a for loop and you can easily use basic arithmetic and binary operations on arrays and numerics of different dimensions. ### Lenght 3 Snippet I just realized i could use express VIs but that feels like cheating. They are basically full written out programms that get compressed into 1 VI. I might put one in if anyone wants to see it, so leave a comment. ### Lenght 5 Snippet This is one of the array operations one can do. ### Lenght 6 Snippet Another fact: The size of a full LabVIEW installation can be well over 20 GB. # PoGo ### Factoid PoGo is an esoteric programming language that consists only of two letter commands with one vowel and one consonant each, designed to make the source code read funny. It operates on a two dimensional memory grid and three different stacks. ### 2 Characters qi  Output: poqigo  qi is one of the special purpose output commands, just for fun (others include wo wich outputs "Hello, world!"). What's special about poqigo? Wait for the 6 characters program! ### 4 Characers isis  Output (example): What is my purpose? What is my purpose?  is is another special purpose output command, specified as "have an existentialist crisis". The message is choosen randomly, but at least in the official implementation it is memoized so that calling is twice gives the same output twice. ### 6 Characters poqigo  Output: poqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigopoqigo[...]  In the documentation, poqigo is mentioned as an example for a quine and obviously that's the only purpose of the qi command, but it actually isn't a real quine since it outputs itself infinitely, not just once. With this example we learn the basics of flow control in PoGo. You use a call stack (the "po" stack): • po - add current position in code to the top of the po stack • go - pop the most recent po location off the stack and jump there So po ... go produces a loop and if you don't use any conditions to break out of it, it's an endless loop • Six votes. What on earth is poqigo? :) – Conor O'Brien Feb 21 '16 at 17:57 • @CᴏɴᴏʀO'Bʀɪᴇɴ There you go :) – Fabian Schmengler Feb 21 '16 at 21:37 # Math++ The latest addition to my arsenal of custom languages. Also the first to include a mathematical expression parser. Operates exclusively on 64-bit IEEE754 floats. Control flow consists exclusively of evaluated gotoes. Length 1 snippet: ? A special expression that returns a number taken from the input. Length 2 snippet: !0 Returns NOT 0, which obviously equals 1. (If you call the ! operator on any value other than 0, it returns 0) Length 3 snippet: 0>$

This is the first snippet here to show the > symbol, which, in this language, is not a greater than operator but rather a symbol to separate an expression from its (optional) target designator. (The target designator out, meaning that the result should be printed to the output, is the default.) In this case, the target designator $ indicates that the result should be floored and then stored to the instruction pointer (thereby going to that number line.) Going to line 0 is considered an exit statement, going to any other out-of-bounds line number triggers an exception. Length 4 snippet: _a>a Floors the value stored in a, then stores the result back to a. Length 5 snippet: 1>{0} Associates the value 1 to the key 0 in the map. Length 6 snippet: cbrt$e

An expression that yields $\sqrt[3]{e}$

($e is Euler's constant, just plain e is a variable; the language also supports pi ($pi) and the golden ratio ($phi)) Length 7 snippet: 9*$rand

$rand returns a random floating-point value greater than or equal to 0 but less then 1. Therefore, this expression returns a random floating-point value greater than or equal to 0 but less then 9. Length 8 snippet: sin$pi|1

We've got logical operators, too!

This should return 1, but because of a rounding error in the evaluation of sin$pi, it yields 1.2246467991473532E-16. Darn you, IEEE. # Clip # Factoid The empty program in Clip copies its input to the output (i.e. the cat program). This is because an incomplete expression takes the missing part as a string from stdin. Here, the whole thing is missing, so that is used. Each program just prints the result of an expression, here a simple string. # Length 1 snippet A  I've seen obsolete features, but this... A is a supplier which returns the alphabet in upper case. This therefore outputs it. # Length 2 snippet 1A  If you have more than one expression at the root, only the first is evaluated and printed. Therefore, this program prints 1. # Length 3 snippet \{  Lists use the syntax {elem1elem2..elemn<backtick> (can't actually put a backtick there for formatting issues). There is no separator, as Clip can figure out how many expressions there are. The reason for this weird syntax is that { initialises a ListBuilder, which consumes all expressions it receives and shoves them on its list. Backticks escape things, for example +<backtick> is the plus function in a format that can pass it to other functions. However, ListBuilders happen to become a list when escaped, so that's what happens. Finally, the \ function converts a list to a human-readable string i.e. {1 2 3 4 5<backtick> becomes {1, 2, 3, 4, 5} instead of the default 12345. The output of my length 3 snippet is not {}, however, as the default formatting for empty lists is as strings (lists of numbers with ischar: true). It is therefore "". # Length 4 snippet bW42  W is a supplier that always returns 2 (this allows for no spaces between 2 and 42 here; just 242 would be interpreted as the number 242). bxy supposedly converts y to base x and returns a list of digits. So, what should this snippet return? 101010, for 42 in base 2. But it actually returns 21010. I don't know why, but that is not base 2. If you replace the 2 with 10, however, this function will always give the right answer (because in base x, 10 = x). Edit: Turns out this was a bug in the v2 interpreter I was using; v5 seems to handle it correctly and print 101010. # Length 5 snippet "..."  You expect this to print ... (though the second quote would be unneeded), but . is Clip's escape character - like most languages' \. If you imagine this as "\\\", it becomes clearer that the first escape escapes the second to make a literal ., and the last escape escapes the second quote to make it literally ". There is no closing quote, as these are unneeded, so this snippet prints .". # MIPS Factoid: Though many see MIPS's heyday is in the past with ARM taking over the market, the classic RISC design often taught in universities continues to be widely used in embedded devices and newer small devices in Asian markets. Length 1 Being assembly, not much can be done in one instruction. That being said, MIPS does offer an interesting native (not psuedo-) instruction: BGEZAL, Branch on greater than or equal to zero and link. Hex code Syntax 0x05110000 bgezal$t0, label


# 𝔼𝕊𝕄𝕚𝕟

## Length 10 Snippet

ɟ⍞#rœэ¡²Ĩċ


Here's a really nasty infinite loop. It uses jQuery to press the "Run" button, which will execute the code that presses the "Run" button, which will execute... You get the idea. Even worse, it's impossible to stop without force-quitting Firefox itself, so be careful when running.

Also, this snippet uses compression: э¡²Ĩċ decompresses to \click.

## Length 9 Snippet

ᵭꞒ↷+⬭+ᶑꞒ㘯


This is a fancy way of outputting Hello world. It uses the builtin Scrabble dictionary.

## Length 8 Snippet

ʗć⁽ḊḞĒX


This outputs X to the canvas. Yes, 𝔼𝕊𝕄𝕚𝕟 has a canvas.

## Length 7 Snippet

ⓑᴙą1


Determines how even ï is. Notice that the ï at the end is missing (which is allowed through implicit input behavior).

## Length 6 Snippet

⟮ɕṡ+ᶈ0


This is a quine. ⟮ (copy block) stores any code after it into an array, ɕṡ is the ⟮ character, and ᶈ0 gets the stored code.

## Length 5 Snippet

ɟ⍘*Ĭ)


This removes all of the interpreter's HTML using jQuery. It's an example of how manipulative 𝔼𝕊𝕄𝕚𝕟 can get with the interpreter's code.

## Length 4 Snippet

¡МĂï


This calculates the factorial of ï. One difference: this uses a bignumber function to calculate values greater than 171 (JS's ordinary limit) accurately and quickly.

## Length 3 Snippet

Мȫï


This outputs the ïth Fibonacci number. Мȫ is a math lib builtin.

## Length 2 Snippet

⩤Ṥ


This outputs from 0 to 100. ⩤ is the inclusive range function, and Ṥ is the alias for 100. There are variables for numbers from 0 to 256.

## Length 1 Snippet

ï


Here's a cat program! Quite simply, it gets user input and implicitly outputs it. Note that a 0-byte program would also be a cat program because of implicit input behavior.

## Factoid

𝔼𝕊𝕄𝕚𝕟 (or ESMin for any of y'all who can't see the doublestruck chars) is a code-golfing language (sort of) based on Javascript ES6. Its code page contains almost 1024 chars to account for the various aliases present.

• I just discovered that your title actually renders properly in firefox (it doesn't here in chrome) – SuperJedi224 Nov 15 '15 at 20:55
• For me, it renders fine on my Mac and in ChromeOS, but not in Windows 7. – Mama Fun Roll Nov 16 '15 at 22:35
• I really should learn this. – DJgamer98 Nov 17 '15 at 8:24
• I'm currently working on updating the docs... Perhaps you should look at the source code of the interpreter for now (if you are familiar with Javascript ES6). – Mama Fun Roll Nov 17 '15 at 14:20
• @SuperJedi224 For the first time ever, I can see the title in all browsers! – mbomb007 Dec 16 '15 at 23:06