Giter Site home page Giter Site logo

zigcc / zig-cookbook Goto Github PK

View Code? Open in Web Editor NEW
515.0 9.0 24.0 137 KB

Simple Zig programs that demonstrate good practices to accomplish common programming tasks.

Home Page: https://cookbook.ziglang.cc/

License: MIT License

Makefile 1.26% Zig 92.20% JavaScript 5.15% C 1.13% CSS 0.26%
zig ziglang

zig-cookbook's People

Contributors

bortzmeyer avatar byte911 avatar chenrui333 avatar dg0230 avatar drgermanius avatar efjimm avatar eltociear avatar fwx5618177 avatar hanaasagi avatar jiacai2050 avatar jinzhongjia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zig-cookbook's Issues

Design a Mascot for Zig Cookbook!

Hello Zig Community!

We're excited to announce an opportunity for creative minds to contribute to the Zig Cookbook project. The Zig Cookbook is a collection of simple Zig programs that demonstrate good practices for common programming tasks. To make our project more engaging and recognizable, we're looking to introduce a mascot, and we need your help!

What We're Looking For

We want a mascot that embodies the spirit of the Zig programming language and our cookbook project. The mascot should be:

  • Creative: Reflects the innovative and practical nature of Zig.
  • Friendly: Appeals to both new learners and experienced programmers.
  • Relevant: Resonates with the theme of programming and our focus on good practices.

How to Contribute

  • Design Submission: Submit your mascot designs as image files. If you have multiple ideas, feel free to submit more than one!
  • Description: Along with your design, include a brief description of your mascot, explaining how it represents the Zig Cookbook project.
  • Format: Please submit your files in a common image format (e.g., PNG, JPEG).

Submission Guidelines

  • Post your submissions as comments on this issue.
  • Ensure your designs are original and adhere to the community guidelines.
  • Deadline for submissions: Feb 10.

Selection Process

After the submission deadline, the zigcc team will review all entries and select the mascot that best represents our project. We might also conduct a community poll to involve everyone in the decision-making process.

Recognition

The creator of the chosen mascot will be credited in our project README and will have the satisfaction of seeing their design represent the Zig Cookbook across various platforms!

Questions?

If you have any questions or need more information, please comment below or reach out to the project maintainers @jiacai2050 or me @chenrui333.

We're looking forward to seeing your creative designs. Let's make the Zig Cookbook not only a valuable resource for programmers but also a project with a fun and engaging identity!

Thank you for your participation and support!

3.1 elapsed time: use a Timer ?

Since we have a Timer in the std lib, this might be more ergonomic:

var timer = try std.time.Timer.start();
expensive_function();
const elapsed_ns: f64 = @floatFromInt(timer.read());

print("Time elapsed in expensive_function() is: {d:.3}ms", .{
    elapsed_ns / time.ns_per_ms,
});

...although I think it's a good idea in principle to also introduce Instant in this context.

Make SHA256 example not read whole file into memory

Quick suggestion for the SHA256 example: instead of reading the whole file into memory, read it by blocks (of the page size bytes, for example) and use the incremental functions to compute the hash: init once, update for each block, and final to get the hash.

If you look at the standard library's source code, this is how hash is actually implemented -- it only calls update once because it has a single, complete block to hash.

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.