We view this as city as a programmable device. The traditional approach to programming over many devices is to place a runtime on all nodes to abstract away the underlying hardware. We take a different approach. Given that code deployment can be initiated remotely and at any time, it makes sense to instead adapt compiler based approaches where optimisation is done when the application is compiled/initially deployed. We believe that in order to cope with the large heterogeneity present in our target networks we should aim to have controlled variation, rather than arbitrary homogeneity. To this end we have developed a framework for developing smart city applications, which we name Scaffold. The main component of this framework consists of a compiler, which takes a program annotated with source data, commands and requirements in our Scale language and automatically determines the minimal set of actual programs that will need to be running in the nodes that compose the network, cloud to edge. Depending on the requirements this compiler can also inject the programs with runtimes, allowing for dynamic behaviour, whilst retaining as much intelligibility as possible. We have also developed Scanner, a registry and automatic deployment system for sensors, actuators and processor nodes in smart city scenarios. This system allows us to take the output of the Scale compiler and query the current state of the network in order to determine appropriate target nodes in which to install the various images produced by the Scale compiler.