ModularM
Modular2y ago
benny

Compile Time UUID

Dainemo does a good job accomplishing this
(https://github.com/StijnWoestenborghs/dainemo/blob/main/dainemo/utils/uuid.mojo)
But I wonder if there is a better way using instrinsics or system calls to get the time (Since time.now() doesnt work at compile time)
The goal being of course to be able to run the following code

alias UUID_ONE = generate_uuidv4()
alias UUID_TWO = generate_uuidv4()

fn main():
  print(UUID_ONE == UUID_TWO)

Where the output is
GitHub
A Machine Learning framework from scratch in Mojo 🔥 - StijnWoestenborghs/dainemo
dainemo/dainemo/utils/uuid.mojo at main · StijnWoestenborghs/dainemo
Was this page helpful?