Hi,

first I would like to move this topic to the dev list, it seems more appropriate.

Extending the grammar and also the relevant data structures is certainly doable, I have little doubt about this point.

However, experience shows that extending a grammar is usually only the first and usually also among the easier step of the process of extending a DSL-based code generation tool like Thrift. The more complicated (and/or time-consuming) pieces of the puzzle come after that. We need to enrich all code generators to properly support the new grammar features. This part may also involve writing additional code to modify the parsed syntax-tree before its handed over to the generators.

At least to me personally the proposal sounds interesting. Since it seems you already invested some thoughts & time at this, as a first step it would be great to learn more about the general concept you have in mind. Also, sharing some details could help, like what you achieved already, what still needs to be done, etc.

Have fun,

JensG

PS: The technical details how contribution works is explained here: http://thrift.apache.org/docs/HowToContribute


Am 18.03.2022 um 20:39 schrieb Andrew Matheny:
Hello Thrift users,

My company is heavily invested in Thrift and would like to extend the
language to allow for more standardization across all of our APIs.  We are
particularly interested in adding support for generic structs.  For example:

template ListResourcesResponse<Resource> {
   1: optional base.ResponseStatus status;
   2: optional i32 skip;
   3: optional i32 limit;
   4: optional i32 total;
   5: optional list<Resource> results;
}

We have prototyped this by extending the parser we're using but we'd like
to explore what options are available via the community before
committing to a non-standard thrift dialect. My questions to this group
would be:
* Does anyone have any experience with something like this? Either in
generics specifically or in extending the standard grammar.
* What would be the process for updating the Apache maintained grammar to
include an additional feature like this?

Reply via email to