On Sunday, April 3, 2016 at 8:21:46 PM UTC-5, Henrik Lindberg wrote:

In the long run, in general, we want it to be possible to express as 
> much as possible using the Puppet Language itself, and where that is not 
> practical, that it is easy to integrate an implementation (written in 
> c++, ruby, or whatever the logic is best written in for the target). 
>

I have kept my language biases to myself until now, but the implementation 
language(s) for extension point interfaces is a technical question.  If you 
want to use C++ *inside* then that's your call, and I won't judge.  But C++ 
is not well suited for external interfaces, especially if you intend to 
ship binaries instead of relying on users to build from source.  This is 
mostly because C++ has no compile-time encapsulation 
<http://yosefk.com/c++fqa/defective.html#defect-1>, and C++ has no binary 
implementation rules <http://yosefk.com/c++fqa/defective.html#defect-5>.  
If you think you have trouble managing compatibility issues now, just wait 
until you have to deal with third-party plugins implemented against a C++ 
interface -- or better, just avoid that.

I'm inclined to agree that plugins written in the Puppet language itself 
are a good target, and it seems that Ruby plugins are likely to be a fact 
of life for a long time yet.  If you want a lower-level interface as well, 
then you could consider C for that interface.  C can integrate fairly 
easily with your C++ implementation, and it provides for a more stable 
interface.  If you want real-world cases, consider that both Ruby and 
Python choose C over C++ for their native interfaces.

Of course, since we're now talking about the long run, these comments may 
be premature.  Nevertheless, I hope to put this in folks' heads so that 
some thought goes into these choices when the time comes to make them, for 
it's all too easy to just roll ahead with whatever seems natural.


John



John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/b241c647-cc2c-4ca8-bcbe-5839f8ecc65f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to