1. 19
  1. 4

    Looks like Elixir pattern matching, where to match something like a JSON object, you basically write something that looks just like the object, with identifiers (probably the wrong name) where you want the matched data filling in.

    1. 2

      Interestingly backwards from normal querying — instead of a large number of records and one query, you’ve got a large number of queries and one record. Presumably this is good when you’re watching data being streamed instead of data at rest.

      The reference to the “|” operator in grep reminded me that this is probably implemented as a Nondeterministic Finite State Automaton, which is used in regex matchers and the “lex” tool. I’ve always liked the idea of these — you take a normal state machine and run it in a Many-Worlds universe, following all possibilities and never collapsing the wavefunction. Then you map the resulting states to a normal state machine you actually run.

      Matching on exact values seems a bit limiting, though. It’s probably straightforward to extend the state matching to handle simple comparisons like “temp > 0”, but it complicates the pattern specification.