Ashish Sharma | 4 Mar 16:05 2012
Picon

Google Summer of Code 2012

Hello Everyone,

Google has announced its summer of code program for this year. Most of you would know that, as part of this program, Google offers students stipends to write code for chosen open source projects. SWIG has successfully participated in Google Summer of Code (GSoC) in years 2008, and 2009. I, myself, got introduced to SWIG as a student as part of this program in 2009 and since then I have loved using and developing for swig.

So, I would like to take this opportunity to gauge your interest regarding swig's participation in GSoC this year. I would be happy to assit in leading students and/or mentoring a project. And, I am sure many among us would loving doing it. 

Having a sneak at previous year's ideas list, it seems we can pick up few of the undone ideas from the same list and incorporate new ideas to complete the half-finished projects. For fresh ideas we can have features which we feel are important for swig and those which can be completed within program's timeline (around 3 months: May-August).

It would be great to have thoughts/ideas from all of you. 

Ashish
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
SourceForge.net | 6 Mar 09:21 2012
Picon
Picon

[ swig-Bugs-3497393 ] namespace/using breaks shared_ptr typemap

Bugs item #3497393, was opened at 2012-03-06 00:21
Message generated for change (Tracker Item Submitted) made by 
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497393&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Nobody/Anonymous (nobody)
Summary: namespace/using breaks shared_ptr typemap

Initial Comment:
if the 'using std::tr1::shared_ptr;' statement is itself nested in a local namespace, then the
shared_ptr typemap breaks down.  A small isolated version of the problem has been included in a tarball. 
Please see the code there for more details.

This appears to be a rather odd corner case.  However, I managed to spend days confounded by it none the less.  I
didn't find a solution for my project until after reading the boost_shared_ptr.i file.

The offending output when g++ is run on the generated wrapper code is as follows:
example_wrap.cxx: In function ‘PyObject* _wrap_MyObject_create(PyObject*, PyObject*)’:
example_wrap.cxx:3061: error: ‘shared_ptr’ was not declared in this scope
example_wrap.cxx:3061: error: template argument 1 is invalid
example_wrap.cxx:3061: error: expected unqualified-id before ‘>’ token
example_wrap.cxx:3064: error: ‘result’ was not declared in this scope
example_wrap.cxx:3065: error: expected type-specifier before ‘shared_ptr’
example_wrap.cxx:3065: error: expected `)' before ‘shared_ptr’
example_wrap.cxx:3065: error: expected `)' before ‘;’ token

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497393&group_id=1645

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Swig-devel mailing list
Swig-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel
SourceForge.net | 6 Mar 17:39 2012
Picon
Picon

[ swig-Bugs-3497770 ] getting an element

Bugs item #3497770, was opened at 2012-03-06 08:39
Message generated for change (Tracker Item Submitted) made by sbarthelemy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sébastien Barthélémy (sbarthelemy)
Assigned to: Nobody/Anonymous (nobody)
Summary: getting an element 

Initial Comment:
When one wraps a std::vector using std_vector.i, getting an item by index returns a reference to the
element in the vector instead of a copy.
This leads to dandling references if the vector is garbage collected.

For instance, in the following example

in the .i:
class X;
%template(XVector) std::vector<X>;

in the .py

