{% set rfcid = “RFC-0039” %} {% include “docs/contribute/governance/rfcs/_common/_rfc_header.md” %}
Note: Formerly known as FTP-039.
“You're Go-ing to love it”
When this proposal was drafted, and socialized, there was a strong consensus to consider syntax changes all at once, rather than one at a time (see also RFC-0038). We also wanted one person to be the syntax arbiter, rather than risk designing by committee.
Eventually, this proposal was obsoleted by RFC-0050 which met both conditions sought.
We propose to:
(We stop short of introducing anonymous declarations, since we would likely want improved bindings support to ensure the ergonomics are good.)
Quickly:
Some examples:
Simple struct or table:
struct Name { field int32; }; table Name { 1: field int32; };
Protocols:
protocol Name { Method(arg int32) -> (ret int32); };
Struct with extension:
struct Name { field1 T1; field2 T2; ...; ext table NameExt {}; };
Union variants:
union Name { variant1 table NameVariant1 { ... }; variant2 table NameVariant2 { ... }; ... };
Grouped fields by version:
table Name { 1: v1 struct NameGroupV1 { ... }; 2: v2 struct NameGroupV2 { ... }; ... };
Notes:
This proposal improves ergonomics by conveying ABI implications to developers through syntax.
At least:
This is not source level backwards compatible.
Note: This RFC was rejected early during its socialization phase, which explains the multiple missing sections (e.g. “Implementation strategy”, or “Drawbacks, alternatives, and unknowns”).