Zig: Proposal: option to allow syscalls at comptime

Created on 5 Jul 2020  路  3Comments  路  Source: ziglang/zig

There should be an option to explicitly allow certain packages to make syscalls at comptime

proposal

Most helpful comment

What would be the use cases for this?

All 3 comments

What would be the use cases for this?

What would be the use cases for this?

Mostly because it is nicer than doing it in the build.zig, putting it in a file and then embedding that file.
I understand it is probably for safety but i think it would be fine if we make it explicitly allowable.

Mostly because it is nicer than doing it in the build.zig, putting it in a file and then embedding that file.
I understand it is probably for safety but i think it would be fine if we make it explicitly allowable.

Far more than just safety:

  • it requires knowledge about host structures and layouts instead of target structures and layouts (in zig, cross compiling is a top priority)
  • it runs counter to zig's caching strategy (as interacting with the outside environment as syscalls do cannot be cached).
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jayschwa picture jayschwa  路  3Comments

daurnimator picture daurnimator  路  3Comments

zimmi picture zimmi  路  3Comments

andrewrk picture andrewrk  路  3Comments

komuw picture komuw  路  3Comments