Skip to content
AI.info

Research

Lambdas at the Far Edge: a Tale of Flying Lambdas and Lambdas on Wheels

Overview Research area: Distributed computing (cs.DC) — Aggregate Programming (AP), field-based coordination languages, and their type-theoretic foundations. The paper sits at the intersection of lamb

Lambdas at the Far Edge: a Tale of Flying Lambdas and Lambdas on Wheels
arXiv
2603.04008
Published
2026-03-04
Authors
Giorgio Audrito, Daniele Bortoluzzi, Ferruccio Damiani, Giordano Scarso, Gianluca Torta, Andrea Basso, Monica Cochi, Lorenzo Gusman, Lorenzo Comba, Paolo Gay, Paola Dal Zovo, Giada Galati, Francesco Gallo, Aljaž Grdadolnik, Massimo Pescarollo, Paola Pisano

AI summary

Overview

  • Research area: Distributed computing (cs.DC) — Aggregate Programming (AP), field-based coordination languages, and their type-theoretic foundations. The paper sits at the intersection of lambda calculus / type theory and edge-deployed embedded systems.
  • Technical level: Intermediate to Advanced. The paper is explicitly written as a "gentle introduction," but it contains formal syntax, a full Hindley-Milner typing system with syntax-directed rules, and operational semantics for asynchronous proximity-based communication.
  • Scope (one sentence): The paper gives a formal and tutorial-style account of the eXchange Calculus (XC), a typed lambda calculus extended with an exchange operator for neighbour-to-neighbour communication, and briefly introduces its C++ implementation FCPP and the industrial deployments that use it.

Note on the provided content: the excerpt available here covers the abstract, Section 1 (Introduction) and Section 2 up to Section 2.3.3. Sections 3 to 7 are announced in the paper's organization but their body text is not included in the supplied content, so their specific findings cannot be summarised.

What This Paper Is About

Networks at the far edge — embedded devices, sensors, rovers, and soon UAVs — have grown too numerous to program one device at a time, so researchers need a way to program the collective behaviour of a whole network as if it were a single platform. Aggregate Programming answers this by describing computation as information propagating through a set of devices that interact implicitly by proximity rather than by explicit point-to-point messages. This paper explains XC, the foundational model behind that paradigm, showing how it is essentially a typed (call-by-value, ML-style) lambda calculus plus one communication operator, and it sketches the C++ library and toolchain FCPP that runs XC programs on real hardware and in simulation.

Key Contributions

  1. A gentle introduction to XC for lambda-calculus and type-theory readers. The paper presents XC as a call-by-value lambda calculus typed à la ML, with syntax, free-variable definitions, syntactic sugar, and a complete Hindley-Milner typing system, deliberately framed for researchers whose background is in typed lambda calculi.
  2. A formal account of devices, space, time and the physical environment. Section 2.2 introduces spatially situated devices with sensors and actuators, the notion of an asynchronous firing (or round), and sensor built-ins such as uid, gps, time and temperature.
  3. A formal account of proximity-based interaction. Section 2.3 introduces messages, neighbours, neighbouring values (nvalues) as defaulted maps from device identifiers to literal values, folding over neighbours via nfold, and the single communication primitive exchange, together with derived patterns such as nbr.
  4. A bridge from theory to deployment. The paper introduces the FCPP C++ library and toolchain, which lets programmers embed XC programs in C++ applications and deploy them on networks of physical devices as well as in a simulator, and it points to industrial case studies in collaboration with Reply, Synesthesia, Eurix and Torino Airport.

