zigcc / zig-cookbook Goto Github PK
View Code? Open in Web Editor NEWSimple Zig programs that demonstrate good practices to accomplish common programming tasks.
Home Page: https://cookbook.ziglang.cc/
License: MIT License
Simple Zig programs that demonstrate good practices to accomplish common programming tasks.
Home Page: https://cookbook.ziglang.cc/
License: MIT License
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!
We want a mascot that embodies the spirit of the Zig programming language and our cookbook project. The mascot should be:
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.
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!
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!
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.
Shouldn't it do defer t1.join()
for threads to actually run concurrently?
Some examples I find:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.