News for hackers. Stuff that matters.
Re:Ask HN: What is the most beautiful piece of code you've e... by blotter_paper on Monday October 28, 2019 @12:09AM (#21374174)
Bash fork bomb (do not run, this will crash your system if it's not configured properly):

    :(){ :|:& };:
Re:Ask HN: What is the most beautiful piece of code you've e... by mongol on Monday October 28, 2019 @02:30AM (#21374733)
What is a proper configuration to avoid that?
Re:Ask HN: What is the most beautiful piece of code you've e... by moviuro on Monday October 28, 2019 @05:06AM (#21375337)
Re:Ask HN: What is the most beautiful piece of code you've e... by balp on Monday October 28, 2019 @01:51AM (#21374591)
That got my unix account suspended at university....
Re:Ask HN: What is the most beautiful piece of code you've e... by danesparza on Wednesday October 30, 2019 @12:39PM (#21399627)
:-) DOS'ing the system is frowned upon.
Re:Ask HN: What is the most beautiful piece of code you've e... by numlock86 on Monday October 28, 2019 @02:48AM (#21374796)
I like the Windows one, too. It looks a lot simpler as well.

  %0|%0
Re:Ask HN: What is the most beautiful piece of code you've e... by jolmg on Monday October 28, 2019 @12:35PM (#21378497)
I don't know Windows scripting, but that looks like something you'd have to put in a file and call for it to work, instead of just running that on the command line. You can do the same thing on Unix systems. Writing

  $0|$0
on a file and running it should also work as a fork bomb.
Re:Ask HN: What is the most beautiful piece of code you've e... by dfox on Monday October 28, 2019 @11:56AM (#21378069)
The conceptually same thing will also work on bourne shell. But as in the Windows case only as a script stored in file, the original with inline function definition is self-contained oneliner.
Re:Ask HN: What is the most beautiful piece of code you've e... by sam_lowry_ on Monday October 28, 2019 @05:45AM (#21375535)
...and it smiles at you with its multiple faces
Re:Ask HN: What is the most beautiful piece of code you've e... by blotter_paper on Monday October 28, 2019 @09:20PM (#21383481)
Faces I can interpret:

    :(   #sadface
    :()  #dopefish
    { :  #smiling one-toothed vampire
    { :| #blank stare with hat
    :|   #blank stare without hat
    |:   #other blank stare without hat
    |:&  #blank stare with bow
    };   #winking face with mustache
    };:  #winking four-eyed alien face with mustache
Only one of those was a smile, and you generally don't want a vampire smiling at you even if they're down a tooth! ;)