Main Findings

  • XC is a typed lambda calculus with one added operator. An XC expression e is a variable, a possibly recursive function fun x(x̄){e} (which may have free variables), a function call e(ē), a let-like expression val x = e; e, or a literal value ℓ — where a literal is a built-in, a closed function, or a data constructor applied to literal values. The distinguishing feature is the exchange built-in, an implicit communication mechanism between neighbour devices. Programs are closed expressions.
  • Typing is standard Hindley-Milner. Types are type variables α, (possibly recursive) data types K[T̄], or function types (T̄) → T. Polymorphism is handled by type schemes ∀ᾱ.T with an instantiation relation ≺. The typing rules [T-ASS], [T-LIT], [T-APP], [T-FUN] and [T-VAL] are described as syntax-directed and "all standard." An initial typing environment 𝒜₀ declares a unique type scheme for every available data constructor and built-in function.
  • mux is an eager conditional, and conditionals are sugar over it. mux : (bool, A, A) → A evaluates all three arguments and returns the second or the third according to the first. The familiar if(e){e1}else{e2} is defined as mux(e, ()=>e1, ()=>e2)().
  • Built-ins cover standard data types plus sensors. The listed built-ins include mux; the arithmetic operators +, -, *, /; Boolean and, or; relational ==, <=, >= (restricted so the generic type A cannot contain function types); pair operations pair, fst, snd; and numeric constructors including -1, 0, 0.25, 1 and Infinity. Sensor built-ins used in examples are uid : () → num, gps : () → PAIR[num, num], time : () → num (epoch Unix timestamp in seconds since Jan 01 1970 UTC), and temperature : () → num (Celsius).
  • Execution is via asynchronous firings. Each device repeatedly "wakes up," gathers sensor data, atomically executes the same XC program, produces an output (its value), and goes back to sleep. Rounds are entirely asynchronous: a device may run out of battery and never wake up, may restart after the battery is charged, or may enter a non-terminating execution and "disappear" (a reboot aborts the execution and enables another firing). No common scheduling is assumed.
  • Communication makes very few assumptions. Messages are buffered, keeping only the most recent message per neighbour, and messages exceeding a configurable lifetime expire. The formalisation assumes order preservation from the same sender but otherwise allows that: (i) a device may be too far to send to a former neighbour; (ii) a message may get lost; (iii) a device may disappear or fail; (iv) a device may reboot, losing its queue of received messages; (v) a device may deem messages from some devices expired. XC abstracts from all of these — a firing finds some messages from the most recent available firings of some other devices, and firing does not remove messages from the buffer.
  • Neighbouring values are defaulted maps. An nvalue is written ℓ[δ₁↦ℓ₁, ..., δₙ↦ℓₙ] (n ≥ 0), read as "the value is ℓ everywhere except for devices δ₁, ..., δₙ with values ℓ₁, ..., ℓₙ." Nvalues never occur in source code; they arise at runtime. Literal values are implicitly promoted to nvalues ℓ[], and operations on literals lift pointwise. For example, with w̄₁ = 0[δ₁↦1, δ₂↦2] and w̄₂ = 2[δ₂↦1], then w̄₁ + w̄₂ = 2[δ₁↦3, δ₂↦3].
  • Folding over neighbours. nfold(f : (A, B) → A, w̄ : B̄, ℓ : A) : A applies f iteratively to the values associated with neighbouring devices, excluding the value for the device executing the computation, starting from ℓ. The paper notes the semantics do not rely on any ordering of device identifiers, so f is standardly assumed associative and commutative. On device δ₂ with neighbours {δ₁, δ₃}, the expression nfold(+, w̄₁, 10) with w̄₁ = 0[δ₁↦1, δ₂↦2] evaluates to 10 + 1 + 0.
  • Distance estimation is one short line of XC. def distanceEstimate(n̄) { nfold(min, n̄ + senseDist̄, Infinity) } computes, for each neighbour δ, the individual estimate n̄(δ) + senseDist̄(δ) and returns the smallest, or Infinity if no values are available. The type is (num̄) → num.
  • exchange is the single communication primitive. exchange(eᵢ, (ō, n̄) => return eᵣ send eₛ) de-sugars to exchange(eᵢ, (ō, n̄) => pair(eᵣ, eₛ)). Evaluation proceeds by: (i) evaluating the initial value eᵢ to a literal ℓᵢ; (ii) substituting ō with the nvalue computed in the previous round by the local device for eₛ (or ℓᵢ on the first round); (iii) substituting n̄ with the nvalue of messages received from neighbours for this exchange, using ℓᵢ as default; (iv) returning the value vᵣ obtained from eᵣ; and (v) evaluating eₛ to an nvalue of literals to be sent to neighbours, which they use to build their n̄ for their following execution round.
  • Useful derived patterns. exchange(eᵢ, (ō, n̄) => retsend e) abbreviates the case where the returned and sent expressions coincide. The nbr function, nbr(eᵢ, eₛ) = exchange(eᵢ, (ō, n̄) => return n̄ send eₛ), retrieves neighbours' values. Other nvalue built-ins listed are self (extracts the current device's value, i.e. w̄(δ)), updateSelf (updates the self entry, written w̄[δ↦ℓ]), updateDef (updates the default message), and the sensor senseDist giving distance estimates to neighbours.
  • A worked system-execution example. Figure 6 illustrates an execution over four devices δ₁–δ₄. Device δ₂ activates twice, producing events ε₁ and ε₂; grey arrows denote transmissions that fail and are never delivered. In event ε₂, δ₂ processes three messages received during its sleep phase, from δ₄, δ₃ and δ₁, and then transmits messages to both δ₃ and δ₁. This could correspond to the nvalue w̄ = 0[δ₄↦1, δ₃↦2, δ₁↦3] on receipt and outgoing messages captured by w̄' = 0[δ₃↦5, δ₁↦6], so that w̄'(δ₁) = 6 and w̄'(δ₂) = 0.

