{"action":"created","issue":{"url":"https://api.github.com/repos/oilshell/oil/issues/106","repository_url":"https://api.github.com/repos/oilshell/oil","labels_url":"https://api.github.com/repos/oilshell/oil/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/oilshell/oil/issues/106/comments","events_url":"https://api.github.com/repos/oilshell/oil/issues/106/events","html_url":"https://github.com/oilshell/oil/issues/106","id":323357844,"number":106,"title":"Is there a formal grammar for oil language?","user":{"login":"tailhook","id":321799,"avatar_url":"https://avatars3.githubusercontent.com/u/321799?v=4","gravatar_id":"","url":"https://api.github.com/users/tailhook","html_url":"https://github.com/tailhook","followers_url":"https://api.github.com/users/tailhook/followers","following_url":"https://api.github.com/users/tailhook/following{/other_user}","gists_url":"https://api.github.com/users/tailhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tailhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tailhook/subscriptions","organizations_url":"https://api.github.com/users/tailhook/orgs","repos_url":"https://api.github.com/users/tailhook/repos","events_url":"https://api.github.com/users/tailhook/events{/privacy}","received_events_url":"https://api.github.com/users/tailhook/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T19:47:43Z","updated_at":"2018-05-15T23:43:59Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI came across this project and I like it very much. Especially great idea is that you can convert bash-like syntax into a modern and clean oil language. But I'm curious if I can write another implementation of the oil language.\r\n\r\nThe question as is standing in the title: is there a grammar for oil language in text form or maybe in programmatic form? I see osh (which is a bash subset, right?) language parser in the `osh/` directory but not the oil language. I'm probably missing something.\r\n\r\n-----\r\n\r\nMy actual use case is following: I'm developing some containerization tools in rust and it would be very helpful to have a shell interpreter there. It must be in rust (as the tools) for two reasons: (1) for easier building and distribution, (2) to precisely control what script can and cannot do (i.e. I'm probably going to write a shell that runs privileged, but spawns processes in unprivileged containers)."},"comment":{"url":"https://api.github.com/repos/oilshell/oil/issues/comments/389348956","html_url":"https://github.com/oilshell/oil/issues/106#issuecomment-389348956","issue_url":"https://api.github.com/repos/oilshell/oil/issues/106","id":389348956,"user":{"login":"andychu","id":143248,"avatar_url":"https://avatars0.githubusercontent.com/u/143248?v=4","gravatar_id":"","url":"https://api.github.com/users/andychu","html_url":"https://github.com/andychu","followers_url":"https://api.github.com/users/andychu/followers","following_url":"https://api.github.com/users/andychu/following{/other_user}","gists_url":"https://api.github.com/users/andychu/gists{/gist_id}","starred_url":"https://api.github.com/users/andychu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andychu/subscriptions","organizations_url":"https://api.github.com/users/andychu/orgs","repos_url":"https://api.github.com/users/andychu/repos","events_url":"https://api.github.com/users/andychu/events{/privacy}","received_events_url":"https://api.github.com/users/andychu/received_events","type":"User","site_admin":false},"created_at":"2018-05-15T23:43:59Z","updated_at":"2018-05-15T23:43:59Z","author_association":"CONTRIBUTOR","body":"Right now, only the OSH-to-Oil translator exists.  So the language mostly exists in my head, but it seems to be feasible based on that experiment.  There's no parser for it.\r\n\r\nFor container tools, I think it would make more sense to implement OSH in Rust.  In fact I wanted to kick that off as a \"backup\" for OPy.  I prefer OPy, but it is a weird way of doing things, so in case that doesn't work, maybe someone wants to implement OSH first.\r\n\r\nI was going to start with the skeleton here, which is just algebraic data types that should translate easily to Rust:\r\n\r\nhttps://github.com/oilshell/oil/blob/master/osh/osh.asdl\r\n\r\nThe lexer is already generated C code, so that can be used by Rust directly, which should save a huge amount of time vs. starting from scratch.\r\n\r\nIt's important to implement OSH before Oil, because otherwise we wouldn't know if the translation can be done automatically.  You could end up in a situation where you have a clean new language but it's very difficult or impossible to auto-translate.\r\n\r\n"}}
{"actor":{"display_login":"andychu"}}