{"action":"created","issue":{"url":"https://api.github.com/repos/Araq/Nim/issues/2716","labels_url":"https://api.github.com/repos/Araq/Nim/issues/2716/labels{/name}","comments_url":"https://api.github.com/repos/Araq/Nim/issues/2716/comments","events_url":"https://api.github.com/repos/Araq/Nim/issues/2716/events","html_url":"https://github.com/Araq/Nim/issues/2716","id":76369861,"number":2716,"title":"The `func` keyword for \"pure\" functions","user":{"login":"ozra","id":563674,"avatar_url":"https://avatars.githubusercontent.com/u/563674?v=3","gravatar_id":"","url":"https://api.github.com/users/ozra","html_url":"https://github.com/ozra","followers_url":"https://api.github.com/users/ozra/followers","following_url":"https://api.github.com/users/ozra/following{/other_user}","gists_url":"https://api.github.com/users/ozra/gists{/gist_id}","starred_url":"https://api.github.com/users/ozra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozra/subscriptions","organizations_url":"https://api.github.com/users/ozra/orgs","repos_url":"https://api.github.com/users/ozra/repos","events_url":"https://api.github.com/users/ozra/events{/privacy}","received_events_url":"https://api.github.com/users/ozra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-14T14:08:25Z","updated_at":"2015-05-15T14:36:03Z","closed_at":null,"body":"As I'm investigating this interesting language, somewhere, on some page, I saw a mention that a `func` keyword as more convenient syntax for declaring a procedure 'purely functional' was considered.\r\nI couldn't find a issure refering to it, so I add it here, since I find it an essential feature.\r\n\r\nNim is ofcourse a systems language (which is what I'm after!), still purely functional coding is proven to be safer, so enabling and pushing for purer functionalistic coding style while still allowing everything would be a good thing.\r\n\r\nAlso, many backend (out of Nim perspective) compilers (C/C++) has pragmas and annotations for \"pure\" or \"const\" (\"really pure\") functions which can be leveraged and hints and helps the backend compiler generate even faster code. \r\n\r\nSo:\r\n- Already on the table for Nim (as far as I understand)\r\n- Expresses coders intent\r\n- Intent verifiable\r\n- Possibly increased performance in final binary.\r\n"},"comment":{"url":"https://api.github.com/repos/Araq/Nim/issues/comments/102415496","html_url":"https://github.com/Araq/Nim/issues/2716#issuecomment-102415496","issue_url":"https://api.github.com/repos/Araq/Nim/issues/2716","id":102415496,"user":{"login":"dom96","id":246651,"avatar_url":"https://avatars.githubusercontent.com/u/246651?v=3","gravatar_id":"","url":"https://api.github.com/users/dom96","html_url":"https://github.com/dom96","followers_url":"https://api.github.com/users/dom96/followers","following_url":"https://api.github.com/users/dom96/following{/other_user}","gists_url":"https://api.github.com/users/dom96/gists{/gist_id}","starred_url":"https://api.github.com/users/dom96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dom96/subscriptions","organizations_url":"https://api.github.com/users/dom96/orgs","repos_url":"https://api.github.com/users/dom96/repos","events_url":"https://api.github.com/users/dom96/events{/privacy}","received_events_url":"https://api.github.com/users/dom96/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T14:36:02Z","updated_at":"2015-05-15T14:36:02Z","body":"Araq mentioned that he was considering making the 'func' keyword something that could be library-defined. So by default it would mean noSideEffects but a library could potentially change that meaning."}}