C target language...

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

C target language...

Adam Fowler
Hello all,

Are there any plans or anyone working on finishing off the C target language? 

I notice on the list this question is asked every couple of years: https://sourceforge.net/p/swig/mailman/message/32969729/

I see here: https://github.com/swig/swig/tree/gsoc2012-c that the last commit was 2012, and the targeted SWIG version was 2.0.6.

What do people think about the level of effort required for an individual to finish this off and have it working with the latest SWIG v3 release?

I have a burgeoning C++ API that I’ve so far been successfully creating manual C wrappers in. I don’t mind contributing to SWIG as it will help me with my API too.

It appeared from previous posts the remaining effort is mainly around ensuring all the tests pass (and thus all C++ features are covered). How hard do you think it would be to finish off the C target language support?

Thanks in advance.

Best regards,

Adam.

— 

Adam Fowler BSc MBCS

Public Sector Solution Architect, EMEA
MarkLogic Corporation
Phone: +447880358293
Twitter: @adamfowleruk
Skype: adamfowleruk


------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Andrew Haining

Since swig always generates a C intermediate api it should be possible to generate C# for example and then just use the C intermediate directly. I don't imagine it would be too difficult to modify swig to do this but I haven't looked at the code so couldn't say for sure.

Andy.



From: Adam Fowler <[hidden email]>
Sent: 09 September 2016 11:30
To: [hidden email]
Subject: [Swig-user] C target language...
 
Hello all,

Are there any plans or anyone working on finishing off the C target language? 

I notice on the list this question is asked every couple of years: https://sourceforge.net/p/swig/mailman/message/32969729/

I see here: https://github.com/swig/swig/tree/gsoc2012-c that the last commit was 2012, and the targeted SWIG version was 2.0.6.

What do people think about the level of effort required for an individual to finish this off and have it working with the latest SWIG v3 release?

I have a burgeoning C++ API that I’ve so far been successfully creating manual C wrappers in. I don’t mind contributing to SWIG as it will help me with my API too.

It appeared from previous posts the remaining effort is mainly around ensuring all the tests pass (and thus all C++ features are covered). How hard do you think it would be to finish off the C target language support?

Thanks in advance.

Best regards,

Adam.

— 

Adam Fowler BSc MBCS

Public Sector Solution Architect, EMEA
MarkLogic Corporation
Phone: +447880358293
Twitter: @adamfowleruk
Skype: adamfowleruk


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


Digital Barriers e-Mail Confidentiality and Disclaimer This message contains confidential information and is intended only for the individual named. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. Digital Barriers plc is a company registered in England and Wales. Registered number: 7149547. Registered office: Cargo Works, 1-2 Hatfields, London SE1 9PG, United Kingdom. For further information about Digital Barriers, please visit www.digitalbarriers.com.
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Vadim Zeitlin-13
In reply to this post by Adam Fowler
On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:

AF> Are there any plans or anyone working on finishing off the C target language?

 I'd like to have a working C backend a lot and I've made an effort to work
on it myself a few months ago but, unfortunately, got preempted by more
urgent stuff at work and couldn't bring it to a state good enough to even
propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
but also a few (37, after checking right now) commits I hadn't pushed there
yet, I can do it relatively soon if you want to have a look, although I'm
pretty sure it can't be used for anything serious yet.

 FWIW the place I got stuck at was adding shared_ptr<> support, as C
backend is practically useless to me without it, I need to finish this
before justifying spending more time on it.

AF> What do people think about the level of effort required for an
AF> individual to finish this off and have it working with the latest SWIG
AF> v3 release?

 To me it seems quite a lot because there were many questionable things
done in the original version and, of course, many things just have never
been done at all. But I'm still struggling with SWIG internals, even after
all those years working with (fighting against?) it, so maybe it would go
faster for someone who understands it better than me.

