Re: [Cppcms-users] Next CppCMS Feature Poll - actually: let's talk about the template compiler
Brought to you by:
artyom-beilis
From: Nazim C. B. <nz...@pr...> - 2020-08-13 15:01:49
|
Hello Martin, 1. Sure. Since we are transitioning to C++11, using range-based for loops is the most logical way. But there are some edge-cases where 1-to-1 translation may not be possible. For instance, when range expression returns a temporary, its lifetime is extended until the end of the loop, but the lifetime of any temporary within range expression is not extended. Example; for (auto& x : foo().items()) { /* .. */ } // undefined behavior if foo() returns by value (For above paragraph, please see https://en.cppreference.com/w/cpp/language/range-for, "Temporary range expression") So, I am planning to find a way to detect such cases (without introducing template code bloat) and either write the code as "for (auto & item: iterable)" or, if there could be undefined behaviour, write the code as "for (auto e = std::begin(iterable) ; e != std::end(iterable) ; ++e)"; all depending on what is written as iterable 2. Yes, we can do that too. And while rewriting, I will try to make it pluggable as much as possible. This way, if anyone would like to extend template compiler in their own project, they may not have to fight with template compiler code. Thank you for sharing ideas. Kind regards, Nazim Can. On 13/08/2020 17:27, Martin Bürgmann wrote: > Hi Nazim Can, > > since you picked tasks 1 and 7 I thought I talk to you about my ideas regarding the template compiler. > > My two primary thoughts are: > > - Make the <% foreach item in iterable %> loop render as for (auto& item : iterable) > - Redo the whole template compiler with something like python-ply > > Especially with pt 2 I think the template compiler's code will get much simpler. > What do you think? > > Cheers, > Martin > > Am Donnerstag, den 13.08.2020, 10:26 +0000 schrieb Nazim Can Bedir via Cppcms-users: > >> Hello, >> >> Then, I would like to get assigned for 1st and 7th items in the "Next Planned Things" list: >> >>> 1. Updating templates compiler to use std::begin/std::end in foreach loop + use of auto by default. >>> 7. Supporting both python2 and python3 for templates compiler due to python2 reaching its end of life. >> >> I will start working on above items tomorrow, and will create pull request on GitHub for review of proposed changes. >> >> Thanks. >> >> Regards, >> Nazim Can. >> >> On 13/08/2020 12:11, Artyom Beilis wrote: >> >>>> >>>> And I would like to propose here that, if you need help I can provide 3 hours per workday (15 hours per week) of development support. You can create milestone on GitHub, and split work as issues, and whoever would like to help may request to be assignee of any issue, write the code and create pull request. Well, please thing about it ;) >>> >>> This is very generous of you! >>> >>> Take a look on my previous mail - pick anything you want to start doing (for example variadic templates or templates compiler) >>> And let me know, >>> >>> I'll be glad >>> >>> Artyom >>> >>> -------- Original Message -------- >>> On 10 Aug 2020, 22:01, Artyom Beilis < art...@gm...> wrote: >>> >>>> Hello All, >>>> >>>> Following the discussion I want to make a commitment to implement a >>>> new feature required by the community. Here my options: >>>> >>>> 1. HTTP/1.1 support - it would allow keep alive support and better >>>> performance overall for multiple requests. It would allow future >>>> implementation of web sockets. >>>> 2. Multiple-Event-Loop support - today there is only 1 event loop for >>>> the service and it can be a bottleneck for small requests on systems >>>> with high core count >>>> 3. SSL support - for embedded systems that need proper web server >>>> 4. C++11 cleanup - replace all booster primitives that exist in C++11 >>>> with standard (shared_ptr, thread, mutex, etc) provide move >>>> constructors for many objects, replace auto_ptr by unique_ptr. >>>> >>>> Feel free to suggest other ideas that you can think of that would be beneficial >>>> >>>> Artyom Beilis >>>> >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> _______________________________________________ >> >> Cppcms-users mailing list >> >> Cpp...@li... >> >> https://lists.sourceforge.net/lists/listinfo/cppcms-users |