← Back to team overview

coapp-developers team mailing list archive

Re: Code?

 

If you want to go the Swig route, Swig also works on C. In fact it works
better, with less gotchas/issues. Swig wouldn't even be totally necessary.
This is because C truly is the least common denominator when it comes to
language binding, almost every mainstream language can call directly into C
shared libraries without much of any boilerplate code (see P/Invoke in .NET
or ctypes in Python for example).

But isn't (at least) the first revision of the engine core being written in
C#/.NET? At this point it seems highly likely that the GUI frontend will be
written in C# using the Windows Presentation Foundation (WPF).

Jonathan

On Mon, May 17, 2010 at 8:49 PM, Garrett Serack <garretts@xxxxxxxxxxxxx>wrote:

> I don’t think we can do C++ and only bind to MSVCRT; hence C being the
> selected language.
>
>
>
> Plus, I think it’s a good idea to keep it lowest-common-denominator.  :D
>
>
>
> G
>
>
>
> *From:* coapp-developers-bounces+garretts=microsoft.com@
> lists.launchpad.net [mailto:coapp-developers-bounces+garretts<coapp-developers-bounces%2Bgarretts>
> =microsoft.com@xxxxxxxxxxxxxxxxxxx] *On Behalf Of *Trevor Dennis
> *Sent:* Monday, May 17, 2010 4:43 PM
> *To:* Elizabeth M Smith
> *Cc:* coapp-developers@xxxxxxxxxxxxxxxxxxx
>
> *Subject:* Re: [Coapp-developers] Code?
>
>
>
>
>
> On Mon, May 17, 2010 at 5:38 PM, Elizabeth M Smith <
> emsmith@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> On 5/17/2010 7:36 PM, Olaf van der Spek wrote:
>
> On Tue, May 18, 2010 at 1:23 AM, Elizabeth M Smith
> <emsmith@xxxxxxxxxxxxxxxxxxxxxxx>  wrote:
>
>
> As we discussed during the summit and is mentioned on the wiki:
>
>
> Ah, found it.
>
>
>
> Few dependencies
> Fast
> Small
> Binding facilities for most high level languages are common
>
> The ability to tie a C library into anything and everything is the biggest
> reason to use C over C++, using and binding to C++ libraries (especially in
> most languages - they tend to be written in C) is a real headache -
> actually
> beyond a headache, most times it's just a recipe for failure.
>
>
> C++ can do C bindings as well, can't it? Our bindings should certainly be
> C.
> Doesn't C++ share the other advantages?
>
> Olaf
>
>
> What?  I mean binding coapp to other higher level languages primarily
> written in C.  Perl, Python, PHP, Lua, D etc.
>
> and if we write it in C - yes a C++ binding would be easy as well.
>
> Thanks,
> Elizabeth Smith
>
>
>
> In case Olaf means writing the library in C++ itself instead of C, only
> functions defined outside of a class can
> be defined with a C binding.  As soon as it's in a class it must use C++
> bindings and all the name
> mangling takes effect.  Once that happens, connecting to the classes from
> the other languages is
> almost impossible.
>
> I've seen people try to to create bindings to a C++ library and it usually
> involves writing a middle C layer between the
> other apps and the C++ library.  No point in doing that if we can just
> write it in C in the first place.
>
> --
>
> Trevor Dennis
>
> _______________________________________________
> Mailing list: https://launchpad.net/~coapp-developers<https://launchpad.net/%7Ecoapp-developers>
> Post to     : coapp-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~coapp-developers<https://launchpad.net/%7Ecoapp-developers>
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References