{"action":"opened","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/11486","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/11486/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/11486/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/11486/events","html_url":"https://github.com/chapel-lang/chapel/issues/11486","id":374641694,"node_id":"MDU6SXNzdWUzNzQ2NDE2OTQ=","number":11486,"title":"units (e.g. meters) and dimensional analysis","user":{"login":"mppf","id":3653132,"node_id":"MDQ6VXNlcjM2NTMxMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/3653132?v=4","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"labels":[{"id":499565193,"node_id":"MDU6TGFiZWw0OTk1NjUxOTM=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Language","name":"area: Language","color":"d4c5f9","default":false},{"id":496591534,"node_id":"MDU6TGFiZWw0OTY1OTE1MzQ=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/area:%20Libraries","name":"area: Libraries","color":"d4c5f9","default":false},{"id":112762321,"node_id":"MDU6TGFiZWwxMTI3NjIzMjE=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/type:%20Design","name":"type: Design","color":"e99695","default":false},{"id":496603397,"node_id":"MDU6TGFiZWw0OTY2MDMzOTc=","url":"https://api.github.com/repos/chapel-lang/chapel/labels/type:%20Feature%20Request","name":"type: Feature Request","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-27T12:46:03Z","updated_at":"2018-10-27T12:46:03Z","closed_at":null,"author_association":"MEMBER","body":"Recent work on the string library has us adding different types for different forms of string offsets (byte offset vs. codepoint offset). This made me wonder, could we have a generalized system for units like meters? Certainly units are very important in physical calculations. How useful would that be? And, are the requirements for physical units very different from the string case?\r\n\r\nI don't know the answers to these questions but I suspect handling physical units would be pretty different from the string case. Physical units have many more units and consider products of unit types (e.g. ft-lbs or meters/second). The string conversion between byte offset and codepoint offset depends on the string, which is also not a property of the physical units.\r\n\r\nFor physical units, it seems like a reasonable end goal would be to have compile-time type checking of the units (e.g. can't add feet and seconds) that was robust enough to be not-too-annoying for physical simulations. My quick look at prior art seems to suggest that compile-time analysis can provide better error messages than libraries adding the functionality.\r\n\r\nHere are links about prior art for units in programming languages:\r\n * https://stackoverflow.com/questions/107243/are-units-of-measurement-unique-to-f\r\n * Boost Units\r\n * F# https://fsharpforfunandprofit.com/posts/units-of-measure/\r\n * Ada Units of Measurement package http://www.dmitry-kazakov.de/ada/units.htm\r\n * Osprey: A Practical Type System for Validating Dimensional Unit Correctness of C Programs http://web.cs.ucdavis.edu/~su/unitfull.pdf\r\n * Units-of-Measure Correctness in Fortran \r\nPrograms https://www.cl.cam.ac.uk/~acr31/pubs/contrastin-units.pdf\r\n * Experience Report: Type-checking Polymorphic\r\nUnits for Astrophysics Research in Haskell https://cs.brynmawr.edu/~rae/papers/2014/units/units.pdf\r\n * Object-Oriented Units of Measurement https://www.cs.tufts.edu/~nr/cs257/archive/neal-glew/mcrt/Fortress/p109-allen.pdf"}}
{"actor":{"display_login":"mppf"}}