ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Timestamp
What is your view on the addition of loops to the P4 language specification, in some form?
I would like compile-time style loops in P4 for creating repetitive table entries inside of an `entries` or `const entries` table property.
I would like compile-time style loops in P4 for creating repetitive definitions of entire actions.
I would like compile-time style loops in P4 for creating repetitive definitions of entire tables.
I would like compile-time style loops in P4 for creating repetitive definitions of instantiations of extern objects.
I would like compile-time style loops in P4 for creating repetitive definitions of variables and/or constants.
I would like compile-time style loops in P4 for creating repetitive definitions of entire controls.
I would like compile-time style loops in P4 for creating repetitive definitions of entire parsers.
I would like compile-time style loops in P4 for creating repetitive definitions of some other language construct not already asked about (please specify what type of construct in the comment box, or leave it empty if none).
I would like there to be some kind of way to create P4 identifiers that are concatenations of multiple parts, where one or more parts can be loop variables, similar in effect to the C preprocessor `##` syntax, called "token pasting" or "token concatenation": https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html
I would like to be able to write loops in P4 that have no compile-time known upper limit on the number of times they would repeat.
I would like to be able to write loops within a parser state definition (note that it is already possible today to write loops that transition among on or more parser states).
I would like to be able to write loops within a single action definition.
I would like to be able to write loops within a control's `apply` block.
If you answered yes to wishing for loops within parser states, action bodies, or control `apply` blocks, what style would you prefer them to be defined in?
2
3
Summary of results:
4
Answer Yes16131010118811561315
5
Answer No2588710107131253
6
17
<-- I can imagine some kinds of loops that I would be in favor of adding
11<-- None or N/A7
<-- Mandated in the language specification to be expanded at compile time.
7
1
<-- I cannot imagine any kind of loop of any kind that I would be in favor of adding
see entries with green fill color below for unique answers
9
<-- Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
8
see entries with green fill color below for unique answers
9
10
Raw answers:
11
11/6/2023 17:34:08
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesNo YesNoNoYesYes
Mandated in the language specification to be expanded at compile time.
12
11/6/2023 17:43:13
I can imagine some kinds of loops that I would be in favor of adding
NoYesYesNoNoYesNon/aYesNoNoYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
13
11/6/2023 17:53:20
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesYesNoneYesNoNoYesYes
Mandated in the language specification to be expanded at compile time.
14
11/6/2023 18:02:57
I can imagine some kinds of loops that I would be in favor of adding
YesYesNoNoYesNoNo
iterating over a few register actions to avoid my ugly and repetitive code
YesYesNoNoYes
Mandated in the language specification to be expanded at compile time.
15
11/6/2023 20:25:46
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesYesnoneYesYesYesYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
16
11/7/2023 4:28:01
I can imagine some kinds of loops that I would be in favor of adding
YesYesNoYesYesNoNononeNoNoYesYesYes
Mandated in the language specification to be expanded at compile time.
17
11/7/2023 6:41:01
I cannot imagine any kind of loop of any kind that I would be in favor of adding
YesYesYesYesYesYesYes-NoNoNoNoYes
boost-style macro-based loops in standard p4 headers
18
11/7/2023 10:20:01
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesNoNo
none come to mind
NoYesNoYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
19
11/7/2023 11:13:39
I can imagine some kinds of loops that I would be in favor of adding
YesNoNoYesYesNoYesn/aYesNoYesNoYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
20
11/7/2023 12:30:39
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesYesn/aYesYesYesYesYes
Mandated in the language specification to be expanded at compile time.
21
11/7/2023 13:21:18
I can imagine some kinds of loops that I would be in favor of adding
YesNoNoNoNoNoNoNoneYesNoNoYesNo
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
22
11/7/2023 13:35:01
I can imagine some kinds of loops that I would be in favor of adding
YesNoNoNoNoNoNoNoneYesNoNoYesNo
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
23
11/7/2023 16:59:28
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesNoNoNoYesnoneYesNoYesNoNo
Mandated in the language specification to be expanded at compile time.
24
11/8/2023 12:22:12
I can imagine some kinds of loops that I would be in favor of adding
YesYesNoNoNoNoNo NoYesNoYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
25
11/13/2023 4:44:03
I can imagine some kinds of loops that I would be in favor of adding
YesNoNoNoNoNoNo
In all cases it depends very much on the proposed solution. This seems to go very much in the "metaprogrammig" cathegory and should be thought through very carefuly. It could replace some uses of preprocessor, which would be good though.
NoNoNoYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
26
11/13/2023 16:12:29
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesYes
Compile-time loops for any table property.
NoNoYesYesYes
Mandated in the language specification to be expanded at compile time.
27
11/21/2023 14:31:13
I can imagine some kinds of loops that I would be in favor of adding
NoNoNoNoNoNoNoN/ANoNoNoNoYes
Mandated that it can be expanded at compile time, but allow the compiler to execute it at runtime if the target supports it.
28
11/27/2023 13:23:23
I can imagine some kinds of loops that I would be in favor of adding
YesYesYesYesYesYesYesnoneYesNoNoYesYes
Allowed in the language specification to be executed during packet processing, or expanded at compile time, or some hybrid such as partial loop unrolling, as C/C++/Java JIT compilers are allowed to do with loops today?
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100