3 ms·
>“Google users in America have searched for Python more often than for Kim Kardashian.” I wonder how Kim Kardashian programming language looks like. I guess lo
by DeathArrow 4y ago
>“Google users in America have searched for Python more often than for Kim Kardashian.”
I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D
- a2800276 4y agoIt wouldn't waste time garbage collecting to focus on trash talking instead.
- rjmill 4y agoIntroducing "Trashtalk" a Smalltalk dialect without GC! This language isn't here to make friends.
- spokeonawheel 4y agodo people actually talk about the kardashians still? I thought that was like 3 years ago
- sigmoid10 4y agoThe article states that this was around 2017-2018.
- pungentcomment 4y agoIt's all garbage collector.
- toss1 4y agoSeems like more like a scaled-up garbage producer than garbage collector...
- behnamoh 4y agoKardashians are famous for... being famous.
- Retric 4y agoThat and wealth. There’s plenty of billionaires living privately, but many people find rich people who spend extravagantly interesting.
- lr1970 4y ago> I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D And exposed naked primitives ... :-)
- localhost 4y agoSince I have the world's greatest creative assistant handy, here's what GPT-4 thinks a Kim Kardashian language would look like: Hey dolls, let me introduce you to the Kimmie programming language, it's like totally fab and easy to use! To declare a variable, just use the hashtag symbol and the variable name, like this: #my_var To assign a value to the variable, use the word "like" followed by the value, like this: #my_var like 10 To print out a message, use the word "OMG" followed by the message in double quotes, like this: OMG "Hello, dolls!" To add two variables together, use the word "add" followed by the two variables, like this: #var1 like 5 #var2 like 7 #sum like add #var1 #var2
- alfor 4y agoHere is the TrashTalk interpreter: import re def trashtalk_interpreter(code): variables = {} code_lines = code.split("\n") for line in code_lines: if line.startswith("#"): var_name, _, value = line.partition(" like ") if "add " in value: _, var1, var2 = value.partition("add ") var1 = var1.strip() var2 = var2.strip() variables[var_name.strip()] = variables[var1] + variables[var2] else: variables[var_name.strip()] = int(value) elif line.startswith("OMG"): message = re.findall(r'"(.*?)"', line) if message: print(message[0].format(**variables)) # Sample code code = ''' #my_var like 10 OMG "Value of my_var: {my_var}" #var1 like 5 #var2 like 7 #sum like add #var1 #var2 OMG "Sum of {var1} and {var2} is {sum}" ''' trashtalk_interpreter(code)
- bqmjjx0kac 4y agoIs this an original joke/impression by GPT-4? Either way, this is hilarious.
- localhost 4y agoI copied the response verbatim. I also did a follow-up where it wrote the interpreter as well: class KimmieInterpreter: def __init__(self): self.variables = {} def interpret(self, code): for line in code.split("\n"): tokens = line.split() if len(tokens) == 0: continue if tokens[0] == "#": self.variables[tokens[1]] = None elif tokens[0] == "#my_var": self.variables[tokens[1]] = int(tokens[3]) elif tokens[0] == "OMG": print(tokens[1][1:-1]) elif tokens[0] == "add": var1 = self.variables[tokens[2]] var2 = self.variables[tokens[3]] result = var1 + var2 self.variables[tokens[1]] = result