def toto():
    vector = XVector([X(0), X(1))
    element = vector[0]
    return element

myelement = toto()

myelement points to a freed element, thus its value is random.

This example can be found there : https://gist.github.com/1985700


The problem was raised on swig-user too:

http://thread.gmane.org/gmane.comp.programming.swig/18237

http://thread.gmane.org/gmane.comp.programming.swig/18444

http://thread.gmane.org/gmane.comp.programming.swig/18450


The first thread provides a workaround, using a typemap.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Swig-devel mailing list
Swig-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel
SourceForge.net | 6 Mar 17:41 2012
Picon
Picon

[ swig-Bugs-3497770 ] getting an element from a std::vector return a reference

Bugs item #3497770, was opened at 2012-03-06 08:39
Message generated for change (Settings changed) made by sbarthelemy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sébastien Barthélémy (sbarthelemy)
Assigned to: Nobody/Anonymous (nobody)
>Summary: getting an element from a std::vector return a reference

Initial Comment:
When one wraps a std::vector using std_vector.i, getting an item by index returns a reference to the
element in the vector instead of a copy.
This leads to dandling references if the vector is garbage collected.

For instance, in the following example

in the .i:
class X;
%template(XVector) std::vector<X>;

in the .py

def toto():
    vector = XVector([X(0), X(1))
    element = vector[0]
    return element

myelement = toto()

myelement points to a freed element, thus its value is random.

This example can be found there : https://gist.github.com/1985700


The problem was raised on swig-user too:

http://thread.gmane.org/gmane.comp.programming.swig/18237

http://thread.gmane.org/gmane.comp.programming.swig/18444

http://thread.gmane.org/gmane.comp.programming.swig/18450


The first thread provides a workaround, using a typemap.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Swig-devel mailing list
Swig-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel
SourceForge.net | 6 Mar 17:41 2012
Picon
Picon

[ swig-Bugs-3497770 ] getting an element from a std::vector returns a reference

Bugs item #3497770, was opened at 2012-03-06 08:39
Message generated for change (Settings changed) made by sbarthelemy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sébastien Barthélémy (sbarthelemy)
Assigned to: Nobody/Anonymous (nobody)
>Summary: getting an element from a std::vector returns a reference

Initial Comment:
When one wraps a std::vector using std_vector.i, getting an item by index returns a reference to the
element in the vector instead of a copy.
This leads to dandling references if the vector is garbage collected.

For instance, in the following example

in the .i:
class X;
%template(XVector) std::vector<X>;

in the .py

def toto():
    vector = XVector([X(0), X(1))
    element = vector[0]
    return element

myelement = toto()

myelement points to a freed element, thus its value is random.

This example can be found there : https://gist.github.com/1985700


The problem was raised on swig-user too:

http://thread.gmane.org/gmane.comp.programming.swig/18237

http://thread.gmane.org/gmane.comp.programming.swig/18444

http://thread.gmane.org/gmane.comp.programming.swig/18450


The first thread provides a workaround, using a typemap.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3497770&group_id=1645

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Swig-devel mailing list
Swig-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel
Sébastien Barthélémy | 6 Mar 17:42 2012

Re: Ownership of std::vector elements

Hello,

2012/3/5 Sébastien Barthélémy <barthelemy <at> crans.org>:
> [...]
> I could craft a minimalistic example reproducing this behaviour if you wish.

Done, It is there: https://gist.github.com/1985700

> I also found this thread [1] where similar problems are discussed.
> Applying an "out" typemap to force the creation of a new object is
> suggested as a solution, I'll have a look.
> However, I would not like to miss this opportunity to spot a bug in swig.
>
> [1] http://old.nabble.com/Lifetime-of-objects-contained-in-std%3A%3Avector-%28Python%29-td32888422.html

using the typemap from this thread did fix the problem.

Yet, I think this is a bug in swig, I reported as artifact #3497770 [2]

[2] https://sourceforge.net/tracker/?func=detail&aid=3497770&group_id=1645&atid=101645

CC: swig-devel

Cheers

-- Sébastien

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Ashish Sharma | 6 Mar 18:33 2012
Picon

Re: javascript module

Hi Matthias, Oliver,


May I know how far you have gone after the discussion you had on Javascript module with swig?

Ashish

On Wed, Mar 9, 2011 at 6:11 PM, Matthias <nitro <at> dr-code.org> wrote:
Am 09.03.2011, 07:29 Uhr, schrieb Oliver Buchtala <oliver.buchtala <at> jku.at>:

>> Hi Matthias!
>>
>> This is great news! A firebreath work on that would establish a nice
>> clean solution and we would not get hands extra dirty. Also, V8 will
>> definitely be more willing to integrate adaptions in their repo for
>> firebreath than for a small new-comer project - and no monkey patching
>> no more :)
>>
>> There is currently no irc channel I visit on a regular basis. As we
>> develop for swig we could use its channel: #swig-gsoc on
>> irc.freenode.net?

Alright, I'll lurk around there starting now.

>> Two things remaining: we should ask firebreath to do the same with JSC
>> - then we also cover the regular webkit based browsers. Especially I
>> am interested in qt-webkit to be able to integrate with a qt app. The
>> second, of course this solution does not cover the pure standalone
>> thing. But, I can live with that for now as personally I am interested
>> in an integrated solution.
>>
>> I think, this is indeed a good way to go.
>>
>> Bye,
>> Oliver
>
> After reading your mail again (omg - should not work sooo early) I know
> that I did not understand all of it.
> Is it so, that we would write a V8 swig target that generates modules
> that can be bridged to NPAPI and thus be available for all browsers?
> (Then my second comment above is obsolete...)

Exactly. You'd embed V8 in your plugin and then you give your browser's
window/document/whatever javascript objects through firebreath to V8. Then
V8 can manipulate the elements and you should see changes in the dom of
the browser. It would allow to integrate the fast V8 engine into the slow
IE browser (or FF or Safari or Chrome or Opera) :)

So the generated module is always for V8, but since V8 and the browser can
interface it will work. Standalone does also work as it is the base for
this.

One can go even further with this approach and allow to manipulate the
browser's dom via a python engine as well. Just feed the JSObjects to
python and call their methods there etc. I.e. the C++ JS object can be the
"lingua franca" to wrap C++ to arbitrary languages. Of course you'd lose a
lot of the advanced concepts in the C++ -> JS -> python transition
compared to the direct C++ -> Python transition via Swig.

-Matthias

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Swig-devel mailing list
Swig-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-devel

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
William S Fulton | 6 Mar 20:47 2012
Picon

Re: Google Summer of Code 2012

On 04/03/12 15:05, Ashish Sharma wrote:
> Hello Everyone,
>
> Google has announced its summer of code program
> <http://code.google.com/soc/> for this year. Most of you would know
> that, as part of this program, Google offers students stipends to write
> code for chosen open source projects. SWIG has successfully participated
> in Google Summer of Code (GSoC) in years 2008, and 2009. I, myself, got
> introduced to SWIG as a student as part of this program in 2009 and
> since then I have loved using and developing for swig.
>
> So, I would like to take this opportunity to gauge your interest
> regarding swig's participation in GSoC this year. I would be happy to
> assit in leading students and/or mentoring a project. And, I am sure
> many among us would loving doing it.
>
> Having a sneak at previous year's ideas list, it seems we can pick up
> few of the undone ideas from the same list and incorporate new ideas to
> complete the half-finished projects. For fresh ideas we can have
> features which we feel are important for swig and those which can be
> completed within program's timeline (around 3 months: May-August).
>
> It would be great to have thoughts/ideas from all of you.
I'm afraid I'm too busy to get very involved this year, but would 
encourage other interested developers to do so.

William

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
SourceForge.net | 7 Mar 16:44 2012
Picon
Picon

[ swig-Bugs-3498665 ] Python C++ wrapper missing ptrdiff_t defn via <cstddef>

Bugs item #3498665, was opened at 2012-03-07 07:44
Message generated for change (Tracker Item Submitted) made by andybuckley
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3498665&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andy Buckley (andybuckley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python C++ wrapper missing ptrdiff_t defn via <cstddef>

Initial Comment:
Python wrapper source for C++ doesn't compile with GCC 4.6 and higher due to removal of the automatic
include of the cstddef header. The symptom is a compiler error that ptrdiff_t is undefined as a type. This
can be fixed by adding #include <cstddef> to the top of generated C++ wrapper source files.

See e.g. https://www.google.co.uk/search?q=ptrdiff_t+gcc+4.6 for more examples of package affected
by this issue... there didn't seem to be a report for SWIG yet, but several users of our package have
reported compilation problems which were mysterious until we found out about this GCC change.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3498665&group_id=1645

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
SourceForge.net | 7 Mar 16:59 2012
Picon
Picon

[ swig-Bugs-3498665 ] Python C++ wrapper missing ptrdiff_t defn via <cstddef>

Bugs item #3498665, was opened at 2012-03-07 07:44
Message generated for change (Settings changed) made by andybuckley
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3498665&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: python
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Andy Buckley (andybuckley)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python C++ wrapper missing ptrdiff_t defn via <cstddef>

Initial Comment:
Python wrapper source for C++ doesn't compile with GCC 4.6 and higher due to removal of the automatic
include of the cstddef header. The symptom is a compiler error that ptrdiff_t is undefined as a type. This
can be fixed by adding #include <cstddef> to the top of generated C++ wrapper source files.

See e.g. https://www.google.co.uk/search?q=ptrdiff_t+gcc+4.6 for more examples of package affected
by this issue... there didn't seem to be a report for SWIG yet, but several users of our package have
reported compilation problems which were mysterious until we found out about this GCC change.

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

>Comment By: Andy Buckley (andybuckley)
Date: 2012-03-07 07:59

Message:
Damn, I just tested with my own version of SWIG in Ubuntu Oneiric and a
#include <stddef.h> is present: sorry, I only tested for cstddef before. So
I guess I need to talk to the guy who builds our releases about *his*
version of SWIG... sorry for the noise

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3498665&group_id=1645

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

Gmane