Oh Coulombus, I'm so sick of Int! #361
Replies: 2 comments
-
@benhutchison thanks for your video! Zainab's libra talk is great, I viewed it after the fact. She and I had been designing typelevel unit systems at the same time, but neither of us was aware until I came across her talk 😂 I wanted to re-write coulomb to take advantage of the new features of Scala 3, and opaque types was definitely at the top of the list. My hope is that future improvements to the jvm (possibly project Valhalla) will someday enable even more compiler-level optimizations. My dream is that some day coulomb Quantity expressions can always compile down to "naked" numeric operations, although we aren't there yet. Coincidentally, I also explored affine spaces as a model of Some of what you are discussing was captured by my earlier integrations with refined, however I haven't yet re-constructed that for scala-3 coulomb. Overall, I like the idea of considering other formalisms that might be useful in this space - it's something I periodically think about as well! I admit I sometimes struggle to get my head around the formalisms I've already created 😂 I'd be interested to see a prototype of some of the "algebras" you are proposing and see what it it all looks like w.r.t. implementation and user-experience. I also grapple with the question of "who owns who" - for example, I ultimately settled on treating |
Beta Was this translation helpful? Give feedback.
-
Hi @erikerlandson thanks for your reply. 😁 I'm working on a code sketch of my ideas, integrated against Coulomb. Essentially, 1D points, vectors, magnitude and directions built as a separable layer over Quantity [V, U]. Will reply back when I make progress worth reporting on. |
Beta Was this translation helpful? Give feedback.
-
Hi Erik :)
I don't need to hear the story of the mars lander again to be convinced about Units of Measure.. or any other of the 1000s of bugs caused by mismatched units over the years. I've got my own war stories to add to the pantheon! I
eagerlyimpatiently await the day when using units of measure is considered normal and natural in industry. So I'm sold on the concept, looking for implementations that are extensible, reliable, supported, and add minimal runtime overheads.I've been aware of Coulomb for a while but for some reason (er, laziness) I didn't zoom in close to take a careful look. I think the presence of three Typelevel aligned UoM libs might explain it. I was at Zainab's TL 2018 talk on Libra, and Squants is under the Typelevel banner and has much more stars, so I just "presumed" they were more developed.
But this last week I had a much better look and a test drive. I'm really impressed by Coulomb. In particular, as a Scala 3 lib based on opaque types, it has the potential to work with unboxed primitive arrays. To me that's a huge selling point that is not emphasized in the current documentation or the release notes for version 0.6.
I do think that there's a design axis of the problem that Coulomb has touched on (with
Quantity
vsDeltaQuantity
) but is richer than has been recognised. I've made a little video to explain my thinking that I hope is interesting & thought-provoking:https://youtu.be/lLUazJS-65k
Beta Was this translation helpful? Give feedback.
All reactions