Computation Against a Neighbour: Addressing Large-Scale Distribution and Adaptivity with Functional Programming and Scala (Logical Methods in Computer Science, 2023)