Trick or Treat polyglot

Python / Windows Batch, 25 bytes

print"trick"#||echo.treat

Everything after the # is interpreted as a comment by python, while the || is an OR in batch, saying that as the previous command failed, execute this one.

I also like the use of an OR as it almost reads "trick or treat" :)


Whitespace / Starry, 135 bytes

Here's to a clear night sky on Halloween!

  + +    +      + + 
    +

* +   +*      +     *

   +    *           
     + +        

 +* +   



 +* + .  + .   +      +* +   +* . . .

Note that whitespace on empty lines may not be preserved if you copy from the above code

Whitespace outputs "TRICK". Try it Online!
Starry outputs "TREAT". Try it Online!

Explanation

Starry

Starry ignores all tabs and new lines so the code it reads is the following

         + + + + + +  * +   +*   +  *   +  *       + +   +* +   +* + .  + .   +      +* +   +* . . .

Bytewise, pushing values is very expensive compared to stack and arithmetic operations in Starry. The code starts by pushing and duplicating 4 and the performs a number of operations on it and with 2 and 1 pushed later on produces all of the required ASCII values.

Annotated Code

Stack (after op)    Code        Operation
4                            +  Push 4
4 4 4 4 4 4          + + + + +  Duplicate top of stack 5 times
4 4 4 4 16            *         Multiply top two items
4 4 4 4 16 16        +          Duplicate top of stack
4 4 4 16 4 16          +        Rotate top three items on stack right
4 4 4 16 20         *           Add top two items
4 4 20 4 16            +        Rotate...
4 4 20 64             *         Multiply...
4 64 4 20              +        Rotate...
4 64 80               *         Multiply...
4 64 80 2                  +    Push 2
4 64 80 2 2          +          Duplicate...
4 64 2 80 2            +        Rotate...
4 64 2 82           *           Add...
4 64 2 82 82         +          Duplicate...
4 64 82 2 82           +        Rotate...
4 64 82 84          *           Add...
4 64 82 84 84          +        Rotate...
4 64 82 84           .          Pop and print as character (T)
4 64 84 82            +         Swap top two items on stack
4 64 84              .          Pop and print... (R)
84 4 64                +        Rotate...
84 4 64 1                 +     Push 1
84 4 65             *           Add...
84 4 65 65           +          Duplicate...
84 65 4 65             +        Rotate...
84 65 69            *           Add...
84 65                .          Pop and print... (E)
84                   .          Pop and print... (A)
                     .          Pop and print... (T)

Whitespace

As the name may suggest, Whitespace only parses the three whitespace characters—space, tab, and newline. Unlike the Starry, the Whitespace simply pushes the ASCII values of T, R, I, C, and K and the prints them.

Annotated Code

<Space><Space><Space><Tab><Space><Tab><Space><Space><Tab><Space><LF> Push the ASCII value of R
<Space><Space><Space><Tab><Space><Tab><Space><Tab><Space><Space><LF> Push the ASCII value of T
<Tab><LF><Space><Space> Pop and print the T
<Tab><LF><Space><Space> Pop and print the R
<Space><Space><Space><Tab><Space><Space><Tab><Space><Space><Tab><LF> Push the ASCII value of I
<Tab><LF><Space><Space> Pop and print the I
<Space><Space><Space><Tab><Space><Space><Tab><Space><Tab><Tab><LF>   Push the ASCII value of K
<Space><Space><Space><Tab><Space><Space><Space><Space><Tab><Tab><LF> Push the ASCII value of C
<Tab><LF><Space><Space> Pop and print the C
<Tab><LF><Space><Space> Pop and print the K
<LF><LF><LF>            Terminate the program. The following line is not run.
<Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><Space><LF>

The interweaving of pushes and prints was chosen based solely on aesthetic reasons as it does not affect the byte count.


2sable / pl, 8 bytes

0000000: 74 72 65 61 74 93 d0 cb                          treat...

Both programs have been tested locally with the same 8 byte file, so this is a proper polyglot.

2sable: trick

This is the program in code page 1252.

treat“ÐË

Try it online!

pl: treat

This is the program in code page 437.

treatô╨╦

Try it online!

How it works

2sable: trick

t         Square root. Errors since there is no input. The exception is caught, the
          stack left unaltered, and the interpreter pretends nothing happened.
 r        Reverse stack.
          Reversed empty stack is still empty stack. ;(
  e       Compute nCr. Errors since there is no input.
   a      Alphanumeric test. Errors since there is no input.
    t     Square root. Errors since there is no input.
     “    Begin a lowercase string literal.
      Ð     Excluding ‘, ’, “, and ”, Ð is the 71st non-ASCII character in CP1252.
       Ë    Excluding ‘, ’, “, and ”, Ë is the 66th non-ASCII character in CP1252.
          (implicit) End string literal.
          Both characters together fetch the dictionary word at index
          71 * 100 + 66 = 7166, which is 'trick'.

pl: treat

treat     Bareword; push the string "treat" on the stack.
     ô    Unimplemented. Does nothing.
      ╨   Flatten the stack. This doesn't affect the output.
       ╦  Unimplemented. Does nothing.