io7m-com / cedarbridge

Cedarbridge message protocol specification language
https://www.io7m.com/software/cedarbridge
ISC License
0 stars 0 forks source link

Nested protocols #24

Closed io7m closed 2 years ago

io7m commented 2 years ago

Because protocols are limited to 255 messages, it would be helpful if protocols could be nested (strawman syntax):

[protocol P
  [version 1
    [types-added A B C]]]

[protocol Q
  [version 1
    [types-added D E F]]]

[protocol R
  [version 1
    [protocol P 1]
    [protocol Q 1]]]
io7m commented 2 years ago

R would be encoded as a variant with two cases, one each for P and Q.

io7m commented 2 years ago

This restriction no longer exists for code generation, so there's no need for nested protocols.