You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2014/11/30 11:58:12 UTC

[jira] [Comment Edited] (THRIFT-2835) Add possibility to distribute generators separately from thrift core, and load them dynamically

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

Jens Geyer edited comment on THRIFT-2835 at 11/30/14 10:57 AM:
---------------------------------------------------------------

In general, I like the idea. I would like it even more if the whole thing could be more accessible to generator developers. Although it is doable to add another generator, it is not really a clearly structured, well-described process. This is ok as long as the generators are all internally, but if the intention (which I like) is to make it more open for independent developers, we need more structure, maybe kind of a "generic generator framework" or sort of somehow "customizable" generators and more documentation for this particular stuff. I know that's is slightly outside of the scope here, but these are the things that I absolutely would put on our agenda if we decide to go that way. Again, I like the idea and I see a lot of actual use cases that could be handled much better that way, e.g. ths stuff that is typically handled via annotations today. There are some other generators out there generating different things based on Thrift IDL as input, and there as a reason for it.

{quote}
need to create some installer 
{quote}

@[~hcorg], AFAIK there is already some kind of an [Setup for Windows|https://builds.apache.org/view/All/job/Thrift-Compiler-Windows/lastSuccessfulBuild/artifact/build_mingw32/Apache%20Thrift-1.0.0-win32.exe] platforms. Maybe that could be a starting point?



was (Author: jensg):
In general, I like the idea. I would like it even more if the whole thing could be more accessible to generator developers. Although it is doable to add another generator, it is not really a clearly structured, well-described process. This is ok as long as the generators are all internally, but if the intention (which I like) is to make it more open for independent developers, we need more structure, maybe kind of a "generic generator framework" or sort of somehow "customizable" generators and more documentation for this particular stuff. I know that's is slightly outside of the scope here, but these are the things that I absolutely would put on our agenda if we decide to go that way. Again, I like the idea and I see a lot of actual use cases that could be handled much better that way, e.g. ths stuff that is typically handled via annotations today. There are some other generators out there generating different things based on Thrift IDL as input, and there as a reason for it.

@[~hcorg], AFAIK there is already some kind of an [Setup for Windows|https://builds.apache.org/view/All/job/Thrift-Compiler-Windows/lastSuccessfulBuild/artifact/build_mingw32/Apache%20Thrift-1.0.0-win32.exe] platforms. Maybe that could be a starting point?


> Add possibility to distribute generators separately from thrift core, and load them dynamically
> -----------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2835
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2835
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (General)
>            Reporter: Anatol Pomozov
>              Labels: fbthrift
>
> It is a follow-up for discussion with Facebook's fbthrift https://github.com/facebook/fbthrift/issues/48
> fbthrift adds its own generator that creates C++ classes based on their libraries. I do not know how upstreamable this generator but I think other companies would want to do the same - create their own custom generators.
> Currently there is no way to distribute generators separately from the thrift core. Thus the company have to fork whole project and add their own generator. It is what Facebook did.
> The idea is that thrift should be able to load language generators dynamically. i.e. a company foo creates its own generator and puts it to system /usr/lib/thrift/generators/cpp_foo.so When thrift compiler starts - it checks /usr/lib/thrift/generators/ and uses dlopen() to load the shared libraries. The shared library contains information about the generator (name, options, ...) thus it allows thrift core to use this custom third-party generator.
> This allows companies to create and distribute generator will less pain and no need to fork the project.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)