thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy Abernethy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-2464) Transition cpp_type and cpp_include keywords to compiler annotations
Date Thu, 03 Jan 2019 21:17:00 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733529#comment-16733529
] 

Randy Abernethy commented on THRIFT-2464:
-----------------------------------------

I have a different view, it is a feature I use and find elegant and chaos free  !/jira/images/icons/emoticons/smile.png!
.

Clearly if you use an implementation type that is incompatible with the abstract IDL type
or protocol interface you will have problems, just like if you don't eat you will starve,
I don't think we need to police this. To your point, type substitution is not a feature anyone
should reach for at the outset, rather a feature that allows Thrift to easily accommodate
needs related to performance, version changes and customization. Many languages have multiple
IDL-type compatible implementation-types, yet with no specific one being the fastest/best
for all use cases (lists, vectors, ints, boxed ints, hashmaps, treemaps, dictionaries, counters,
etc.). Also new types (especially container types) can show up over time (v1, v2, v3) making
"the best" default hard to specify. This feature also allows custom types to be implemented.
In none of these cases does the impl complexity leak into Thrift, the Thrift IDL types and
wire serialization are unimpacted.

What is a mess is the implementation we have. We have annotations for "final", and Java map
types then these crazy keyword impls for C++. The cpp_* kws predate annotations and should
have been moved over with the introduction of annotations.

I also think we should rigorously reject new Thrift IDL types as they break the world and
spawn huge amounts of work throughout the platform (every lib, every protocol) [I am not a
fan of the self referential types we have half implemented]. In a tool chain used for cross
platform compatibility, changing the IDL type support is the worst thing we can do and should
really only happen when extreme benefits are present. This view makes me that much more interested
in living with the simple and elegant Thrift IDL types yet having the option to choose or
create my own implementations without impacting client or having to modify Thrift at all.

 

 

> Transition cpp_type and cpp_include keywords to compiler annotations
> --------------------------------------------------------------------
>
>                 Key: THRIFT-2464
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2464
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (General)
>    Affects Versions: 0.9.2
>         Environment: C++
>            Reporter: Randy Abernethy
>            Assignee: Randy Abernethy
>            Priority: Minor
>
> The cpp_type and cpp_include keywords provide a useful feature but are language specific.
In keeping with the trend of moving the interface language to a clean cross implementation
language abstraction, these two keywords should be transitioned to annotations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message