fixed rule

amber (she/her)@lemmy.blahaj.zone to 196@lemmy.blahaj.zone – 627 points –
102

You are viewing a single comment

That's not Lisp...

(while (== x y)
  (func1)
  (func2)
)

(((((Not(enough)))((parentheses)))))

No syntax, only parentheses

Hear me out: brainfuck, but with parentheses only.

>    )))
<    (((
+    ())
-    (()
.    ()(
,    )()
[    )((
]    ))(

Hello world example:

()))(((()(())))(())(())))))()))))(()
(()(()(()(()(((((())(((((()(()((((()
(()(()))()))(()()()))))))))())()()))
)))()(()(())())()))((()()))))(((((((
((((((()(())())())()((()(()(()(()(()
(()()((((((((()()())))))))))))())()(

Ancient aliens meme with the caption "LIPS!!"

Python transpiler:

#!/usr/bin/env python
"""Lipsfuck to brainfuck transpiler"""

from sys import stdin

OPS = {")))": '>', "(((": '<',
       "())": '+', "(()": '-',
       "()(": '.', ")()": ',',
       ")((": '[', "))(": ']'}


def main():
    """Obvious main procedure"""
    _d = ''.join(stdin.readlines()).rstrip('\n')
    for _op in [_d[x:x+3] for x in
                range(0, int(len(_d)), 3)]:
        print(OPS[_op], end='')
    print()


if __name__ == "__main__":
    main()

What kind of monster writes lisp with the closing bracket on its own line.