AF> I have a burgeoning C++ API that I’ve so far been successfully creating
AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
AF> me with my API too.

 This is exactly why I'm doing this too, yes. But my real end goal is not
only providing C API, but also automatically generating a header-only C++
API on top of it to implement what seems to be called "hourglass interface"
nowadays (although people had been doing this long before this term
appeared in 2014 or so, of course, just called it differently).

AF> It appeared from previous posts the remaining effort is mainly around
AF> ensuring all the tests pass (and thus all C++ features are covered).
AF> How hard do you think it would be to finish off the C target language
AF> support?

 I can look up the exact numbers but there are at least several dozens of
disabled tests right now -- and this is after I've fixed at least as many.

 Regards,
VZ

------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Adam Fowler
Hi VZ,

Thanks for your reply. If you can check in your changes I’d love to take a look. Happily my public API (which is the only part I’m using SWIG for) doesn’t use shared_ptr, so I may be able to test out other parts of the C support that you can’t due to your shared_ptr errors.

If it works, great, if not I’ll log any and all bugs I find. I don’t mind re-enabling tests on my machine and running them, then logging issues for each one. At least that will give us an idea of the level of effort.

My C++ API is designed to show the minimal amount of dependencies in the public API, so it’s not been too hard to generate other language bindings for. Might be a good test of the C support.

There’s no great urgency for me testing this, but when you do check in your commits please let me know.

Best regards,

Adam.



Adam Fowler BSc MBCS

Public Sector Solution Architect, EMEA
MarkLogic Corporation
Phone: +447880358293
Blog: http://adamfowlerml.wordpress.com/ 
Twitter: @adamfowleruk
Skype: adamfowleruk









On 12/09/2016 12:30, "Vadim Zeitlin" <[hidden email]> wrote:

On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:

AF> Are there any plans or anyone working on finishing off the C target language?

 I'd like to have a working C backend a lot and I've made an effort to work
on it myself a few months ago but, unfortunately, got preempted by more
urgent stuff at work and couldn't bring it to a state good enough to even
propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
but also a few (37, after checking right now) commits I hadn't pushed there
yet, I can do it relatively soon if you want to have a look, although I'm
pretty sure it can't be used for anything serious yet.

 FWIW the place I got stuck at was adding shared_ptr<> support, as C
backend is practically useless to me without it, I need to finish this
before justifying spending more time on it.

AF> What do people think about the level of effort required for an
AF> individual to finish this off and have it working with the latest SWIG
AF> v3 release?

 To me it seems quite a lot because there were many questionable things
done in the original version and, of course, many things just have never
been done at all. But I'm still struggling with SWIG internals, even after
all those years working with (fighting against?) it, so maybe it would go
faster for someone who understands it better than me.

AF> I have a burgeoning C++ API that I’ve so far been successfully creating
AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
AF> me with my API too.

 This is exactly why I'm doing this too, yes. But my real end goal is not
only providing C API, but also automatically generating a header-only C++
API on top of it to implement what seems to be called "hourglass interface"
nowadays (although people had been doing this long before this term
appeared in 2014 or so, of course, just called it differently).

AF> It appeared from previous posts the remaining effort is mainly around
AF> ensuring all the tests pass (and thus all C++ features are covered).
AF> How hard do you think it would be to finish off the C target language
AF> support?

 I can look up the exact numbers but there are at least several dozens of
disabled tests right now -- and this is after I've fixed at least as many.

 Regards,
VZ

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