Methodology in Plain English

The authors take a layered, tutorial-style approach rather than an empirical one. They start from something familiar — a call-by-value lambda calculus with ML-style typing — and then add ingredients one at a time, showing at each step what new behaviour becomes possible.

First, they present the pure language: syntax, free variables, non-standard syntactic sugar (lambda expressions, top-level def, and if/else built from mux), and a complete set of typing rules based on Hindley-Milner type schemes. They explicitly note that all typing rules are standard and syntax-directed.

Second, they "add spice" by bringing in spatially situated devices with sensors and actuators, each repeatedly firing the same program. They define the round/firing model and give a concrete program (pair(pair(time(), gps()), temperature())) to show what a device would display, along with the resulting value shape and its type.

Third, they add proximity-based interaction. They define messages and neighbours, state explicitly which real-world failures the formalisation permits but abstracts over, and introduce neighbouring values as defaulted maps with a fallback value. They show how literals promote to nvalues and how operations lift pointwise, then introduce folding over neighbours and the single exchange primitive with its step-by-step evaluation procedure, plus derived conveniences like retsend and nbr.

Throughout, every concept is illustrated with a tiny worked numeric example (the nvalues 0[δ₄↦1, δ₃↦2, δ₁↦3], the fold nfold(+, w̄₁, 10), the one-line distanceEstimate), so the reader can trace the semantics by hand. The provided excerpt stops mid-development of the nbr derivation; the announced sections on XC design decisions, FCPP, industrial case studies, related work and future work are not included in the supplied content.

Why This Matters

Impact on research. XC is a foundational model, not just an engineering tool, so the paper's value is in making the model legible to the type-theory and lambda-calculus community. By showing that a distributed collective-behaviour language is "essentially a typed lambda calculus extended with an operator," the paper opens the paradigm to researchers who would otherwise never read a distributed-systems paper. It also anchors a line of work explicitly dedicated to Stefano Berardi, whose career at the Department of Computer Science of the University of Turin focused on the logical foundations of computer science and often leveraged typed lambda calculi — the paper is written to him on the occasion of his 2⁶th birthday.

