{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/348","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/348/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/348/events","html_url":"https://github.com/ponylang/ponyc/issues/348","id":115495000,"number":348,"title":"RFC compliant URI parser/builder","user":{"login":"jonas-l","id":392238,"avatar_url":"https://avatars.githubusercontent.com/u/392238?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas-l","html_url":"https://github.com/jonas-l","followers_url":"https://api.github.com/users/jonas-l/followers","following_url":"https://api.github.com/users/jonas-l/following{/other_user}","gists_url":"https://api.github.com/users/jonas-l/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas-l/subscriptions","organizations_url":"https://api.github.com/users/jonas-l/orgs","repos_url":"https://api.github.com/users/jonas-l/repos","events_url":"https://api.github.com/users/jonas-l/events{/privacy}","received_events_url":"https://api.github.com/users/jonas-l/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ponylang/ponyc/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ponylang/ponyc/labels/medium","name":"medium","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-06T12:20:13Z","updated_at":"2016-02-11T13:20:23Z","closed_at":"2016-02-11T01:31:51Z","body":"I've started working on [rfc3986](https://tools.ietf.org/html/rfc3986) compliant URI parser/builder.\r\n\r\nWhile [URL](https://github.com/CausalityLtd/ponyc/blob/master/packages/net/http/url.pony) is usable for now, I think it would be great to have standards compliant implementation with rfc matching terminology, etc."},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/182859752","html_url":"https://github.com/ponylang/ponyc/issues/348#issuecomment-182859752","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/348","id":182859752,"user":{"login":"jonas-l","id":392238,"avatar_url":"https://avatars.githubusercontent.com/u/392238?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas-l","html_url":"https://github.com/jonas-l","followers_url":"https://api.github.com/users/jonas-l/followers","following_url":"https://api.github.com/users/jonas-l/following{/other_user}","gists_url":"https://api.github.com/users/jonas-l/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas-l/subscriptions","organizations_url":"https://api.github.com/users/jonas-l/orgs","repos_url":"https://api.github.com/users/jonas-l/repos","events_url":"https://api.github.com/users/jonas-l/events{/privacy}","received_events_url":"https://api.github.com/users/jonas-l/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T13:20:23Z","updated_at":"2016-02-11T13:20:23Z","body":"I've been working on RFC compliant URI implementation ([see the commit for a progress][1]) because:\r\n\r\n* [Web architecture uses identifiers][2] (URI) which in addition to URL includes URN as well.\r\n\r\n* Current URL implementation does not differentiate between non-existing and empty elements (password, host, path, fragment).\r\n  e.g. `file:///etc/fstab` is equal to `file:/etc/fstab` although they shouldn't be.\r\n\r\n* Code closely resembling specification is much easier to maintain.\r\n  e.g. [URI's path defines pchar][3] as\r\n  ```\r\npchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\r\n```\r\n  which in my case corresponds to the code\r\n  ``` pony\r\n  fun _pchar_at(start: USize): Bool? =>\r\n    match _at(start)\r\n    | let c: U8 if _unreserved(c) or _sub_delim(c) | ':' | '@' => true\r\n    else\r\n      _pct_encoded_at(start)\r\n    end\r\n  ```\r\n* [_URI_ is not the same as _URI reference_][4] (_URI reference_ is a superset). Having distinct types for each would make better API and provide compile time checks.\r\n\r\n* URI has to be validated. This has been mostly resolved with the fix for #454.\r\n\r\nIf you think it's no longer relevant -- that's all right. Better to learn this sooner than later :)\r\n\r\n[1]: https://github.com/jonas-l/ponyc/commit/b7178368ce6a892c23160df0fe3a5cdfbefa5017\r\n[2]: https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2_1_1\r\n[3]: https://tools.ietf.org/html/rfc3986#section-3.3\r\n[4]: https://tools.ietf.org/html/rfc3986#section-4.1"}}