{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/hcl/issues/45","labels_url":"https://api.github.com/repos/hashicorp/hcl/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/hcl/issues/45/comments","events_url":"https://api.github.com/repos/hashicorp/hcl/issues/45/events","html_url":"https://github.com/hashicorp/hcl/pull/45","id":115772803,"number":45,"title":"New HCL and JSON parser in pure Go, printer support","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-09T00:34:33Z","updated_at":"2015-11-09T06:19:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/hcl/pulls/45","html_url":"https://github.com/hashicorp/hcl/pull/45","diff_url":"https://github.com/hashicorp/hcl/pull/45.diff","patch_url":"https://github.com/hashicorp/hcl/pull/45.patch"},"body":"**This is an API backwards incompatible change.** - We've actually never done this with any of our libraries, but given HCL is a fairly HashiCorp-specific library, we're going to do this. Plus, the AST is vastly superior to what we had before, and this is an important change going forward. Sorry, downstreams. Really, really sorry.\r\n\r\n<hr>\r\n\r\nThis brings in @fatih's awesome work rewriting the HCL parser into pure Go in the style of the Go parser package (`go` in the stdlib). This also adds `hcl/printer` which lets us _output_ HCL! \r\n\r\nI built on top of @fatih's work to make the decoding work with the new AST as well as rewrite the JSON parser into pure Go as well in the same style, so there aren't two differing styles within the repository. The JSON parser still decodes _directly_ into the HCL AST.\r\n\r\nThis also vastly improves the HCL AST generated by the JSON parser. In every case we have (all our projects), we no longer need to special case certain AST weirdness caused by JSON. Everything _just works_ with the HCL/JSON interoperability. This is a huge win, and thanks a lot to the AST generated by @fatih's work."},"comment":{"url":"https://api.github.com/repos/hashicorp/hcl/issues/comments/154956323","html_url":"https://github.com/hashicorp/hcl/pull/45#issuecomment-154956323","issue_url":"https://api.github.com/repos/hashicorp/hcl/issues/45","id":154956323,"user":{"login":"virtuald","id":567900,"avatar_url":"https://avatars.githubusercontent.com/u/567900?v=3","gravatar_id":"","url":"https://api.github.com/users/virtuald","html_url":"https://github.com/virtuald","followers_url":"https://api.github.com/users/virtuald/followers","following_url":"https://api.github.com/users/virtuald/following{/other_user}","gists_url":"https://api.github.com/users/virtuald/gists{/gist_id}","starred_url":"https://api.github.com/users/virtuald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virtuald/subscriptions","organizations_url":"https://api.github.com/users/virtuald/orgs","repos_url":"https://api.github.com/users/virtuald/repos","events_url":"https://api.github.com/users/virtuald/events{/privacy}","received_events_url":"https://api.github.com/users/virtuald/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T06:19:14Z","updated_at":"2015-11-09T06:19:14Z","body":"It seems like those types of ambiguities should be in the README file.\r\n\r\nAs the maintainer of the python implementation of HCL, I suppose that's directly in conflict from what I want from hcl then -- namely, I like to think about HCL as a replacement (ish) for JSON that isn't YAML that has really convenient constructs for creating nested structures and supports comments. \r\n\r\nThis of course is important for me because I just take HCL and turn it into a python dictionary -- which is basically JSON already. Having an unambiguous (canonical?) way to translate HCL -> JSON in a one-to-one way would be convenient for that use case."}}