{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/1859","repository_url":"https://api.github.com/repos/ocaml/ocaml","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/1859/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/1859/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/1859/events","html_url":"https://github.com/ocaml/ocaml/pull/1859","id":335196472,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2OTYwMzQ2","number":1859,"title":"Remove unsafe strings","user":{"login":"kit-ty-kate","id":2611789,"node_id":"MDQ6VXNlcjI2MTE3ODk=","avatar_url":"https://avatars2.githubusercontent.com/u/2611789?v=4","gravatar_id":"","url":"https://api.github.com/users/kit-ty-kate","html_url":"https://github.com/kit-ty-kate","followers_url":"https://api.github.com/users/kit-ty-kate/followers","following_url":"https://api.github.com/users/kit-ty-kate/following{/other_user}","gists_url":"https://api.github.com/users/kit-ty-kate/gists{/gist_id}","starred_url":"https://api.github.com/users/kit-ty-kate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kit-ty-kate/subscriptions","organizations_url":"https://api.github.com/users/kit-ty-kate/orgs","repos_url":"https://api.github.com/users/kit-ty-kate/repos","events_url":"https://api.github.com/users/kit-ty-kate/events{/privacy}","received_events_url":"https://api.github.com/users/kit-ty-kate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-06-24T17:23:33Z","updated_at":"2018-06-29T12:22:27Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/1859","html_url":"https://github.com/ocaml/ocaml/pull/1859","diff_url":"https://github.com/ocaml/ocaml/pull/1859.diff","patch_url":"https://github.com/ocaml/ocaml/pull/1859.patch"},"body":"This PR forces safe strings globally, effectively ending the possibility for projects or modules to use unsafe strings (previously enabled by `-unsafe-string` or setting `OCAMLPARAM=safe-string=0,_`).\r\n\r\nRationales are:\r\n* Safe strings have been available since 4.02 (4 years ago)\r\n* Safe strings have been the default since 4.06 (7 months ago, see #1252)\r\n* Very few opam packages still use unsafe strings: I'm only aware of `haxe.3.4.7` and `camlpdf.2.2.1`, maybe some others still use it under the table but very few of them remain.\r\n* Deleting code is always good, it simplifies maintenance.\r\n\r\nI think it would be good to have it in 4.08 but if not, at least this PR will remain open to be merged for a later release."},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/401338059","html_url":"https://github.com/ocaml/ocaml/pull/1859#issuecomment-401338059","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/1859","id":401338059,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTMzODA1OQ==","user":{"login":"skaller","id":431744,"node_id":"MDQ6VXNlcjQzMTc0NA==","avatar_url":"https://avatars2.githubusercontent.com/u/431744?v=4","gravatar_id":"","url":"https://api.github.com/users/skaller","html_url":"https://github.com/skaller","followers_url":"https://api.github.com/users/skaller/followers","following_url":"https://api.github.com/users/skaller/following{/other_user}","gists_url":"https://api.github.com/users/skaller/gists{/gist_id}","starred_url":"https://api.github.com/users/skaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaller/subscriptions","organizations_url":"https://api.github.com/users/skaller/orgs","repos_url":"https://api.github.com/users/skaller/repos","events_url":"https://api.github.com/users/skaller/events{/privacy}","received_events_url":"https://api.github.com/users/skaller/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T12:22:27Z","updated_at":"2018-06-29T12:22:27Z","author_association":"NONE","body":"Hi @gasche, yes I understand OPAM is popular and serves well as a monitoring tool, and is a pretty good package manager for unix like systems. A bit of a pity its not written in Ocaml using Ocaml's platform independent facilities, but then that would be a lot of work to support mixed Ocaml/C packages.\r\n\r\nMy comment on migration comes at least from a lot of experience with those kind of issues on the C++ committee regarding both retaining C compatibility as well as compatibility with older C++ versions. Of course the installed base is very much larger there and over much weight given to compatibility can inhibit advances requiring restructuring. However generally if you have very large code bases (millions of lines of code using large numbers of third party packages), an upgrade that leaves such a large client in the lurch is not a good way to encourage growth of the client base. The general rule is to leave old stuff alone and add new stuff, and that rule was broken here.\r\n\r\nI've seen some pretty sophisticated analysis tools for Ocaml so my feeling is that until someone produces an automatic upgrade tool, enforcing an upgrade simply isn't viable. I don't have the resources to produces such a tool. I also wouldn't have fixed the compiler bug by forcing users to change perfectly good code.\r\n\r\nRegarding Lexing, Lexing.from_bytes is what might help when parser input is constructed non-functionally: Dypgen at least does that, adding #line directives after purely functional text construction, seemingly this was a hack added after the original code was written. Anyhow it seems surprising that the primary use of Lexing.from_string is going to be from constructed text or, possibly text loaded into a buffer from a file, suggesting Lexing.from_bytes would be useful.\r\n\r\nLexemes that require modification are rare and lexemes are usually fairly short so manually converting a string to bytes when required is OK in my opinion (i.e. no Lexing.lexeme_bytes seems required).\r\n"}}
{"actor":{"display_login":"skaller"}}