FsFrink
units
FsFrink | units | |
---|---|---|
1 | 1 | |
4 | 94 | |
- | - | |
10.0 | 5.3 | |
almost 5 years ago | 3 months ago | |
F# | Haskell | |
- | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
FsFrink
-
Frink is a programming language designed to make physical calculations simple
I came across this repo where someone actually took the time to convert Frink's unit data to F# (which also supports units of measure) and I got to wondering if Frink's inspired it.
https://github.com/avestura/FsFrink
BTW, I'd love to see more mainstream languages consider features like units of measure. I understand the tech-debt it would likely-incur, but I think it would be a fun mental exercise to really go through the different languages and ask how one might add units of measure.
For example, in F#, the units are erased when they're compiled, so there is no runtime support for units. But I could imagine a dynamic/weaker typed language implementing it with runtime support where units are implemented like atomic symbols that are paired with numbers. Maybe each compound unit could be represented with a unique symbol that's created at runtime.
Personally, I don't think languages explore enough with interesting literals. Combining units with non-numeric types like strings might make interpolation a little more interesting.
units
-
Frink is a programming language designed to make physical calculations simple
It seems to me that Haskell would be a great language for such a thing, ensuring correctness at compile time through the type system, e.g. using the units package https://hackage.haskell.org/package/units https://github.com/goldfirere/units/tree/master/units
It even has nice features like: "The laws of nature have dimensions, and they hold true regardless of the units used. For example, the gravitational force between two bodies is (gravitational constant) * (mass 1) * (mass 2) / (distance between body 1 and 2)^2, regardless of whether the distance is given in meters or feet or centimeters. In other words, every law of nature is unit-polymorphic."
"The units package supports unit-polymorphic programs ..."
What are some alternatives?
unitdc-rs - A dc-like arbitrary precision quantity calculator.
smtlib2 - SMTLib2 interface implementation for Haskell
rink-rs - Unit conversion tool and library written in rust
polynomial - Haskell library for manipulating and evaluating polynomials
uncertain - Manipulating numbers with inherent measurement/experimental uncertainty.
monte-carlo - A Monte Carlo monad and transformer for Haskell.
dimensional - Dimensional library variant built on Data Kinds, Closed Type Families, TypeNats (GHC 7.8+).
matrix - A Haskell native implementation of matrices and their operations.
hgeometry - HGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms. The main two focusses are: (1) Strong type safety, and (2) implementations of geometric algorithms and data structures that have good asymptotic running time guarantees.
bayes-stack - Framework for Gibbs sampling of probabilistic models
rounded - MPFR bindings for Haskell
nimber - Finite nimber arithmetic