Please Put Units in Names

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • zen

  • Using templates I once implemented logic for dealing with SI units[1]. I also included angles, which is a bit odd but useful in practice.

    It is really nice to have a type system that checks your formulas. Saved me a couple of times.

    [1] https://gitlab.com/roeles/zen/-/blob/master

  • durationcheck

    Go linter to detect erroneous multiplication of duration values

  • Now I insist on using the durationcheck lint to guard against this (https://github.com/charithe/durationcheck). It found a flaw in some exponential-backoff code I had refactored but couldn’t easily fully test that looked right but was wrong, and now I don’t think Go’s approach is reasonable anymore.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • mp-units

    The quantities and units library for C++

  • Good C++ library for that topic is [0]. You can even go further and combine with something like [1] which is super helpful for kalman filters and other stuff where you have heterogeneous units in one vector.

    [0] https://github.com/mpusz/units

  • kal

    A powerful, easy-to-use, and easy-to-read programming language for the future.

  • dimensioned

    Compile-time dimensional analysis for various unit systems using Rust's type system.

  • dimensioned[1] got me interested in Rust. I’m not far enough to recommend it, but the concept seems right.

    [1] https://github.com/paholg/dimensioned

  • unit_fun

    📏 Dimension based safety in elixir

  • I ended up building a library for elixir a few years back for this kind of thing: https://github.com/meadsteve/unit_fun.

  • go

    The Go programming language

  • Go's time package is famously horrible. First they didn't expose any monotonic clocks only wall time. Then when they were forced after some public outages, like time travelling backwards for Cloudflare. They managed to fold into the original type to cling on to the "Go just works" mantra, but adding even more edge cases when exposed to the world.

    https://pkg.go.dev/time#hdr-Monotonic_Clocks

    > RRDNS is written in Go and uses Go’s time.Now() function to get the time. Unfortunately, this function does not guarantee monotonicity. Go currently doesn’t offer a monotonic time source (see issue 12914 for discussion).

    https://blog.cloudflare.com/how-and-why-the-leap-second-affe...

    > time: use monotonic clock to measure elapsed time #12914

    https://github.com/golang/go/issues/12914

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Unchained

    A fully type safe, compile time only units library. (by SciNim)

  • NodaTime

    A better date and time API for .NET

  • Yeah, before the new DateOnly (and TimeOnly) types, there was no built-in way in C# to specify a plain date. NodaTime[1] (a popular third-party library for datetime operations) did have such types though.

    [1]: https://nodatime.org/

  • phpmnd

    PHP Magic Number Detector

  • PHP mess detector has a rule for this called "Magic Number Detector" (https://github.com/povils/phpmnd) which will cause an error when it encounters numbers that violate the parameters you set.

  • SI

    A header only C++ library that provides type safety and user defined literals for physical units (by bernedom)

  • In C++ you can use user defined literals to make the units stuff compile time checked, similar to this https://github.com/bernedom/SI for example.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts