[BB++] Now fixes all of your memory leak nightmares
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/
2017-07-22 6:15 GMT+02:00 Phil Bouchard via Boost
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
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 https://www.youtube.com/watch?v=JfmTagWcqoE Regards, Domen
On 07/22/2017 04:20 AM, Domen Vrankar via Boost wrote:
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 https://www.youtube.com/watch?v=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
On Sat, Jul 22, 2017 at 8:36 AM, Phil Bouchard via Boost
https://github.com/hsutter/gcpp https://www.youtube.com/watch?v=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: https://www.youtube.com/watch?v=uJZgRcvPFwI Thanks
On 07/22/2017 11:41 AM, Vinnie Falco via Boost wrote:
On Sat, Jul 22, 2017 at 8:36 AM, Phil Bouchard via Boost
wrote: https://github.com/hsutter/gcpp https://www.youtube.com/watch?v=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: https://www.youtube.com/watch?v=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
On 07/22/2017 04:20 AM, Domen Vrankar via Boost wrote:
2017-07-22 6:15 GMT+02:00 Phil Bouchard via Boost
: 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()
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
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
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
participants (4)
-
Domen Vrankar
-
Gottlob Frege
-
Phil Bouchard
-
Vinnie Falco