logoalt Hacker News

chaz72today at 3:24 PM3 repliesview on HN

And they believe Zig comptime wouldn’t do that? For the same inputs? I’d love an example.


Replies

vlovich123today at 4:04 PM

Traditional stuff in this space are:

* floating point differences between the build machine and the target. By far the most common

* endiannes - code assumes little median runs on big endian

There’s other more subtle issues that can crop up but those are the big two.

Not saying I agree though - those can happen anyway when you run on two different machines anyway.

show 2 replies
weinzierltoday at 4:00 PM

sin(x) can produce different results at comptime and runtime. In Rust there is no sin(x) at comptime for precisely this reason.

show 1 reply