1. 38

Essay is from 2004, but Frink (www.frinklang.org) is still contemporary and actively worked on. This is just a good intro.

  1.  

  2. 7

    From the FAQ: “Why is the pound a measure of mass, not force (or currency?)”

    Well, in the United States, the pound has been officially defined to be a unit of mass since at least 1893 (by the Office of Standard Weights and Measures, and later by its successor, the National Bureau of Standards (NBS), which was formed in 1901. The National Bureau of Standards was renamed the National Institute of Standards and Technology (NIST) in 1988.) It has had its current value since 1959, defined as exactly 0.45359237 kilograms (also a unit of mass,) both by official notice in the Federal Register, giving it the effect of official U.S. policy, and as an official refinement by the National Bureau of Standards.

    I had no idea!

    1. 12

      The entire data file is a wonderful read.

      // In other words, if you use the Hz in the way it’s currently defined by the SI, as equivalent to 1 radian/s, you can point to the SI definitions and prove that you follow their definitions precisely. And your physics teacher will still fail you and your clients will think you’re completely incompetent because 1 Hz = 2 pi radians/s. And it has for centuries. You are both simultaneously both right and both wrong.
      You cannot win. You are perfectly right. You are perfectly wrong. You look dumb and unreasonable. The person arguing the opposite looks dumb and unreasonable.

      // Hz == YOU CANNOT WIN

      1. 2

        It really is. As a history fan, I particularly like that it has antiquated units like amphora and talents. Great stuff!

      2. 1

        I had no idea!

        Huh. Me either, because this is apparently another thing that my high school Physics teacher was completely wrong about.

      3. 6

        Frink is one of the most delightful languages I’ve ever used. There’s just something so nice about being able to convert between cubic millilightseconds and half inch-foot-miles.

        (The conversion ratio is 4 quadrillion, for the record)

        1. 2

          …this is incredible. This is an actual useful tool for day-to-day. I’m in.

          1. 3

            An idea I push is to add its measures to type systems or something of safe languages to catch conversion errors. We lost at least one, space probe in miles to kilos mismatch.

            1. 6

              I know F# has units of measurement support.

              1. 1

                That’s the first thing I thought of while reading this. It’d make a nice port.

              2. 3

                I am fairly certain I’ve seen attempts that this (beyond just libraries of units represented by classes, or algebraic types) that weren’t frink, itself.

                Take for instance, this Julia library, which seems to brute force the relationships amongst units into existence. I imagine the type safety you get (if any) comes because there are macros that define overloaded functions for compatible types, and it’s less about type system elegance than would be ideal.

                I wonder if a macroless solution could be done with dependent types? Presumably, you could define types that ensure they are part of a compatible set for combination over an operator, and such. But, of course, dependent type systems haven’t hit the main stream languages, forcing us to solve, generally, with libraries that sacrifice usability in the name of reality.

                1. 3

                  I recommend reading Bill Kent’s Measurement Data (Archive Report) for an brief overview of just how evil units are.