The interpreter executable for FALSE is 1020 bytes large. I think we can do better than THIS:
��Û������������������ˆ��È���ˆB0�ˇ*,x�r�pH@NÆ˝T,�g�Œ$F(FIÏa®.GÏu0C˙íp%NÆ˝ÿJÄg�™,@"$<��ÌNÆˇ‚JÄg�í*�"�$&<��a®NÆˇ÷,�"NÆˇ‹F�k�r‹Ç*BA˙¸C˙Ra�ºª∆j��Úp�@�0j�^@�[f(¸A˙�8¸+(¸`�ˇ¯&Ã`‘@�]f8¸Nu c êàTÄ1@ˇ˛`º@�aj�T@�!kÆ@�{fª∆j��ö�}fÙ`ö@�"fB(¸A˙�(¸`��� Lª∆j
�"g›`ÚRçB ���gB êàTÄ1@ˇ˛(¸"NÆ8¸¸L`�ˇT@�'fp�8¸+<(¿`�ˇ@@�`f
$Uå8¿`�ˇ0A˙�ˆ∞(�fVàr�8ÿQ…ˇ¸`�ˇ2g��p–¡`‡A˙TC˙^a��∫ ��gB\ êáÄ��� ‰à(¸��Ú G!@�!@�A˙¬"$<��ÓNÆˇ‚(�g��$"�$&ñáNÆˇ–"NÆˇ‹"N,x�NÆ˛bap�NuaÓ`"JNÆ˝Np
Nu@�:j�˛ûr�¬¸�
@�0“Ä�0k�:jp�`‰8¸+<(¡`�˛d@�{j�˛®@�aÂH8¸AÏ8¿8¸+`�˛H êà‚àSÄ8ÿQ»ˇ¸Nu�+ —ï�- ëï�* ¡Ì�*Ä�/ "É¿H¡*Å�. `%ld�A˙ˇ˙"$
NƸFXç�! ]Nê�: ] ù�; ]+�= ∞ïW¿HÄH¿*Ä�? ] gNê�$�+�%�Xç�\ *≠�+@��@ -�+m��+U�*Ä�_�Dï�& ¡ï�| Åï�~�Fï�> ∞ï[¿HÄH¿*Ä�#L›�HÁ�¿ o�NêJùg WNê`Pè�,"$NÆ˛»�^"NÆ˛Œ+��¯ Âà+5���fl"NÆ˛ò"NÆ˛òa.out���Û���������������������È����KÔ˜�IÔ¯�(à,x�C˙�p%NÆ˝ÿJÄfNu,@NÆˇƒ,�NÆˇ *�`dos.library�"N,x�NÆ˛bp�Nu����Ú
Challenge
Write a FALSE interpreter in any language (doesn't have to be an executable!). As usual, shortest bytes wins. Make sure to try to get it under 1020 though :)
Language Specs
Literals
123
put integer onto the stack'c
put character code onto the stack
Stack
$
DUP%
DROP\
SWAP@
ROTø
PICK (dup the nth stack item)
Arithmetic
+
ADD-
SUBTRACT*
MULTIPLY/
DIVIDE_
negate (negative numbers are entered123_
)&
bitwise AND|
bitwise OR~
bitwise NOT
Comparison (false is zero, true is all bits set (-1 or ~0) so that bitwise operators may be used)
>
greater than=
equals
Lambdas and flow control (tests are for non-zero)
[...]
define and put a lambda onto the stack!
execute lambda?
conditional execute:condition[true]?
.- An if-else can be expressed as:
condition$[\true\]?~[false]?
- An if-else can be expressed as:
#
while loop:[condition][body]#
Names
a-z
put a reference to one of the 26 available variables onto the stack:
store into a variable;
fetch from a variable
Input and Output
^
read a character (-1 for end-of-input),
write a character"string"
write a string (may contain embedded newlines).
write top of stack as a decimal integerß
flush buffered input/output
Other
{...}
commentwhitespace is ignored, may be needed to separate consecutive integers
Examples
Copy file:
{ copy.f: copy file. usage: copy < infile > outfile }
ß[^$1_=~][,]#
Factorial:
{ factorial program in false! }
[$1=~[$1-f;!*]?]f: { fac() in false }
"calculate the factorial of [1..8]: "
ß^ß'0-$$0>~\8>|$
"result: "
~[\f;!.]?
["illegal input!"]?"
"
Primes to 100:
{ writes all prime numbers between 0 and 100 }
99 9[1-$][\$@$@$@$@\/*=[1-$$[%\1-$@]?0=[\$.' ,\]?]?]#