{"action":"created","issue":{"url":"https://api.github.com/repos/mvdan/sh/issues/77","repository_url":"https://api.github.com/repos/mvdan/sh","labels_url":"https://api.github.com/repos/mvdan/sh/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/mvdan/sh/issues/77/comments","events_url":"https://api.github.com/repos/mvdan/sh/issues/77/events","html_url":"https://github.com/mvdan/sh/issues/77","id":220155414,"number":77,"title":"interp: new package to execute shell programs","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars3.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"labels":[{"id":312152031,"url":"https://api.github.com/repos/mvdan/sh/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-04-07T09:11:35Z","updated_at":"2017-04-09T17:36:54Z","closed_at":null,"body":"I've been thinking about adding a package to execute shell programs for a while. So far, `sh` includes a parser and a formatter, so it's the next logical step.\r\n\r\nThis is an issue to gauge how much interest there would be, and to get some feedback on my initial design.\r\n\r\nFirst implementation would only be POSIX, as Bash has too many features and it would drive me crazy as a start.\r\n\r\nAlso worth noting that the purpose of such a package would not be speed - after all, people don't write Bash for it to run fast and the Bash interpreter in C is probably fast already. Instead, the advantages would be:\r\n\r\n* Ability to execute shell code directly in Go\r\n* Remove dependency on the `sh` or `bash` executables to do so (and what versions are installed)\r\n* Similar to `exec.Command(\"cmd\", \"arg1\", \"arg2\")`, we could have `interp.Exec(\"foo && bar || failsafe\")`\r\n\r\nA huge point against such a package, which is why I haven't written it yet, is that it would have limited use cases. `Bash` and other shells have been battle-tested for decades. I don't see any reason why anyone would trust a reimplementation (even if it's in a memory-safe language) just for the sake of it.\r\n\r\nUnless any of the advantages above are useful. I think they outweigh the disadvantage in some cases, such as when you're running static shell code or when the shell code you're executing is not mission-critical."},"comment":{"url":"https://api.github.com/repos/mvdan/sh/issues/comments/292800156","html_url":"https://github.com/mvdan/sh/issues/77#issuecomment-292800156","issue_url":"https://api.github.com/repos/mvdan/sh/issues/77","id":292800156,"user":{"login":"D630","id":3672816,"avatar_url":"https://avatars0.githubusercontent.com/u/3672816?v=3","gravatar_id":"","url":"https://api.github.com/users/D630","html_url":"https://github.com/D630","followers_url":"https://api.github.com/users/D630/followers","following_url":"https://api.github.com/users/D630/following{/other_user}","gists_url":"https://api.github.com/users/D630/gists{/gist_id}","starred_url":"https://api.github.com/users/D630/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D630/subscriptions","organizations_url":"https://api.github.com/users/D630/orgs","repos_url":"https://api.github.com/users/D630/repos","events_url":"https://api.github.com/users/D630/events{/privacy}","received_events_url":"https://api.github.com/users/D630/received_events","type":"User","site_admin":false},"created_at":"2017-04-09T17:36:54Z","updated_at":"2017-04-09T17:36:54Z","body":"I would rather love a tool, that is able (1) to parse the dialects of mksh and zsh as well and (2) to offer configurable formats (I'm thinking of building own layouts/coding styles, but also of different output formats)."}}
{"actor":{"display_login":"D630"}}