Ctrl+P again to print, arrows/tab to navigate results, Enter to confirm, Ctrl+Enter to open in new tab.

    See the online interpreter and the docs.

    Misc

    {...}m
    {...m
    
    {...m
    m...
    
    j{e}m
    j{em
    eLr          # Only works if there is nothing else on either stack
                 # (L consumes everything on both stacks) 
    

    Packing

    Packed Stax

    Packed Stax can be used to save characters on any solution that uses the first 95 printable ASCII characters (32-126), by converting it to base 256. You can use the string literals packer in the online interpreter's tools section (F9) to convert any string to this 95 character constraint efficiently. The Packed Stax packer is also found in the tools section under Source.

    Solutions that have the same number of bytes do not necessarily have the same number of characters when packed. This is due to the conversion from base 95 to base 256 falling on either side of a character (byte) boundary, because the ASCII values of your "most significant" characters are higher/lower than the other solution. The "most significant" characters are the last characters (with the last character being the most significant). You can use that information to "leak" an upper/lower bound for the last character of a solution, if you know the bytes of the original solution and the characters of the packed solution. This table shows the last character boundaries for the first 30 bytes.

    bytes chars crossing boundary
    2 1/2 !
    3 2/3 #
    4 3/4 )
    5 4/5 :
    6 5/6 g
    8 6/7 "
    9 7/8 %
    10 8/9 .
    11 9/10 G
    13 10/11 !
    14 11/12 #
    15 12/13 (
    16 13/14 5
    17 14/15 Z
    19 15/16 !
    20 16/17 $
    21 17/18 ,
    22 18/19 @
    23 19/20 x
    25 20/21 "
    26 21/22 &
    27 22/23 2
    28 23/24 P
    30 24/25 !

    A 3:1 packer

    Spoiler

    Your code must be printable ASCII (the same constraint as Packed Stax).

    The overhead is 13 characters so your uncompressed code must be at least 27-29 bytes to get a benefit over Packed Stax (the range is due to the crossing boundaries from Packed Stax).

    Stax special cases programs that start with m, f or F, and implicitly calls L. So for source code starting with either of these, you must prepend L like "Lm..." before compressing.

    Decompressor

    "..."{96|EVps@ml
    

    Compressor (python)

    code = "..."
    out = ""
    for i in range(0, len(code), 3):
        v = 0
        for c in code[i:i+3]:
            idx = ord(c) - 32
            # Prevents getting a null byte or similar from 3 spaces
            # since @ is modularised 95 == 0 
            digit = 95 if idx == 0 else idx
            v = v * 96 + digit
        out += chr(v)
    
    print('"' + out + '"' + "{96|EVps@ml")