Skip to content
← Back to Community
4 languages that can kill themselves
Profile icon
h
has Hacker Plan
DynamicSquid

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.

Voters
Profile icon
3847474
Profile icon
nathanmachane
Profile icon
SilvermoonCat
Profile icon
JWZ6
Profile icon
OldWizard209
Profile icon
LennyPhoenix
Profile icon
ch1ck3n
Profile icon
Squirrel777
Profile icon
ninja2k11
Profile icon
JasonLiu19
Comments
hotnewtop
Profile icon
SixBeeps

This is unbelievably useless and I love it

Profile icon
DynamicSquid

@SixBeeps thank you!!

Profile icon
techde

@SixBeeps My mom went to case western too!

Profile icon
techde

(It says in his bios)

Profile icon
SixBeeps

@techde nice

Profile icon
SwaroopBappanad

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

Profile icon
DynamicSquid
Profile icon
xxpertHacker

@SwaroopBappanad What about the rest of the Repls?

Profile icon
SwaroopBappanad

@xxpertHacker I meant the thing as a whole

Profile icon
[deleted]

@SwaroopBappanad Yeah he is right lol

Profile icon
ThatGhost

@xxpertHacker they committed ziplining without a harness duh

Profile icon
HiPeople844

Two thumbs up.

Profile icon
DynamicSquid

@HiPeople844 thank you!

Profile icon
HiPeople844

@DynamicSquid what does it do tho

Profile icon
DynamicSquid

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

Profile icon
HiPeople844
Profile icon
DynamicSquid

@HiPeople844 like SixBeeps said:

This is unbelievably useless and I love it

Profile icon
HiPeople844
Profile icon
[deleted]

Are you available to help me with something? @DynamicSquid

Profile icon
DynamicSquid

@MohammedBalsara sure what's up?

Profile icon
[deleted]

Can you help me make a language? @DynamicSquid

Profile icon
DynamicSquid

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

Profile icon
[deleted]

alr, tell me more. @DynamicSquid

Profile icon
DynamicSquid

@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] [)]
Profile icon
[deleted]

alr thanks @DynamicSquid

Profile icon
SeamusDonahue

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

Profile icon
DynamicSquid

@SeamusDonahue thank you!!

Profile icon
RahulChoubey1

@SeamusDonahue Lego step! How did I forget‽

Profile icon
Pizzaz4me

this made me learn C++ lol

Profile icon
HahaYes

This is insanity

Profile icon
DynamicSquid
Profile icon
HahaYes

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

Profile icon
OldWizard209
Profile icon
DynamicSquid
Profile icon
OldWizard209

=D I suck at making memes @DynamicSquid

Profile icon
ike_fite

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

Profile icon
DynamicSquid

@ike_fite :)

Profile icon
Andrew-Johnson

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

Profile icon
DynamicSquid
Profile icon
LAMAQDAHODWALA
Profile icon
DynamicSquid

@LAMAQDAHODWALA lol! nice one :)

Profile icon
archie426

very much a c way of doing things but ok

Profile icon
zplusfour

lol!

Profile icon
SwaroopBappanad

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

Profile icon
DynamicSquid
Profile icon
SwaroopBappanad

@DynamicSquid all jokes aside, its a pretty good project

Profile icon
DynamicSquid

@SwaroopBappanad oh thank you!!

Profile icon
glitchish

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

Profile icon
DynamicSquid

@ridark lol!

Profile icon
glitchish

btw this is incredible nonsense, it epic @DynamicSquid

Profile icon
FlaminHotValdez

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

Profile icon
DynamicSquid
Profile icon
RahulChoubey1

@DynamicSquid We need more!

Profile icon
FlaminHotValdez

@RahulChoubey1 Yes! We need more! @DynamicSquid

Profile icon
KimiTian08

@maxyang MOAR COMMITZ

Profile icon
RayvelArjoon

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

Profile icon
DynamicSquid

@RayvelArjoon lol thanks!!

Profile icon
Pizzaz4me

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

Profile icon
DynamicSquid
Profile icon
MkDeon

its makes me feel exciting

Profile icon
DynamicSquid

@MkDeon lol!

Profile icon
PattanAhmed

What?
You killed the built-in file given by Repl.it?

WOW!!!

Profile icon
DynamicSquid

@PattanAhmed lol it's not that hard

Profile icon
EpicGamer007

@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].

Profile icon
PattanAhmed

@DynamicSquid I know!
But...

Profile icon
PattanAhmed

@AbhayBhat Yes
Thanks for your answer!

Profile icon
fuzzyastrocat

@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.

Profile icon
PattanAhmed

@fuzzyastrocat LoL!
Good point!

Profile icon
ImplodingBug

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 (https://docs.python.org/3/library/os.html) or the file.delete command in Ruby (https://arjunphp.com/delete-file-ruby#:~:text=Removing%20single%20file%20in%20Ruby,of%20names%20passed%20as%20arguments.) Just a suggestion for in the future though, because this does its function perfectly.

Profile icon
PXY

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

Profile icon
DynamicSquid

@PXY lol yeah!

Profile icon
DynamicSquid

@PXY

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

Profile icon
PXY

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

Profile icon
TheAverageAsian

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

Profile icon
Bookie0

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

Profile icon
python88

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

Profile icon
DynamicSquid

@python88 my favourite ice cream flavour is success

Profile icon
python88
Profile icon
DynamicSquid

@python88 what's yours?

Profile icon
python88

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

Profile icon
DynamicSquid

@python88 with a bit of nodejs?

Profile icon
python88
Profile icon
python88

@DynamicSquid also drop a gallon of python eyes

Profile icon
DynamicSquid
Profile icon
python88

@DynamicSquid and some ruby diamonds

Profile icon
python88

@DynamicSquid with C - weed

Profile icon
DynamicSquid

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

Profile icon
python88
Profile icon
python88

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

Profile icon
DynamicSquid
Profile icon
python88

@DynamicSquid do you like coffie-script

Profile icon
DynamicSquid

@python88 I hate all flavours of js

Profile icon
DynamicSquid

@python88 oh sorry, I mistyped

Profile icon
python88

@DynamicSquid well bye mr or ms squuid

Profile icon
firefish

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.

Profile icon
DynamicSquid

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

Profile icon
firefish

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

Profile icon
DynamicSquid

@firefish oh, I didn't know that

Profile icon
firefish

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

Profile icon
DynamicSquid

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

Profile icon
firefish

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

Profile icon
python88

awesome

Profile icon
DynamicSquid

@python88 Thank you!!

Profile icon
AphixDev

HAHA

Profile icon
DynamicSquid
Profile icon
CodingGoose

lmao this is hilarious

Profile icon
DynamicSquid

@DannyIsCoding lol yeah!

Profile icon
potatojs

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

Profile icon
DynamicSquid