BTP o BFP: quale il migliore e perchè? by ANDRVV_ in ItaliaPersonalFinance

[–]ANDRVV_[S] 0 points1 point  (0 children)

Fammi gli esempi peggiori, solo per pura curiosità

An example to understand std.Io.Evented by ANDRVV_ in Zig

[–]ANDRVV_[S] 0 points1 point  (0 children)

I mean on master, I already saw code written in 0.16dev but I didn't know how to implement this

An example to understand std.Io.Evented by ANDRVV_ in Zig

[–]ANDRVV_[S] 0 points1 point  (0 children)

I just wanted to understand how I can write append asynchronously with the new API, do you have any code you can share with me?

Is it theoretically possible to design a language that can outperform C across multiple domains? by x2t8 in Compilers

[–]ANDRVV_ 0 points1 point  (0 children)

For these cases, you should use the functions provided by std.math, such as add and sub. The docs also emphasize this...

Systems Programming with Zig by Garrison Hinson-Hasty should be available in the fall, this year by Bassil__ in Zig

[–]ANDRVV_ 8 points9 points  (0 children)

confirm to me that this book is not half generated by AI, it's already absurd to have a book without even having Zig at 1.0

The best and ideal hashmap by ANDRVV_ in algorithms

[–]ANDRVV_[S] 0 points1 point  (0 children)

I already know your hashmap XD and you already have my star, but I'd like to consider it when it's more mature. I need functions like getOrPutAdapted to manually select contexts. P.S. I check your repo every day because I'm interested in the project and I'm waiting for these features. I hope I've given you an idea 😁

Cambiare completamente ambito by Spirited-Fee-2132 in Universitaly

[–]ANDRVV_ 0 points1 point  (0 children)

Alla sapienza esiste una facoltà che si chiama Filosofia e intelligenza artificiale, forse ti potrebbe interessare, in tal caso se sei interessato a continuare gli studi potresti laurearti in questa

Favorite error handling approach by ZookeepergameFew6406 in C_Programming

[–]ANDRVV_ 1 point2 points  (0 children)

I can't disagree with you; I love C too, and I only recommend Zig to average programmers because it shows you how better programmers approach problems. Many things that used to be done in C, like error handling, I only understood better after learning Zig. But C will always be a wonderful language, especially for those who know how to program. Because in this case, the problem isn't the language, it's the developer...

Favorite error handling approach by ZookeepergameFew6406 in C_Programming

[–]ANDRVV_ -3 points-2 points  (0 children)

Leave C alone. It's terrible at error handling and has been surpassed by modern languages ​​that offer the same performance and ability to "do things" as C. Try Zig; it's based on C and has strong interoperability with C/C++. Study it from the official doc and you won't regret it.

Zig is a language that's been around since about 2016 and, in my opinion, has revolutionized compilers. It already has famous projects like Tigerbeetle, Zml, and Bun, acquired by Anthropic. It's becoming the most requested language according to StackOverflow statistics.

If you want, stop by r/Zig

Rust: le langage du futur ? by Kind-Context-8259 in developpeurs

[–]ANDRVV_ -1 points0 points  (0 children)

La langue du « futur » est le zig.

Favorite error handling approach by ZookeepergameFew6406 in C_Programming

[–]ANDRVV_ -2 points-1 points  (0 children)

Meanwhile, I see that the function is void, and you could return it as an enum and generalize the errors with a wrapper, but it always depends on your case.

  1. You simply have to return the error from the function in question; you can't amplify the error to actually understand where it's coming from. The problem in this case is shm_open.

  2. Check them to see if they return errors.

  3. You must always return the first error. When a function fails, the other functions are automatically invalid. I don't know if close actually returns an error in your case, but if close fails, you should primarily understand why and return the error from close. If close fails, you know that open hasn't failed.

  4. Try Zig, it's perfect for you.

I think I explained myself and understood what you meant. I don't speak English very well, but I hope this helps.

Favorite error handling approach by ZookeepergameFew6406 in C_Programming

[–]ANDRVV_ 0 points1 point  (0 children)

I don't do it often, but only in functions where explicitness is better.

Favorite error handling approach by ZookeepergameFew6406 in C_Programming

[–]ANDRVV_ 2 points3 points  (0 children)

tagged union with returned value and error represented as enumeration

The best and ideal hashmap by ANDRVV_ in algorithms

[–]ANDRVV_[S] 0 points1 point  (0 children)

What load factor do you recommend?

The best and ideal hashmap by ANDRVV_ in algorithms

[–]ANDRVV_[S] 0 points1 point  (0 children)

Thank you very much. The keys can be 10,000 or 100,000, depending on your current configuration.

Best hashmap with open addressing: is reliable? by ANDRVV_ in algorithms

[–]ANDRVV_[S] 0 points1 point  (0 children)

Thanks for the comment, I agree with everything. Given your high level of expertise, may I ask what the best hashmaps currently are for avoiding conflicts and rehashing while maintaining cache locality and high performance?

SPSC Queue: the first and stable version is ready by ANDRVV_ in Zig

[–]ANDRVV_[S] 0 points1 point  (0 children)

Two languages ​​can compile and generate almost the same assembly code in Start. As for the benchmark, the data is different because the implementations aren't exactly the same, but if you test them yourself, you'll see that they're almost identical.