Coder Social home page Coder Social logo

coffee_break's Introduction

Coffee break

crates.io badge docs.rs badge

Coffee break

Coffee break is a ๐Ÿ”ฅ blazing ๐Ÿš€ fast ๐Ÿฆ€ Rust ๐Ÿฅต library, by Rust developers for Rust developers. It is:

  • Developer-friendly: Lets you take a break while compiling your code.
  • Eco-friendly: The compiler is just taking a nap. We're not computing the Ackermann function just to slack off.
  • Language server-unfriendly: rust-analyzer is now also taking a nap.

Overview

XKCD compiling

A classic XKCD webcomic

45% of respondents to the 2023 Rust survey were concerned with Rust's compile times, and they're right: they're too dang fast!

In the before times when working on old C++ projects, we used to get 10 to 40 minutes of free time after we hit compile to do whatever we wanted. Developers' computers had no more than 2 to 4 CPU cores, and Makefiles were often not configured to run in parallel at all.

Nowadays, the devious Rust compiler developers are trying to make the compiler even faster, and they're slowly succeeding.

Here comes Coffee break, a friendly developer tool to make this problem go away.

Example

Before you run cargo build, reward yourself with a coffee break:

use coffee_break::coffee_break;

fn work_stuff() {
    let maybe = |(true|false)||(false|true)||(true|false)|true;
    let absolutely = maybe(true)(true)(true);

    // Take a break and hit compile
    coffee_break!(5 minutes);
}

You just got 5 minutes to stretch your legs, get a coffee, or make Friday afternoon a bit nicer.

You can take a break for up to 251 minutes, or up to 1319 seconds. These limits are arbitrary, and will not be changed for any reason, unless the author changes their mind.

This crate requires correct grammar:

fn work_stuff() {
    coffee_break!(1 second); // OK
    coffee_break!(5 minutes); // OK
    // coffee_break!(59 second); // Error
    // coffee_break!(1 minutes); // Error
}

Notes

The author doesn't drink coffee, but still enjoys taking a break.

Contributing

Before contributing to this project, consider taking a coffee break first.

PRs are welcome.

Please follow the community guidelines.

License

This project is licensed under a license modeled on the JSON license. Evil doesn't deserve a break.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Coffee break by you, shall be licensed with this repository's license, without any additional terms or conditions.

coffee_break's People

Contributors

joxcat avatar radekvit avatar bd103 avatar

Watchers

 avatar

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.