niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
508 stars 79 forks source link

Add zig #70

Closed mattn closed 2 years ago

Moelf commented 2 years ago

ReleaseFast

is this fast math?

niklas-heer commented 2 years ago

I think this image is using alpine as a base image.

https://github.com/ziglang/docker-zig/blob/2754d881ea3a61082d1e7bd30f8f667eb3c5584a/Dockerfile#L11-L16

niklas-heer commented 2 years ago

There is a zig package on alpine:edge

niklas-heer commented 2 years ago

Okay I'm checking out the code, let's see why it doesn't seem to know the package.

niklas-heer commented 2 years ago
+zig | --> RUN --no-cache zig build-exe -OReleaseFast leibniz.zig
                +zig | ./leibniz.zig:8:88: error: integer value 2 cannot be coerced to type 'std.fmt.ParseIntError!i64'
                +zig |     var rounds = try std.fmt.parseInt(i64, std.mem.trim(u8, buffer[0..n], "\n"), 10) + 2;

There was also a problem with the code. I fixed that.

niklas-heer commented 2 years ago

@mattn thank you for your contribution! 👍