Live data from Hacker News

Show HN: HyperLogLog in Zig

github.com

21–30 of 38 posts

Re: Show HN: HyperLogLog in Zig

#21

One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): pub fn HyperLogLog(comptime p: u8) type { return struct { dense: []u6, const Self = @This(); pub fn init(allocator: Allocator) !Self { return Self{ .dense = try allocator.alloc(u6, 0), }; } } } To this: pub fn HyperLogLog(comptime p: u8) type { return struct { dense: […

Why is Zigs syntax so … foreign to me? What’s the hype behind it?

Re: Show HN: HyperLogLog in Zig

#22

One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): pub fn HyperLogLog(comptime p: u8) type { return struct { dense: []u6, const Self = @This(); pub fn init(allocator: Allocator) !Self { return Self{ .dense = try allocator.alloc(u6, 0), }; } } } To this: pub fn HyperLogLog(comptime p: u8) type { return struct { dense: […

Why is Zigs syntax so … foreign to me? What’s the hype behind it?

Take a look at Rust and you'll see where a lot of it is coming from.

Re: Show HN: HyperLogLog in Zig

#24

Earlier quoted context omitted.

I'm also very curious to know this. HyperLogLog is written in Go: https://github.com/axiomhq/hyperloglog I would expect V to be a more natural choice for a port than Zig.

As a notice to others reading this user's comments, they are a recently made account that seems to exist mostly to post about V and post negatively about Zig. Extremely suspect given the history of poor behavior from the V project.

You made this account just to insinuate I'm a shill? Not cool.

I work professionally with Go and I follow news about V, yes. Also I'm interested in discussions involving Zig and V because even though there is an overlap of the design goals of the languages (e.g. zero-cost interoperability with C, high performance), there aren't many comparisons between them online.

My advice is listen to the criticism of Zig to improve the language instead of making throwaway accounts to accuse people.

Re: Show HN: HyperLogLog in Zig

#25
post #22

Earlier quoted context omitted.

Why is Zigs syntax so … foreign to me? What’s the hype behind it?

Take a look at Rust and you'll see where a lot of it is coming from.

Actually i found zig easier to read than rust… something that i found more appealing!

Re: Show HN: HyperLogLog in Zig

#26
post #22

Earlier quoted context omitted.

Why is Zigs syntax so … foreign to me? What’s the hype behind it?

Take a look at Rust and you'll see where a lot of it is coming from.

I used to hate Rusts syntax, but a YT channel in the name of ”No boilerplate” made me see the beauty in it.

Re: Show HN: HyperLogLog in Zig

#27

One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): pub fn HyperLogLog(comptime p: u8) type { return struct { dense: []u6, const Self = @This(); pub fn init(allocator: Allocator) !Self { return Self{ .dense = try allocator.alloc(u6, 0), }; } } } To this: pub fn HyperLogLog(comptime p: u8) type { return struct { dense: […

Why is Zigs syntax so … foreign to me? What’s the hype behind it?

You're looking at a piece of code that's doing a type of metaprogramming mostly unique to Zig. Additionally I'm using a for loop capture syntax that is not common in other languages (closest thing I can think of are Ruby blocks).

You're just looking at a piece of code that is understandable for a newcomer to not find familiar.

Re: Show HN: HyperLogLog in Zig

#28

Earlier quoted context omitted.

I'm also very curious to know this. HyperLogLog is written in Go: https://github.com/axiomhq/hyperloglog I would expect V to be a more natural choice for a port than Zig.

As a notice to others reading this user's comments, they are a recently made account that seems to exist mostly to post about V and post negatively about Zig. Extremely suspect given the history of poor behavior from the V project.

It's true that users here should avoid programming language flamewar drama (or any flamewar drama), but you shouldn't be attacking another user like this. Between that and the name of the account, I think we have to ban this one.

https://news.ycombinator.com/newsguidelines.html

Re: Show HN: HyperLogLog in Zig

#29

Earlier quoted context omitted.

As a notice to others reading this user's comments, they are a recently made account that seems to exist mostly to post about V and post negatively about Zig. Extremely suspect given the history of poor behavior from the V project.

You made this account just to insinuate I'm a shill? Not cool. I work professionally with Go and I follow news about V, yes. Also I'm interested in discussions involving Zig and V because even though there is an overlap of the design goals of the languages (e.g. zero-cost interoperability with C, high performance), there aren't many comparisons between them online. My advice is listen to the criticism of Zig to impro…

I agree that the criticism is unfair because you've posted about other things as well. However, it's true that you've posted in the programming language flamewar style in the past; we're trying to avoid that here, so please don't do that in the future.

https://news.ycombinator.com/newsguidelines.html

Re: Show HN: HyperLogLog in Zig

#30
post #29

Earlier quoted context omitted.

You made this account just to insinuate I'm a shill? Not cool. I work professionally with Go and I follow news about V, yes. Also I'm interested in discussions involving Zig and V because even though there is an overlap of the design goals of the languages (e.g. zero-cost interoperability with C, high performance), there aren't many comparisons between them online. My advice is listen to the criticism of Zig to impro…

I agree that the criticism is unfair because you've posted about other things as well. However, it's true that you've posted in the programming language flamewar style in the past; we're trying to avoid that here, so please don't do that in the future. https://news.ycombinator.com/newsguidelines.html

Thank you, Dan.

I meant to ask my question in the spirit of HN (intellectual curiosity). I have found this community insightful when it comes to programming languages. Examples:

Vale

https://news.ycombinator.com/item?id=31786487

Lobster

https://news.ycombinator.com/item?id=19567160

I think this question will also be raised eventually since there have been other examples of Zig ports of Go projects:

https://news.ycombinator.com/item?id=31993429#31994394

I'm looking forward to OP's update. I believe it will be objective and insightful (surprisingly Google returns 0 results of "vlang vs. zig").

Post reply on HN