{"action":"created","issue":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/1133","repository_url":"https://api.github.com/repos/ponylang/ponyc","labels_url":"https://api.github.com/repos/ponylang/ponyc/issues/1133/labels{/name}","comments_url":"https://api.github.com/repos/ponylang/ponyc/issues/1133/comments","events_url":"https://api.github.com/repos/ponylang/ponyc/issues/1133/events","html_url":"https://github.com/ponylang/ponyc/issues/1133","id":171983599,"number":1133,"title":"Missing newline","user":{"login":"toblux","id":308689,"avatar_url":"https://avatars.githubusercontent.com/u/308689?v=3","gravatar_id":"","url":"https://api.github.com/users/toblux","html_url":"https://github.com/toblux","followers_url":"https://api.github.com/users/toblux/followers","following_url":"https://api.github.com/users/toblux/following{/other_user}","gists_url":"https://api.github.com/users/toblux/gists{/gist_id}","starred_url":"https://api.github.com/users/toblux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toblux/subscriptions","organizations_url":"https://api.github.com/users/toblux/orgs","repos_url":"https://api.github.com/users/toblux/repos","events_url":"https://api.github.com/users/toblux/events{/privacy}","received_events_url":"https://api.github.com/users/toblux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-18T19:41:16Z","updated_at":"2016-09-14T20:00:28Z","closed_at":null,"body":"This simple program\r\n\r\n```\r\nuse \"assert\"\r\n\r\nactor Main\r\n  new create(env: Env) =>\r\n    env.out.print(\"foo\")\r\n\r\n    let i: I32 = 0\r\n    try\r\n      Fact(i > 0, \"i > 0 failed\")\r\n    end\r\n\r\n    env.out.print(\"bar\")\r\n```\r\n\r\nsometimes outputs\r\n\r\n```\r\nfooi > 0 failed\r\nbar\r\n```\r\n\r\ninstead of\r\n\r\n```\r\ni > 0 failed\r\nfoo\r\nbar\r\n```\r\n\r\nFlushing `stderr` with `@fflush[I32](...)` before printing to it with `@fprintf[I32](...)` in https://github.com/ponylang/ponyc/blob/master/packages/assert/assert.pony#L27 resolves this issue, but I'm not sure if that's the best solution."},"comment":{"url":"https://api.github.com/repos/ponylang/ponyc/issues/comments/247135336","html_url":"https://github.com/ponylang/ponyc/issues/1133#issuecomment-247135336","issue_url":"https://api.github.com/repos/ponylang/ponyc/issues/1133","id":247135336,"user":{"login":"sylvanc","id":2785007,"avatar_url":"https://avatars.githubusercontent.com/u/2785007?v=3","gravatar_id":"","url":"https://api.github.com/users/sylvanc","html_url":"https://github.com/sylvanc","followers_url":"https://api.github.com/users/sylvanc/followers","following_url":"https://api.github.com/users/sylvanc/following{/other_user}","gists_url":"https://api.github.com/users/sylvanc/gists{/gist_id}","starred_url":"https://api.github.com/users/sylvanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylvanc/subscriptions","organizations_url":"https://api.github.com/users/sylvanc/orgs","repos_url":"https://api.github.com/users/sylvanc/repos","events_url":"https://api.github.com/users/sylvanc/events{/privacy}","received_events_url":"https://api.github.com/users/sylvanc/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T20:00:28Z","updated_at":"2016-09-14T20:00:28Z","body":"I think the issue is that writing to stderr and stdout on OSX doesn't guarantee atomicity between the streams.\r\n\r\nSo I think actually @toblux your initial idea is fine - `fflush` of `stderr` when writing synchronously in `Assert`. Are you up for filing a PR?"}}
{"actor":{"display_login":"sylvanc"}}