William S Fulton
I'd like to see this C 'target language' finished too for merging into
the mainline SWIG. For this to happen, all (or posssibly just a large
majority) of the tests need to pass. Things like the shared_ptr
support need not be fully working, but as we have a comprehensive set
of tests in the test-suite, we can judge how good the overall support
is by the state of the test-suite. There is no need to log any bugs
until it has been merged to master, as we only really want to track
bugs for largely incomplete work (there'd be too many).

If you are really keen to get this into SWIG proper, then let me know
and you can develop it further in the SWIG repo in a branch for
tracking by the SWIG developers.

William

On 12 September 2016 at 12:40, Adam Fowler <[hidden email]> wrote:

> Hi VZ,
>
> Thanks for your reply. If you can check in your changes I’d love to take a look. Happily my public API (which is the only part I’m using SWIG for) doesn’t use shared_ptr, so I may be able to test out other parts of the C support that you can’t due to your shared_ptr errors.
>
> If it works, great, if not I’ll log any and all bugs I find. I don’t mind re-enabling tests on my machine and running them, then logging issues for each one. At least that will give us an idea of the level of effort.
>
> My C++ API is designed to show the minimal amount of dependencies in the public API, so it’s not been too hard to generate other language bindings for. Might be a good test of the C support.
>
> There’s no great urgency for me testing this, but when you do check in your commits please let me know.
>
> Best regards,
>
> Adam.
>
> —
>
> Adam Fowler BSc MBCS
>
> Public Sector Solution Architect, EMEA
> MarkLogic Corporation
> Phone: +447880358293
> Blog: http://adamfowlerml.wordpress.com/
> Twitter: @adamfowleruk
> Skype: adamfowleruk
>
>
>
>
>
>
>
>
>
> On 12/09/2016 12:30, "Vadim Zeitlin" <[hidden email]> wrote:
>
> On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:
>
> AF> Are there any plans or anyone working on finishing off the C target language?
>
>  I'd like to have a working C backend a lot and I've made an effort to work
> on it myself a few months ago but, unfortunately, got preempted by more
> urgent stuff at work and couldn't bring it to a state good enough to even
> propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
> but also a few (37, after checking right now) commits I hadn't pushed there
> yet, I can do it relatively soon if you want to have a look, although I'm
> pretty sure it can't be used for anything serious yet.
>
>  FWIW the place I got stuck at was adding shared_ptr<> support, as C
> backend is practically useless to me without it, I need to finish this
> before justifying spending more time on it.
>
> AF> What do people think about the level of effort required for an
> AF> individual to finish this off and have it working with the latest SWIG
> AF> v3 release?
>
>  To me it seems quite a lot because there were many questionable things
> done in the original version and, of course, many things just have never
> been done at all. But I'm still struggling with SWIG internals, even after
> all those years working with (fighting against?) it, so maybe it would go
> faster for someone who understands it better than me.
>
> AF> I have a burgeoning C++ API that I’ve so far been successfully creating
> AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
> AF> me with my API too.
>
>  This is exactly why I'm doing this too, yes. But my real end goal is not
> only providing C API, but also automatically generating a header-only C++
> API on top of it to implement what seems to be called "hourglass interface"
> nowadays (although people had been doing this long before this term
> appeared in 2014 or so, of course, just called it differently).
>
> AF> It appeared from previous posts the remaining effort is mainly around
> AF> ensuring all the tests pass (and thus all C++ features are covered).
> AF> How hard do you think it would be to finish off the C target language
> AF> support?
>
>  I can look up the exact numbers but there are at least several dozens of
> disabled tests right now -- and this is after I've fixed at least as many.
>
>  Regards,
> VZ
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Swig-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/swig-user

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

William S Fulton
In reply to this post by Adam Fowler
I'd like to see this C 'target language' finished too for merging into
the mainline SWIG. For this to happen, all (or posssibly just a large
majority) of the tests need to pass. Things like the shared_ptr
support need not be fully working, but as we have a comprehensive set
of tests in the test-suite, we can judge how good the overall support
is by the state of the test-suite. There is no need to log any bugs
until it has been merged to master, as we only really want to track
bugs for largely incomplete work (there'd be too many).

If you are really keen to get this into SWIG proper, then let me know
and you can develop it further in the SWIG repo in a branch for
tracking by the SWIG developers.

William

On 12 September 2016 at 12:40, Adam Fowler <[hidden email]> wrote:

> Hi VZ,
>
> Thanks for your reply. If you can check in your changes I’d love to take a look. Happily my public API (which is the only part I’m using SWIG for) doesn’t use shared_ptr, so I may be able to test out other parts of the C support that you can’t due to your shared_ptr errors.
>
> If it works, great, if not I’ll log any and all bugs I find. I don’t mind re-enabling tests on my machine and running them, then logging issues for each one. At least that will give us an idea of the level of effort.
>
> My C++ API is designed to show the minimal amount of dependencies in the public API, so it’s not been too hard to generate other language bindings for. Might be a good test of the C support.
>
> There’s no great urgency for me testing this, but when you do check in your commits please let me know.
>
> Best regards,
>
> Adam.
>
> —
>
> Adam Fowler BSc MBCS
>
> Public Sector Solution Architect, EMEA
> MarkLogic Corporation
> Phone: +447880358293
> Blog: http://adamfowlerml.wordpress.com/
> Twitter: @adamfowleruk
> Skype: adamfowleruk
>
>
>
>
>
>
>
>
>
> On 12/09/2016 12:30, "Vadim Zeitlin" <[hidden email]> wrote:
>
> On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:
>
> AF> Are there any plans or anyone working on finishing off the C target language?
>
>  I'd like to have a working C backend a lot and I've made an effort to work
> on it myself a few months ago but, unfortunately, got preempted by more
> urgent stuff at work and couldn't bring it to a state good enough to even
> propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
> but also a few (37, after checking right now) commits I hadn't pushed there
> yet, I can do it relatively soon if you want to have a look, although I'm
> pretty sure it can't be used for anything serious yet.
>
>  FWIW the place I got stuck at was adding shared_ptr<> support, as C
> backend is practically useless to me without it, I need to finish this
> before justifying spending more time on it.
>
> AF> What do people think about the level of effort required for an
> AF> individual to finish this off and have it working with the latest SWIG
> AF> v3 release?
>
>  To me it seems quite a lot because there were many questionable things
> done in the original version and, of course, many things just have never
> been done at all. But I'm still struggling with SWIG internals, even after
> all those years working with (fighting against?) it, so maybe it would go
> faster for someone who understands it better than me.
>
> AF> I have a burgeoning C++ API that I’ve so far been successfully creating
> AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
> AF> me with my API too.
>
>  This is exactly why I'm doing this too, yes. But my real end goal is not
> only providing C API, but also automatically generating a header-only C++
> API on top of it to implement what seems to be called "hourglass interface"
> nowadays (although people had been doing this long before this term
> appeared in 2014 or so, of course, just called it differently).
>
> AF> It appeared from previous posts the remaining effort is mainly around
> AF> ensuring all the tests pass (and thus all C++ features are covered).
> AF> How hard do you think it would be to finish off the C target language
> AF> support?
>
>  I can look up the exact numbers but there are at least several dozens of
> disabled tests right now -- and this is after I've fixed at least as many.
>
>  Regards,
> VZ
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Swig-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/swig-user

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Adam Fowler
In reply to this post by William S Fulton
Hi William,

I would be very interested to get this working. Please let me know what branch you think I should use as a base and I’ll take a look over the next month.

Best regards,

Adam.



Adam Fowler BSc MBCS

Public Sector Solution Architect, EMEA
MarkLogic Corporation
Phone: +447880358293
Blog: http://adamfowlerml.wordpress.com/ 
Twitter: @adamfowleruk
Skype: adamfowleruk









On 13/09/2016 19:54, "[hidden email] on behalf of William S Fulton" <[hidden email] on behalf of [hidden email]> wrote:

I'd like to see this C 'target language' finished too for merging into
the mainline SWIG. For this to happen, all (or posssibly just a large
majority) of the tests need to pass. Things like the shared_ptr
support need not be fully working, but as we have a comprehensive set
of tests in the test-suite, we can judge how good the overall support
is by the state of the test-suite. There is no need to log any bugs
until it has been merged to master, as we only really want to track
bugs for largely incomplete work (there'd be too many).

If you are really keen to get this into SWIG proper, then let me know
and you can develop it further in the SWIG repo in a branch for
tracking by the SWIG developers.

William

On 12 September 2016 at 12:40, Adam Fowler <[hidden email]> wrote:

> Hi VZ,
>
> Thanks for your reply. If you can check in your changes I’d love to take a look. Happily my public API (which is the only part I’m using SWIG for) doesn’t use shared_ptr, so I may be able to test out other parts of the C support that you can’t due to your shared_ptr errors.
>
> If it works, great, if not I’ll log any and all bugs I find. I don’t mind re-enabling tests on my machine and running them, then logging issues for each one. At least that will give us an idea of the level of effort.
>
> My C++ API is designed to show the minimal amount of dependencies in the public API, so it’s not been too hard to generate other language bindings for. Might be a good test of the C support.
>
> There’s no great urgency for me testing this, but when you do check in your commits please let me know.
>
> Best regards,
>
> Adam.
>
> —
>
> Adam Fowler BSc MBCS
>
> Public Sector Solution Architect, EMEA
> MarkLogic Corporation
> Phone: +447880358293
> Blog: http://adamfowlerml.wordpress.com/
> Twitter: @adamfowleruk
> Skype: adamfowleruk
>
>
>
>
>
>
>
>
>
> On 12/09/2016 12:30, "Vadim Zeitlin" <[hidden email]> wrote:
>
> On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:
>
> AF> Are there any plans or anyone working on finishing off the C target language?
>
>  I'd like to have a working C backend a lot and I've made an effort to work
> on it myself a few months ago but, unfortunately, got preempted by more
> urgent stuff at work and couldn't bring it to a state good enough to even
> propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
> but also a few (37, after checking right now) commits I hadn't pushed there
> yet, I can do it relatively soon if you want to have a look, although I'm
> pretty sure it can't be used for anything serious yet.
>
>  FWIW the place I got stuck at was adding shared_ptr<> support, as C
> backend is practically useless to me without it, I need to finish this
> before justifying spending more time on it.
>
> AF> What do people think about the level of effort required for an
> AF> individual to finish this off and have it working with the latest SWIG
> AF> v3 release?
>
>  To me it seems quite a lot because there were many questionable things
> done in the original version and, of course, many things just have never
> been done at all. But I'm still struggling with SWIG internals, even after
> all those years working with (fighting against?) it, so maybe it would go
> faster for someone who understands it better than me.
>
> AF> I have a burgeoning C++ API that I’ve so far been successfully creating
> AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
> AF> me with my API too.
>
>  This is exactly why I'm doing this too, yes. But my real end goal is not
> only providing C API, but also automatically generating a header-only C++
> API on top of it to implement what seems to be called "hourglass interface"
> nowadays (although people had been doing this long before this term
> appeared in 2014 or so, of course, just called it differently).
>
> AF> It appeared from previous posts the remaining effort is mainly around
> AF> ensuring all the tests pass (and thus all C++ features are covered).
> AF> How hard do you think it would be to finish off the C target language
> AF> support?
>
>  I can look up the exact numbers but there are at least several dozens of
> disabled tests right now -- and this is after I've fixed at least as many.
>
>  Regards,
> VZ
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Swig-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/swig-user

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

William S Fulton
Excellent. I'd start with Vadim's branch he mentioned as well as his
pending commits (once they are pushed).

William

On 13 September 2016 at 23:10, Adam Fowler <[hidden email]> wrote:

> Hi William,
>
> I would be very interested to get this working. Please let me know what branch you think I should use as a base and I’ll take a look over the next month.
>
> Best regards,
>
> Adam.
>
> —
>
> Adam Fowler BSc MBCS
>
> Public Sector Solution Architect, EMEA
> MarkLogic Corporation
> Phone: +447880358293
> Blog: http://adamfowlerml.wordpress.com/
> Twitter: @adamfowleruk
> Skype: adamfowleruk
>
>
>
>
>
>
>
>
>
> On 13/09/2016 19:54, "[hidden email] on behalf of William S Fulton" <[hidden email] on behalf of [hidden email]> wrote:
>
> I'd like to see this C 'target language' finished too for merging into
> the mainline SWIG. For this to happen, all (or posssibly just a large
> majority) of the tests need to pass. Things like the shared_ptr
> support need not be fully working, but as we have a comprehensive set
> of tests in the test-suite, we can judge how good the overall support
> is by the state of the test-suite. There is no need to log any bugs
> until it has been merged to master, as we only really want to track
> bugs for largely incomplete work (there'd be too many).
>
> If you are really keen to get this into SWIG proper, then let me know
> and you can develop it further in the SWIG repo in a branch for
> tracking by the SWIG developers.
>
> William
>
> On 12 September 2016 at 12:40, Adam Fowler <[hidden email]> wrote:
>> Hi VZ,
>>
>> Thanks for your reply. If you can check in your changes I’d love to take a look. Happily my public API (which is the only part I’m using SWIG for) doesn’t use shared_ptr, so I may be able to test out other parts of the C support that you can’t due to your shared_ptr errors.
>>
>> If it works, great, if not I’ll log any and all bugs I find. I don’t mind re-enabling tests on my machine and running them, then logging issues for each one. At least that will give us an idea of the level of effort.
>>
>> My C++ API is designed to show the minimal amount of dependencies in the public API, so it’s not been too hard to generate other language bindings for. Might be a good test of the C support.
>>
>> There’s no great urgency for me testing this, but when you do check in your commits please let me know.
>>
>> Best regards,
>>
>> Adam.
>>
>> —
>>
>> Adam Fowler BSc MBCS
>>
>> Public Sector Solution Architect, EMEA
>> MarkLogic Corporation
>> Phone: +447880358293
>> Blog: http://adamfowlerml.wordpress.com/
>> Twitter: @adamfowleruk
>> Skype: adamfowleruk
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 12/09/2016 12:30, "Vadim Zeitlin" <[hidden email]> wrote:
>>
>> On Fri, 9 Sep 2016 10:30:31 +0000 Adam Fowler <[hidden email]> wrote:
>>
>> AF> Are there any plans or anyone working on finishing off the C target language?
>>
>>  I'd like to have a working C backend a lot and I've made an effort to work
>> on it myself a few months ago but, unfortunately, got preempted by more
>> urgent stuff at work and couldn't bring it to a state good enough to even
>> propose the merge. I have some changes at https://github.com/vadz/swig/tree/C
>> but also a few (37, after checking right now) commits I hadn't pushed there
>> yet, I can do it relatively soon if you want to have a look, although I'm
>> pretty sure it can't be used for anything serious yet.
>>
>>  FWIW the place I got stuck at was adding shared_ptr<> support, as C
>> backend is practically useless to me without it, I need to finish this
>> before justifying spending more time on it.
>>
>> AF> What do people think about the level of effort required for an
>> AF> individual to finish this off and have it working with the latest SWIG
>> AF> v3 release?
>>
>>  To me it seems quite a lot because there were many questionable things
>> done in the original version and, of course, many things just have never
>> been done at all. But I'm still struggling with SWIG internals, even after
>> all those years working with (fighting against?) it, so maybe it would go
>> faster for someone who understands it better than me.
>>
>> AF> I have a burgeoning C++ API that I’ve so far been successfully creating
>> AF> manual C wrappers in. I don’t mind contributing to SWIG as it will help
>> AF> me with my API too.
>>
>>  This is exactly why I'm doing this too, yes. But my real end goal is not
>> only providing C API, but also automatically generating a header-only C++
>> API on top of it to implement what seems to be called "hourglass interface"
>> nowadays (although people had been doing this long before this term
>> appeared in 2014 or so, of course, just called it differently).
>>
>> AF> It appeared from previous posts the remaining effort is mainly around
>> AF> ensuring all the tests pass (and thus all C++ features are covered).
>> AF> How hard do you think it would be to finish off the C target language
>> AF> support?
>>
>>  I can look up the exact numbers but there are at least several dozens of
>> disabled tests right now -- and this is after I've fixed at least as many.
>>
>>  Regards,
>> VZ
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Swig-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/swig-user
>

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Vadim Zeitlin-13
In reply to this post by William S Fulton
On Tue, 13 Sep 2016 19:54:39 +0100 William S Fulton <[hidden email]> wrote:

WSF> For this to happen, all (or posssibly just a large
WSF> majority) of the tests need to pass.

 So I checked and currently there are (only!) 73 failing tests... Of
course, not all the remaining ones have the corresponding run tests, so
there could be some problems in the passing tests as well.

 I'll try to find time to merge my branch with the latest master and push
it to Github soon, hopefully we can parallelize future work on it then.

 Regards,
VZ

------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Adam Fowler
Sounds great, thanks!

Best regards,

Adam.



Adam Fowler BSc MBCS

Public Sector Solution Architect, EMEA
MarkLogic Corporation
Phone: +447880358293
Blog: http://adamfowlerml.wordpress.com/ 
Twitter: @adamfowleruk
Skype: adamfowleruk









On 14/09/2016 00:50, "Vadim Zeitlin" <[hidden email]> wrote:

On Tue, 13 Sep 2016 19:54:39 +0100 William S Fulton <[hidden email]> wrote:

WSF> For this to happen, all (or posssibly just a large
WSF> majority) of the tests need to pass.

 So I checked and currently there are (only!) 73 failing tests... Of
course, not all the remaining ones have the corresponding run tests, so
there could be some problems in the passing tests as well.

 I'll try to find time to merge my branch with the latest master and push
it to Github soon, hopefully we can parallelize future work on it then.

 Regards,
VZ

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

Vadim Zeitlin-13
In reply to this post by Vadim Zeitlin-13
On Wed, 14 Sep 2016 01:50:08 +0200 I wrote:

Me>  I'll try to find time to merge my branch with the latest master and push
Me> it to Github soon, hopefully we can parallelize future work on it then.

 I've now merged the latest master into this branch, fixed a new test
failure this resulted in and pushed to https://github.com/vadz/swig/
Running the test suite currently gives:

        % make check-c-test-suite ECHO_PROGRESS=:
        checking c test-suite
        435 c tests passed

 Of course, there are still ~80 more that do not pass.

 William, any hints about implementing shared pointer support for C backend
would be more than welcome.

 TIA,
VZ

------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C target language...

William S Fulton
On 15 September 2016 at 00:48, Vadim Zeitlin <[hidden email]> wrote:
>
>  William, any hints about implementing shared pointer support for C backend
> would be more than welcome.
>
I don't think this needs to work too differently to the other language
modules What happens is instead of using a raw pointer T, a
std::shared_ptr<T> pointer is used instead. This happens for all usage
of a type T including parsing a raw pointer (T *), reference (T &),
and value (T). The typemaps in a few languages are already available
for this and can be adapted to C. Probably an opaque pointer typedef
is required in the C API as std::shared_ptr<T>* is not valid extern
"C" due to usage of templates. A C user would still need to manually
manage memory as they would for any other wrapped type, but using the
shared_ptr pointer instead of the raw pointer. But whenever a
shared_ptr pointer is deleted, it will ultimately call the shared_ptr
destructor which may or may not delete the underlying object,
depending on the reference count. That's okay though.

William

------------------------------------------------------------------------------
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...