Discussion:
[boost] [BB++] Now fixes all of your memory leak nightmares
Phil Bouchard via Boost
2017-07-22 04:15:07 UTC
Permalink
Greetings,

Now I have an example showing off the cyclic reference handling. Please see:
https://github.com/philippeb8/root_ptr/blob/bb++/bbpp2cpp/tests/input2.bb


This program correctly outputs:

Document::Document(const boost::node_proxy&)
auto __0(boost::node_proxy&, int)
1
Document::Document(const boost::node_proxy&)
Document::~Document()
2
Document::~Document()


So I just came to realize we could use this tool to parse entire
projects to generate the right C++ code, after having disabled the
'operator delete', and then run the executable, which still is 3.5x
faster than Node.JS. For the newcomer please see:
https://github.com/philippeb8/root_ptr/tree/bb++/bbpp2cpp

I am going to present this to NASA and company. Meanwhile anybody is
welcome to help me out extending the parser to support template syntaxes.


Regards,
-Phil
http://bbplusplus.com/


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Domen Vrankar via Boost
2017-07-22 08:20:28 UTC
Permalink
Post by Phil Bouchard via Boost
Greetings,
https://github.com/philippeb8/root_ptr/blob/bb++/bbpp2cpp/tests/input2.bb
Document::Document(const boost::node_proxy&)
auto __0(boost::node_proxy&, int)
1
Document::Document(const boost::node_proxy&)
Document::~Document()
2
Document::~Document()
So I just came to realize we could use this tool to parse entire projects
to generate the right C++ code, after having disabled the 'operator
delete', and then run the executable, which still is 3.5x faster than
https://github.com/philippeb8/root_ptr/tree/bb++/bbpp2cpp
Just a quick question... Extending a language etc. just to compete with
Node.JS seems like an overkill to me so I was wondering how your solution
compares to this:

https://github.com/hsutter/gcpp


Regards,
Domen

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Phil Bouchard via Boost
2017-07-22 15:36:54 UTC
Permalink
Post by Domen Vrankar via Boost
Just a quick question... Extending a language etc. just to compete with
Node.JS seems like an overkill to me so I was wondering how your solution
https://github.com/hsutter/gcpp
http://youtu.be/JfmTagWcqoE
Originally my goal was to compete with Node.JS but then I realized BB++
could be used to parse entire C++ projects to fix all memory leaks.

I didn't see the whole presentation but I read the documentation in
diagonal and it seems deferred_ptr is slower than shared_ptr and is
single threaded only; you also need to add heaps explicitly.

root_ptr is the exact opposite: it is faster than shared_ptr, is
multithreaded and it uses the same user-defined allocator. That's why I
am able to write a parser; because root_ptr uses the same pattern.

Thus deferred_ptr is far from being production-quality whereas root_ptr
is already a step behind. I just need to add some metadata in the parser
to generated classes, support templates in the parser and perhaps try to
remove the 'mutable qualifier' in root_ptr.


Thanks,
-Phil


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Vinnie Falco via Boost
2017-07-22 15:41:05 UTC
Permalink
On Sat, Jul 22, 2017 at 8:36 AM, Phil Bouchard via Boost
Post by Domen Vrankar via Boost
https://github.com/hsutter/gcpp
http://youtu.be/JfmTagWcqoE
Phil do you have any of your own presentations on YouTube that I might
watch? Or if not, have you considered creating one? That would
probably go a long way towards helping understand the foundations and
usage of your library.

It doesn't have to be an hour, it could be 15 minutes like this one:


Thanks

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Phil Bouchard via Boost
2017-07-22 15:56:20 UTC
Permalink
Post by Vinnie Falco via Boost
On Sat, Jul 22, 2017 at 8:36 AM, Phil Bouchard via Boost
Post by Domen Vrankar via Boost
https://github.com/hsutter/gcpp
http://youtu.be/JfmTagWcqoE
Phil do you have any of your own presentations on YouTube that I might
watch? Or if not, have you considered creating one? That would
probably go a long way towards helping understand the foundations and
usage of your library.
http://youtu.be/uJZgRcvPFwI
I will but I just spent the last 2 weeks debugging and improving the
core of BB++. The time delay of my post from yesterday is just 5 minutes
after I was done with the example on cyclic references ;)

For those who want to see more clearly the generated C++ code can run:
$ indent tmp.cpp -l1000


Thanks,
-Phil


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Phil Bouchard via Boost
2017-07-24 03:42:04 UTC
Permalink
Post by Phil Bouchard via Boost
Greetings,
https://github.com/philippeb8/root_ptr/blob/bb++/bbpp2cpp/tests/input2.bb
Document::Document(const boost::node_proxy&)
auto __0(boost::node_proxy&, int)
1
Document::Document(const boost::node_proxy&)
Document::~Document()
2
Document::~Document()
I just fixed an important bug where the node_proxies were passed by
value because of the variadic template arguments misuse; now they are
passed by reference in the 'make_*' factory.

Furthermore you can see by yourselves the following code example works
perfectly fine now:

class Document
{
auto head = nullptr<Document>();
auto tail = nullptr<Document>();

Document() { cout << __PRETTY_FUNCTION__ << endl; }
~Document() { cout << __PRETTY_FUNCTION__ << endl; }

auto foo = function (int argument) { cout << __PRETTY_FUNCTION__ <<
endl; return argument; };
};

int main()
{
auto temporary = 1;

auto document = new Document();
document.foo(temporary);

auto bar = function ()
{
auto document = new Document();

// cycle
document.head = document;

return document;
};

cout << 1 << endl;
auto result = bar().foo(temporary);
cout << 2 << endl;
}


Correctly outputs:

Document::Document(const boost::node_proxy&)
auto __lambda0(boost::node_proxy&, int)
1
Document::Document(const boost::node_proxy&)
auto __lambda0(boost::node_proxy&, int)
2
Document::~Document()
Document::~Document()


Thank you,
-Phil



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Gottlob Frege via Boost
2017-07-24 14:59:21 UTC
Permalink
Is your parser based on clang tools, or are you writing it from scratch?

On Sat, Jul 22, 2017 at 12:15 AM, Phil Bouchard via Boost
Post by Phil Bouchard via Boost
Greetings,
https://github.com/philippeb8/root_ptr/blob/bb++/bbpp2cpp/tests/input2.bb
Document::Document(const boost::node_proxy&)
auto __0(boost::node_proxy&, int)
1
Document::Document(const boost::node_proxy&)
Document::~Document()
2
Document::~Document()
So I just came to realize we could use this tool to parse entire projects to
generate the right C++ code, after having disabled the 'operator delete',
and then run the executable, which still is 3.5x faster than Node.JS. For
https://github.com/philippeb8/root_ptr/tree/bb++/bbpp2cpp
I am going to present this to NASA and company. Meanwhile anybody is welcome
to help me out extending the parser to support template syntaxes.
Regards,
-Phil
http://bbplusplus.com/
_______________________________________________
http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...