Real-world applications. The paper points to deployments and consortium work at the far edge, described at the level of the organisations and projects involved rather than with performance numbers:

  • Airport operations, in collaboration with Torino Airport (Caselle Torinese).
  • Aerospace and sustainable mobility, through the RoboNG and RoboAPP cascade funding projects of Spoke 1 "Sustainable mobility and aerospace" of the PNRR NODES.
  • Agricultural technology, through the CN AgriTech project, involving the Department of Agricultural, Forest and Food Sciences (DiSAFA) at the University of Turin.
  • Robotics at the edge: the abstract states that FCPP programs have been deployed on rovers and are "soon" to be deployed on Uncrewed Aerial Vehicles (UAVs) — the "lambdas on wheels" and "flying lambdas" of the title.

Industry relevance. The work is explicitly co-produced with industry: the author list spans MITO Technology (Milan), Torino Airport, Concept Engineering (Reply, Turin), Eurix (Turin), the University of Ljubljana, and two University of Turin departments (Computer Science, and Economics and Statistics "Cognetti de Martiis"). FCPP is described as used in a number of industrial case studies developed with Reply, Synesthesia, Eurix and Torino Airport, and the paper notes that a preliminary result of these activities was recently published. The parallel Scala library and toolchain ScaFi, mainly developed at the Department of Computer Science and Engineering of the University of Bologna, indicates that the paradigm has two independent practical implementations.

Future Directions

These are drawn from the paper's own framing plus evident open questions from the content that is available:

  • Deployment on Uncrewed Aerial Vehicles. The abstract states that UAV deployment is "soon," making the move from rovers on wheels to flying hardware the most concrete near-term step named in the paper.
  • The industrial case studies still to be reported. Section 5 is announced as a brief overview of industrial case studies in the aviation, mobility and agri-tech settings listed above; the excerpt does not contain their details or results.
  • Design decisions and properties of XC. Section 3 is announced to outline XC design decisions and its main properties, which the excerpt does not cover — the reader is left with the formal system but not the rationale for the specific choice of a single exchange primitive.
  • Practical maturity of the toolchain. Section 4 is announced as an introduction to FCPP; the excerpt mentions the toolchain's existence, its C++ embedding of XC programs, and its simulator, but not its engineering characteristics or limitations.

Target Audience

  • Researchers in lambda calculus and type theory — the paper is explicitly billed as a gentle introduction tailored for readers with those interests, and it assumes comfort with typing judgements, type schemes and syntax-directed rules.
  • Researchers and students in aggregate programming, field calculus and distributed/edge computing who want to understand XC as the generalisation of the Field Calculus and to see how its primitives map to concrete sensor and communication operations.
  • Practitioners and engineers in edge, IoT, robotics and cyber-physical systems who need a conceptual grounding before adopting FCPP or ScaFi, particularly those working with spatially distributed fleets of devices.
  • Industry and applied researchers in aerospace, mobility, agriculture and airport operations who want to see how a formal coordination language is being carried into consortium and industrial projects.

Readers looking for benchmark numbers, performance measurements, dataset sizes or quantitative evaluation will not find them in this paper: it is a formal and expository account, and no such figures appear in the content provided.

Authors’ abstract

Aggregate Programming (AP) is a paradigm for programming the collective behaviour of sets of distributed devices, possibly situated at the network far edge, by relying on asynchronous proximity-based interactions. The eXchange Calculus (XC), a recently proposed foundational model for AP, is essentially a typed lambda calculus extended with an operator (the exchange operator) providing an implicit communication mechanism between neighbour devices. This paper provides a gentle introduction to XC and to its implementation as a C++ library, called FCPP. The FCPP library and toolchain has been mainly developed at the Department of Computer Science of the University of Turin, where Stefano Berardi spent most of his academic career conducting outstanding research about logical foundation of computer science and transmitting his passion for research to students and young researchers, often exploiting typed lambda calculi. An FCCP program is essentially a typed lambda term, and FCPP has been used to write code that has been deployed on devices at the far edge of the network, including rovers and (soon) Uncrewed Aerial Vehicles (UAVs); hence the title of the paper.

Read the original paper