Re: [Cppcms-users] Next CppCMS Feature Poll - actually: let's talk about the template compiler
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2020-08-13 17:48:13
|
> 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 > 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 There is another important reason empty block: http://cppcms.com/wikipp/en/page/cppcms_1x_templates_flow#Foreach.block So you can write <% foreach %> .... <% empty %> ... <% end %>Another thing is counter - rowid that allows having a iterm counter. So range loop as is does not fit the bill there > Redo the whole template compiler with something like python-ply I would really prefer to keep changes small and focused in implementing fixing an issue. For example std::begin() std::end would allow to iterate over bare arrays like float vec3d[3]; that isn't possible with current design. Another critical issue is that Python2 (unfortunately) is going to die soon. Since software needs to survive the python3 and python2 support essential. Rewriting entire templates compiler is something I thought of for a looooong time - but finally it would require quite a big effort that can take multiple working weeks with virtually 0 benefit for the end user.Sometimes rewriting is critical (like was the case of moving from CppCMS 0.0.x to CppCMS 1.0.0 that was absolutely dramatic change) that brought lots of benefits and huge amount of work. Artyom 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 _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |