[P4-dev] Suggestion: Adding sizeof

hemant at mnkcg.com hemant at mnkcg.com
Tue Feb 5 14:48:39 EST 2019


Yesterday, I looked for the meeting minutes but only looked at the bottom of the page and didn’t find the minutes.   Now, I looked at the right pane and found the minutes.  Sounds like a plan.  

 

We can add comments to the Github issue and let’s try to finalize what to use for C-like sizeof().  Then I would vote for a pull request (PR) to change p4c.  Once the changes pass unit testing, we can issue a PR to change the P4-16 spec.

 

Thanks,

 

Hemant

 

From: Nate Foster <jnfoster at cs.cornell.edu> 
Sent: Tuesday, February 05, 2019 2:39 PM
To: hemant at mnkcg.com
Cc: Kamila Součková <kamila at ksp.sk>; p4-dev <p4-dev at lists.p4.org>
Subject: Re: [P4-dev] Suggestion: Adding sizeof

 

Please see the LDWG minutes from yesterday. We planned a meeting for 2/25, if there are new topics to discuss. 

 

The process we've agreed on for moving designs forward is to either participate in the conversation on GitHub issues and/or author pull requests to the p4-spec and/or p4c...

 

-N

 

On Tue, Feb 5, 2019 at 2:33 PM <hemant at mnkcg.com <mailto:hemant at mnkcg.com> > wrote:

Maybe, we can schedule an earlier LDWG meeting before March 4th to hash out the final decision (sizeof, size(), etc.).  Then, one can implement the changes to p4c. 

 

Thanks,

 

Hemant

 

From: P4-dev <p4-dev-bounces at lists.p4.org <mailto:p4-dev-bounces at lists.p4.org> > On Behalf Of Kamila Soucková
Sent: Tuesday, February 05, 2019 2:28 PM
To: Nate Foster <jnfoster at cs.cornell.edu <mailto:jnfoster at cs.cornell.edu> >
Cc: p4-dev <p4-dev at lists.p4.org <mailto:p4-dev at lists.p4.org> >
Subject: Re: [P4-dev] Suggestion: Adding sizeof

 

Hi,

 

thanks a lot for the pointer! I'm glad it's being considered. Yay!

 

Best,

Kamila

 

On Tue, Feb 5, 2019 at 8:23 PM Nate Foster <jnfoster at cs.cornell.edu <mailto:jnfoster at cs.cornell.edu> > wrote:

Hi Kamila,

 

This is being actively discussed by the LDWG. If you have thoughts, please weigh in here https://github.com/p4lang/p4-spec/issues/660

 

-N

 

On Tue, Feb 5, 2019 at 2:18 PM Kamila Součková <kamila at ksp.sk <mailto:kamila at ksp.sk> > wrote:

Hello,

 

While P4's lack of void* all over the place makes the sizeof() operator known from C not absolutely necessary, I believe it could still be useful to have it. For example, the protocol I am currently parsing likes to specify offsets and align things to 8 bytes. Therefore I am finding myself writing a lot of header definitions followed by `const int my_header_size = ...`. This feels very wrong to me. Unless I am the only person in the world who needs that, I think adding sizeof() to the language in some future version might be useful.

 

Thanks, and best wishes,

Kamila

_______________________________________________
P4-dev mailing list
P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org> 
http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20190205/158f351a/attachment.html>


More information about the P4-dev mailing list