4 languages that can kill themselves
h
DynamicSquid (3232)

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

**main.cpp**
run main.py
kill itself

**main.py**
run main.rb
kill itself

etc.

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.

You are viewing a single comment. View All
firefish (418)

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 (3232)

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

firefish (418)

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

firefish (418)

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

DynamicSquid (3232)

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

firefish (418)

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