4 ms·
Pet peeve: when talking about a new programming language in a technical context, show some code! But the super-long page of course doesn't, and neither does th
by unwind 9y ago
Pet peeve: when talking about a new programming language in a technical context, show some code!
But the super-long page of course doesn't, and neither does the Wikipedia page [1]. Also the CODE-tab on the P4 site [2] fails at first glance ... getting frustrating but I bet the site is the right place to dig. Hang on ... Aha, it was on the front page! THANK YOU, P4 web people!
Here's a snippet, then:
table routing {
reads {
ipv4.dstAddr : lpm;
}
actions {
do_drop;
route_ipv4;
}
size: 2048;
}
control ingress {
apply(routing);
}
I don't know anything about large-scale network programming, but at least it's nice to get a hint of the concepts that the language deals with. Makes it more concrete, to me.
1: https://en.wikipedia.org/wiki/P4_(programming_language) https://en.wikipedia.org/wiki/P4_(programming_language)
2: http://p4.org/code/ http://p4.org/code/