{"action":"opened","issue":{"url":"https://api.github.com/repos/zig-lang/zig/issues/868","repository_url":"https://api.github.com/repos/zig-lang/zig","labels_url":"https://api.github.com/repos/zig-lang/zig/issues/868/labels{/name}","comments_url":"https://api.github.com/repos/zig-lang/zig/issues/868/comments","events_url":"https://api.github.com/repos/zig-lang/zig/issues/868/events","html_url":"https://github.com/zig-lang/zig/issues/868","id":309967611,"number":868,"title":"Add ability to determine if we are currently executing at compile time","user":{"login":"tiehuis","id":4605603,"avatar_url":"https://avatars0.githubusercontent.com/u/4605603?v=4","gravatar_id":"","url":"https://api.github.com/users/tiehuis","html_url":"https://github.com/tiehuis","followers_url":"https://api.github.com/users/tiehuis/followers","following_url":"https://api.github.com/users/tiehuis/following{/other_user}","gists_url":"https://api.github.com/users/tiehuis/gists{/gist_id}","starred_url":"https://api.github.com/users/tiehuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiehuis/subscriptions","organizations_url":"https://api.github.com/users/tiehuis/orgs","repos_url":"https://api.github.com/users/tiehuis/repos","events_url":"https://api.github.com/users/tiehuis/events{/privacy}","received_events_url":"https://api.github.com/users/tiehuis/received_events","type":"User","site_admin":false},"labels":[{"id":693800736,"url":"https://api.github.com/repos/zig-lang/zig/labels/proposal","name":"proposal","color":"aaefdc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-30T03:43:33Z","updated_at":"2018-03-30T03:43:33Z","closed_at":null,"author_association":"OWNER","body":"I'm sure this was mentioned somewhere but could not find an issue: The gist is as follows:\r\n\r\n```\r\nif (@areWeInComptime()) {\r\n   // use a slow fallback which we can compute in zig\r\n} else {\r\n   // use a fast runtime version that uses assembly (or features not supported at comptime)\r\n}\r\n```\r\n\r\nThis is present in D for example via the `__ctfe` variable. The current reason I need this is that I want to call `sqrt` at compile-time but on x86_64 this uses an assembly routine which can not be evaluated at compile-time."}}
{"actor":{"display_login":"tiehuis"}}