{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7125","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7125/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7125/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7125/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/7125","id":329215425,"node_id":"MDU6SXNzdWUzMjkyMTU0MjU=","number":7125,"title":"Arrays of objects becames Array<Dynamic> on many targets. ","user":{"login":"dmitryhryppa","id":4466595,"node_id":"MDQ6VXNlcjQ0NjY1OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4466595?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitryhryppa","html_url":"https://github.com/dmitryhryppa","followers_url":"https://api.github.com/users/dmitryhryppa/followers","following_url":"https://api.github.com/users/dmitryhryppa/following{/other_user}","gists_url":"https://api.github.com/users/dmitryhryppa/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitryhryppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitryhryppa/subscriptions","organizations_url":"https://api.github.com/users/dmitryhryppa/orgs","repos_url":"https://api.github.com/users/dmitryhryppa/repos","events_url":"https://api.github.com/users/dmitryhryppa/events{/privacy}","received_events_url":"https://api.github.com/users/dmitryhryppa/received_events","type":"User","site_admin":false},"labels":[{"id":41271761,"node_id":"MDU6TGFiZWw0MTI3MTc2MQ==","url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/platform-cpp","name":"platform-cpp","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":{"login":"hughsando","id":1665494,"node_id":"MDQ6VXNlcjE2NjU0OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1665494?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsando","html_url":"https://github.com/hughsando","followers_url":"https://api.github.com/users/hughsando/followers","following_url":"https://api.github.com/users/hughsando/following{/other_user}","gists_url":"https://api.github.com/users/hughsando/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsando/subscriptions","organizations_url":"https://api.github.com/users/hughsando/orgs","repos_url":"https://api.github.com/users/hughsando/repos","events_url":"https://api.github.com/users/hughsando/events{/privacy}","received_events_url":"https://api.github.com/users/hughsando/received_events","type":"User","site_admin":false},"assignees":[{"login":"hughsando","id":1665494,"node_id":"MDQ6VXNlcjE2NjU0OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1665494?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsando","html_url":"https://github.com/hughsando","followers_url":"https://api.github.com/users/hughsando/followers","following_url":"https://api.github.com/users/hughsando/following{/other_user}","gists_url":"https://api.github.com/users/hughsando/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsando/subscriptions","organizations_url":"https://api.github.com/users/hughsando/orgs","repos_url":"https://api.github.com/users/hughsando/repos","events_url":"https://api.github.com/users/hughsando/events{/privacy}","received_events_url":"https://api.github.com/users/hughsando/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-06-04T21:01:23Z","updated_at":"2018-06-05T14:41:24Z","closed_at":"2018-06-05T14:30:44Z","author_association":"NONE","body":"Hello.\r\nIf we declare an Array as:\r\n`var entities:Array<Entity> = new Array<Entity>();`\r\nwhere Entity is a regular Haxe class, then it will be generated as below for cpp target:\r\n`::Array< ::Dynamic> entities = ::Array_obj< ::Dynamic>::__new();`\r\nAlso, on Java and C# this array will contains `Object` (aka Dynamic) too. Not sure about other targets.\r\n\r\nThe problem is that `Dynamic` is pretty slow in many cases, especially on cpp target. \r\nJust imagine situation when you have 2 millions triangles in array (discribed as `class Triangle {var x:Float; var y:Float; var z:Float;}`) and you iterate through it every frame. So, this will proveke unnecessary casting from `Dynamic` item inside array to the `Triangle`. \r\n \r\nWould be nice if Haxe could generate propertly typed arrays.\r\n\r\nThank you ;)"},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/394735420","html_url":"https://github.com/HaxeFoundation/haxe/issues/7125#issuecomment-394735420","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/7125","id":394735420,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDczNTQyMA==","user":{"login":"dmitryhryppa","id":4466595,"node_id":"MDQ6VXNlcjQ0NjY1OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/4466595?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitryhryppa","html_url":"https://github.com/dmitryhryppa","followers_url":"https://api.github.com/users/dmitryhryppa/followers","following_url":"https://api.github.com/users/dmitryhryppa/following{/other_user}","gists_url":"https://api.github.com/users/dmitryhryppa/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitryhryppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitryhryppa/subscriptions","organizations_url":"https://api.github.com/users/dmitryhryppa/orgs","repos_url":"https://api.github.com/users/dmitryhryppa/repos","events_url":"https://api.github.com/users/dmitryhryppa/events{/privacy}","received_events_url":"https://api.github.com/users/dmitryhryppa/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T14:41:24Z","updated_at":"2018-06-05T14:41:24Z","author_association":"NONE","body":"Oh, that's interesting. \r\n\r\nBut there is still a problem with Array of Dynamic when you use generated classes from Java, C# or Cpp...\r\nIn Java and C# you can pass into this arrays anything, which is not good (and most people use this targets exactly for sharing logic). \r\nSo, this is still important to have stricly typed arrays."}}
{"actor":{"display_login":"dmitryhryppa"}}