{"action":"created","issue":{"url":"https://api.github.com/repos/ark-lang/ark-docs/issues/2","labels_url":"https://api.github.com/repos/ark-lang/ark-docs/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/ark-lang/ark-docs/issues/2/comments","events_url":"https://api.github.com/repos/ark-lang/ark-docs/issues/2/events","html_url":"https://github.com/ark-lang/ark-docs/issues/2","id":91054412,"number":2,"title":"Some Type system improvements","user":{"login":"HalosGhost","id":49465,"avatar_url":"https://avatars.githubusercontent.com/u/49465?v=3","gravatar_id":"","url":"https://api.github.com/users/HalosGhost","html_url":"https://github.com/HalosGhost","followers_url":"https://api.github.com/users/HalosGhost/followers","following_url":"https://api.github.com/users/HalosGhost/following{/other_user}","gists_url":"https://api.github.com/users/HalosGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/HalosGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HalosGhost/subscriptions","organizations_url":"https://api.github.com/users/HalosGhost/orgs","repos_url":"https://api.github.com/users/HalosGhost/repos","events_url":"https://api.github.com/users/HalosGhost/events{/privacy}","received_events_url":"https://api.github.com/users/HalosGhost/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-25T19:30:15Z","updated_at":"2015-06-25T19:35:06Z","closed_at":null,"body":"Type inference\r\n--------------\r\n\r\nAt the moment, type inference prefers doubles always rather than floats (for a decent reason). However, perhaps a better system would be to offer an explicit literal for floats so that a user can still force a float with type inference. In many C-family languages, this is accomplished by adding a ``f`` to the end of the would-otherwise-be-double literal:\r\n\r\n``1.2`` ← ``double``\r\n``1.2f`` ← ``float``\r\n\r\nNaming convention\r\n-----------------\r\n\r\nAt the moment, you have opted for ``{i,u}{8,16,32,64,128}``. I would recommend you replace the ``i`` with ``s`` (for ``signed``). If we are to be explicit, we might as well be as explicit as possible.\r\n\r\nArbitrarily-Sized, Fixed-width Integers\r\n---------------------------\r\n\r\nPerhaps one of the coolest features of LLVM, in my humble opinion, is that integer arithmetic is well-defined for integers of *any* bitwidth. And, that arbitrarily-sized fixed-width integers are openly exposed. So, for example, in LLVM IR, you could write the following:\r\n\r\n    %var = alloca i9\r\n    store i9 511, i9* %var\r\n\r\nIt would work! ``%var`` is a nine-bit integer! Admittedly, these fancypants integers are generally converted to system-native types during the compilation process, but it does allow for more specific compile-time type-checking. Since these are exposed in LLVM IR itself, inclusion of them into the language would not necessarily be so difficult (on the condition that it only works in the LLVM backend)."},"comment":{"url":"https://api.github.com/repos/ark-lang/ark-docs/issues/comments/115371969","html_url":"https://github.com/ark-lang/ark-docs/issues/2#issuecomment-115371969","issue_url":"https://api.github.com/repos/ark-lang/ark-docs/issues/2","id":115371969,"user":{"login":"felixangell","id":6254332,"avatar_url":"https://avatars.githubusercontent.com/u/6254332?v=3","gravatar_id":"","url":"https://api.github.com/users/felixangell","html_url":"https://github.com/felixangell","followers_url":"https://api.github.com/users/felixangell/followers","following_url":"https://api.github.com/users/felixangell/following{/other_user}","gists_url":"https://api.github.com/users/felixangell/gists{/gist_id}","starred_url":"https://api.github.com/users/felixangell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixangell/subscriptions","organizations_url":"https://api.github.com/users/felixangell/orgs","repos_url":"https://api.github.com/users/felixangell/repos","events_url":"https://api.github.com/users/felixangell/events{/privacy}","received_events_url":"https://api.github.com/users/felixangell/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T19:35:06Z","updated_at":"2015-06-25T19:35:06Z","body":"Hey! I think the first point is already implemented, although a recent issue @MovingtoMars suggested to remove these, so perhaps he's gone through with that change.\r\nAs for `s` over `i`, I actually quite like this, and think it's a good idea. And the last point, I'm not sure. If you're suggesting we allow for different sized integers to be defined by the programmer... then maybe? I don't know. :)"}}