this post was submitted on 10 Feb 2024
625 points (100.0% liked)

196

16423 readers
1 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] JackLSauce@lemmy.world 18 points 9 months ago (2 children)

That's not Lisp...

(while (== x y)
  (func1)
  (func2)
)
[–] kryptonianCodeMonkey@lemmy.world 16 points 9 months ago (1 children)

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

[–] superb@lemmy.blahaj.zone 7 points 9 months ago (1 children)
[–] 7heo@lemmy.ml 1 points 9 months ago* (last edited 9 months ago)

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()
[–] flamingos@ukfli.uk 8 points 9 months ago

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