Share your repls and programming experiences

← Back to all posts
4 languages that can kill themselves
DynamicSquid (5024)

4 files, each with a different language. Each file will call the next file, and then commit die. Like this:

kill itself

run main.rb
kill itself


Basically how this works is each file calls 2 shell commands, one to run the next file, and one to commit toaster bath. The bash command to commit skydiving without a parachute is rm FILE_NAME.

I also added brief comments on how the shell commands work in each language so you might learn something.

I'm just bored.

SixBeeps (5335)

This is unbelievably useless and I love it

SwaroopBappanad (240)

Looks like a being more powerful than Thanos, one that did the job right this time.

xxpertHacker (931)

@SwaroopBappanad What about the rest of the Repls?


@SwaroopBappanad Yeah he is right lol

DynamicSquid (5024)

@HiPeople844 it commits unalive, run the code, and all the files will self destruct

DynamicSquid (5024)

@HiPeople844 like SixBeeps said:

This is unbelievably useless and I love it


Are you available to help me with something? @DynamicSquid


Can you help me make a language? @DynamicSquid

DynamicSquid (5024)

@MohammedBalsara oh, sorry no. I'm really busy myself. I can point you to the right direction though


alr, tell me more. @DynamicSquid

DynamicSquid (5024)

@MohammedBalsara Okay, try to make a lexer first. A lexer takes in a string input, and turns that into a list of "tokens". A token is a class which has a type, and the actual token.

For example:

(you do python right?)

class Token:
  def __init__(self, type, value):
    self.type = type
    self.value = value

def lexer(code):
  # implement your lexer here
  # it should return a list of tokens

code = input()
tokens = lexer(code)

# make sure it works
for token in tokens:
  print('[' + token.value + ']', end=' ')

A token might look like this:

token = Token('value', '5')
token = Token('value', 'true')
token = Token('operator', '+')

Right now, you can start small and only focus on arithmetic operations. You want your code to take in input like:

3 * (21 + 4)

And print this:

[3] [*] [(] [21] [+] [4] [)]

alr thanks @DynamicSquid

SeamusDonahue (458)

so basically the file opens a new file then commits lego step..... truly the best use of technology what a genius

Pizzaz4me (57)

this made me learn C++ lol

HahaYes (1869)

@DynamicSquid yay congrats on 3100 cycles. Go beat coder for me thanks

ike_fite (12)

I've thought of doing this before. You just have to make sure you commit a snapshot before the program commits. @DynamicSquid

JohnsonAndrew (2)

This is the kind of useless nonsense we need more of!

archie426 (1)

very much a c way of doing things but ok

SwaroopBappanad (240)

Dynamic Squid: Creates repl that commits sudoku
Literally everyone: SMASHES UPVOTE

iocoder (164)

i fell like this could be a movie called "Self Destruct" where one thing causes itself and another things to explode etc...

iocoder (164)

btw this is incredible nonsense, it epic @DynamicSquid

FlaminHotValdez (715)

"commit die" "commit toaster bath" "commit skydiving without a parachute" "commit unalive" BWAHAHAHAHAHAHAHAHA

RayvelArjoon (88)

It's useless...
BUT IT'S TOO GOOD!!!!!!!!!

Pizzaz4me (57)

I can't stop running the program and reloading the page. Help!

PattanAhmed (1412)

You killed the built-in file given by


EpicGamer007 (1751)

@PattanAhmed , it is actually really simple, all you have to do is go to the console or shell and type in rm [insert file name here].

fuzzyastrocat (1867)

@PattanAhmed @DynamicSquid It's funny how repl's filesystem freaks out if the main file deletes itself and you then try to edit other files.

ImplodingBug (5)

It's pretty good, but it would be cool if you could use a way to delete the files that's not the terminal, maybe os.remove() for Python ( or the file.delete command in Ruby (,of%20names%20passed%20as%20arguments.) Just a suggestion for in the future though, because this does its function perfectly.

PXY (40)

Now I know what to say when I don't turn in CS assignments

DynamicSquid (5024)


"Why didn't you do your homework?"
"My code self-destructed"

PXY (40)

@DynamicSquid "Thanks for telling me! I'll be sure to mark your grade accordingly."

TheAverageAsian (3)

So dumb, yet so smart. life in a nutshell
I'm just glad no has created real life anime characters...

Bookie0 (6360)

wow, files disappear lol!
(mac users commit cmd-Q lol)

python88 (297)

i love this and the code is too complex for me to understand also what is your fav icecream flavor?

DynamicSquid (5024)

@python88 my favourite ice cream flavour is success

python88 (297)

@DynamicSquid vanila javascript with a litle bit of umm... idk

python88 (297)

@DynamicSquid also drop a gallon of python eyes

DynamicSquid (5024)

@python88 I call it "ink" from where I come from

python88 (297)

@DynamicSquid your the first squid to get 3000 cycles and the 5th place

firefish (953)

This is absurdly daft and wonderful, wish I thought of it first.... I know the story of a man who though killing a process could be done by delete it's source program. No. Also C++ is compiled to main (the elf binary) with clang so instead of rm main.cpp do rm main.cpp main. There is still that cheeky main file still there.

DynamicSquid (5024)

@firefish well only if you compile it yourself. the default project contains the main.cpp

firefish (953)

@DynamicSquid purposely hides the file called "main". do an ls -la in the bash shell

firefish (953)

@DynamicSquid REmember: c++ is not a script, it is a compile lang, so the binary has to go somewhere

DynamicSquid (5024)

@firefish yeah I know that, but I thought the main file was unaccessable

firefish (953)

@DynamicSquid It exists, just the file manager hides it from you

potatojs (847)

wait..wat?..why are..wt...this is...