In computer science, macroprogramming is a programming paradigm aimed at expressing the macroscopic, global behaviour of an entire system of agents or computing devices. In macroprogramming, the local programs for the individual components of a distributed system are compiled or interpreted from a macro-program typically expressed by a system-level perspective or in terms of the intended global goal. The aim of macroprogramming approaches is to support expressing the macroscopic interactive behaviour of a whole distributed system of computing devices or agents in a single program, or, similarly, to promote their collective intelligence. It is not to be confused with macros, the mechanism often found in programming languages (like C or Scala) to express substitution rules for program pieces.
Macroprogramming originated in the context of wireless sensor network programming and found renewed interest in the context of the Internet of Things and swarm robotics.
Macroprogramming shares similar goals (related to programming a system by a global perspective) with multitier programming, choreographic programming, and aggregate computing.