Conversion of scientific units and quantities?

168 views
Skip to first unread message

Bobby DeSimone

unread,
Sep 26, 2013, 7:42:26 PM9/26/13
to golan...@googlegroups.com
My first "real" Go-based project heavily relies on scientific calculations. My first inclination was to use an abstraction of explicit, standard units but couldn't find any Go specific library. What do Go programmers in lieu of libraries like Gnu Unit [1], Boost Units[2], Python Unum[3], Units in Java[4], etc. ?

The only 'pure-go' implementation of SI units I could find is http://godoc.org/github.com/smyrman/units , however it looks incomplete. It looks like he is emulating the time-duration package, is that a reasonable approach?If I do need to reinvent the wheel, what should I know to make it as idiomatic Go as possible?

Go experts, what are my options? 

Dan Kortschak

unread,
Sep 27, 2013, 3:28:53 AM9/27/13
to Bobby DeSimone, golan...@googlegroups.com
There has been extensive discussion of this on the gonum-dev list. You
may want to have a look at some of that.

Dan

Message has been deleted

Nico

unread,
Sep 27, 2013, 4:44:54 AM9/27/13
to golan...@googlegroups.com

egon

unread,
Sep 27, 2013, 6:05:59 AM9/27/13
to golan...@googlegroups.com

On Friday, September 27, 2013 2:42:26 AM UTC+3, Bobby DeSimone wrote:
My first "real" Go-based project heavily relies on scientific calculations. My first inclination was to use an abstraction of explicit, standard units but couldn't find any Go specific library. What do Go programmers in lieu of libraries like Gnu Unit [1], Boost Units[2], Python Unum[3], Units in Java[4], etc. ?


What does it mean to rely heavily on scientific calculations? What are the requirements for speed, safety, usability? Is mixing units required? Mixing feet and meters in calculations is basically asking for trouble.

Here's one simple possibility, if speed isn't that important, and you can accept runtime safety and you don't have measurement-system mixing http://play.golang.org/p/5FZ29SUj7k .

+ egon
Reply all
Reply to author
Forward
0 new messages