A network device system comprising: a compiler which is configured to receive text comprising syntax elements in an arrangement that indicates a topology for a plurality of nodes (30A,..., 30N), wherein each node of the plurality of nodes corresponds to a forwarding path element of a plurality of forwarding path elements (32A,..., 32N) that constitute data and instructions for performing packet processing operations, and wherein the text indicates one or more connections between respective nodes of the plurality of nodes such that the topology for the plurality of nodes is visible in the text; generate, based on the text, code for instantiating the plurality of nodes in the indicated topology for the plurality of nodes; and compile the code to generate a software image for a network device; and the network device comprising: a forwarding manager (16A,..., 16N) configured to execute the software image to configure a forwarding path to include the corresponding forwarding path elements for each of the plurality of nodes; and at least one packet processor (24A,..., 24N) operably coupled to a memory, wherein the at least one packet processor is configured to process packets received by a forwarding unit 11 (20A,..., 20N) by executing the forwarding path elements. a compiler which is configured to receive text comprising syntax elements in an arrangement that indicates a topology for a plurality of nodes (30A,..., 30N), wherein each node of the plurality of nodes corresponds to a forwarding path element of a plurality of forwarding path elements (32A,..., 32N) that constitute data and instructions for performing packet processing operations, and wherein the text indicates one or more connections between respective nodes of the plurality of nodes such that the topology for the plurality of nodes is visible in the text; generate, based on the text, code for instantiating the plurality of nodes in the indicated topology for the plurality of nodes; and compile the code to generate a software image for a network device; and receive text comprising syntax elements in an arrangement that indicates a topology for a plurality of nodes (30A,..., 30N), wherein each node of the plurality of nodes corresponds to a forwarding path element of a plurality of forwarding path elements (32A,..., 32N) that constitute data and instructions for performing packet processing operations, and wherein the text indicates one or more connections between respective nodes of the plurality of nodes such that the topology for the plurality of nodes is visible in the text; generate, based on the text, code for instantiating the plurality of nodes in the indicated topology for the plurality of nodes; and compile the code to generate a software image for a network device; and the network device comprising: a forwarding manager (16A,..., 16N) configured to execute the software image to configure a forwarding path to include the corresponding forwarding path elements for each of the plurality of nodes; and at least one packet processor (24A,..., 24N) operably coupled to a memory, wherein the at least one packet processor is configured to process packets received by a forwarding unit 11 (20A,..., 20N) by executing the forwarding path elements. a forwarding manager (16A,..., 16N) configured to execute the software image to configure a forwarding path to include the corresponding forwarding path elements for each of the plurality of nodes; and at least one packet processor (24A,..., 24N) operably coupled to a memory, wherein the at least one packet processor is configured to process packets received by a forwarding unit 11 (20A,..., 20N) by executing the forwarding path elements.