[
https://issues.apache.org/jira/browse/THRIFT-2835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381212#comment-15381212
]
ASF GitHub Bot commented on THRIFT-2835:
----------------------------------------
Github user nsuke commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1039#discussion_r71078569
--- Diff: compiler/cpp/src/plugin/plugin.thrift ---
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+namespace as3 org.apache.thrift.plugin
+namespace cpp apache.thrift.plugin
+namespace csharp Thrift.Plugin
+namespace d thrift.plugin
+namespace delphi Thrift.Plugin
+namespace go thrift
+namespace haxe org.apache.thrift.plugin
+namespace hs Thrift.Plugin
+namespace java org.apache.thrift.plugin
+namespace ocaml Thrift
+namespace perl Thrift.Plugin
+namespace php thrift.plugin
+namespace py thrift.plugin
+namespace rb Thrift
--- End diff --
`namespace erl` is added after this patch. Would be nice to have it from
the day 1 of this feature.
> 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)