Web++: A C++ Web Framework
This is my first live coding on Instagram. what do you think? #code #coding #programming #live #livecoding #cplusplus #cpp #dev #development #tech #technology #techie #webdev #web #webdesign #webdevelopment https://www.instagram.com/tv/CKRiu5ujo2g/?igshid=eg82mly0orvv
Here you can find it on YouTube.
YouTube
Live Coding (Working on cookies) | web++
This is my first live coding I've done on Instagram;Web++ Github project: https://github.com/the-moisrex/webpp
YouTube is finding one of my videos violating copyright;
It's me during live coding, the sound of my keyboard typing.
I guess I typed a music π
https://youtu.be/W9qYYFHcm2k?t=2267
It's me during live coding, the sound of my keyboard typing.
I guess I typed a music π
https://youtu.be/W9qYYFHcm2k?t=2267
Web++: A C++ Web Framework
Oops, I broke GCC again!
This git commit message should be a meme! Right? π
How much planning is too much planning? I do plan things a lot, sometimes too much! And that wastes so much time.
Specially when you're working on a big project that takes a long time to complete, you find out that you are wasting way too much time on rewriting the bad decisions of your past. And I think that is why I overthink some decisions now.
Doing small projects makes you think short term, but doing big projects makes you think way too much in the future than necessary.
I think we have to balance it by doing one big main project and many little smaller projects at the same time.
You have to be careful though. The joy of finishing smaller projects may overcome the joy of the big project's journey; and that's dangerous for your big project's health π
Specially when you're working on a big project that takes a long time to complete, you find out that you are wasting way too much time on rewriting the bad decisions of your past. And I think that is why I overthink some decisions now.
Doing small projects makes you think short term, but doing big projects makes you think way too much in the future than necessary.
I think we have to balance it by doing one big main project and many little smaller projects at the same time.
You have to be careful though. The joy of finishing smaller projects may overcome the joy of the big project's journey; and that's dangerous for your big project's health π
I just found out that I've had two different types of "HTTP request" types and I've been maintaining both of them.
They have totally difference ideas behind them.
And also I have a "context" type as well which is essentially an "extendable request" type.
I even confused myself!
I'm having a hard time merging them. One of them wasn't even being used in the process while other parts of the library assumed it was that type.
And it worked. Why? because in the first type I required "req.headers" to be present which is a "vector of header fields" while the other type had "req.headers()" function.
The tests were passing because I didn't have a "concept" for "Headers".
They have totally difference ideas behind them.
And also I have a "context" type as well which is essentially an "extendable request" type.
I even confused myself!
I'm having a hard time merging them. One of them wasn't even being used in the process while other parts of the library assumed it was that type.
And it worked. Why? because in the first type I required "req.headers" to be present which is a "vector of header fields" while the other type had "req.headers()" function.
The tests were passing because I didn't have a "concept" for "Headers".
3 type traits in web++ I had to add:
1. prepend_parameter: add a template parameter to the beginning of a tuple-like list.
2. append_parameter: append to the end.
3. unique_parameters: remove the duplicate types in a tuple-like templated type.
The code on the Compiler Explorer.
1. prepend_parameter: add a template parameter to the beginning of a tuple-like list.
2. append_parameter: append to the end.
3. unique_parameters: remove the duplicate types in a tuple-like templated type.
The code on the Compiler Explorer.
What do you think of my contributions on GitHub (mostly for this project)?
I honestly I could've done better than this if only I wasn't developing alone.
I probably won't be able to work on this project for at least 2 weeks; God knows what happens after that; but God willing if all goes well, I will not forget about this project and continue working on it since I have imagined so many great futures for this web framework.
Till I come back, you're welcome to toy around with the source codes and see you can do a few contributions; I sure will be happy to come back and see some contributions, big or small, even though I haven't seen that much of contributions so far.
I honestly I could've done better than this if only I wasn't developing alone.
I probably won't be able to work on this project for at least 2 weeks; God knows what happens after that; but God willing if all goes well, I will not forget about this project and continue working on it since I have imagined so many great futures for this web framework.
Till I come back, you're welcome to toy around with the source codes and see you can do a few contributions; I sure will be happy to come back and see some contributions, big or small, even though I haven't seen that much of contributions so far.
I am working on an "istring" (improved string) for my framework that will add some additional features to the STL strings (and also compatible string types as well) and you'd use it like:
That's a nice idea right?
I'm also working on unicode aware version as well.
I'll try to use as much as SIMD as possible in these kinda classes; I still haven't used them in the framework itself but they're a good tool to have.
Currently for SIMD stuff I'm using eve project; but of course, it's absolutely crucial to have enough benchmarks and tests for this kinda tools before putting them to use.
Maybe someday I have to use the std::simd proposal instead of eve project, but the author of eve project is just a great guy and even though it's fairly new project, it's a promising project.
Someone on this twitter thread mentioned that a free function is sometimes better, but I kinda like to have both options but I like the free function style to be more generalized (at least from the implementation point of view).
There's also this "ustring" template class as well which I'm trying to make it an alternative to std::string that supports unicode; so half of the implementation currently is a direct copy of GCC's implementation but I have to change most of them and remove lots of noise (which I have already at some extent) and also convert those GCC specific stuff to a more generalized implementations.
By any means these classes are finished and I'm still working on them but I'd be glad to have your support and help; there's so much to do and it's a lot of fun.
istring<std::string> str;Of course all of these algorithms are in the STL itself one way or another, but I'd like to have them in a way that's easier for the final user to use; including for example, nesting the member function calls and be happy that they're as fast as they can be. Also, we can use them with local allocators as well which is just amazing and hopefully results in a super fast codes.
istring<std::string_view> strv;
// ...
str.split(...);
str.replace(...);
auto new_str = strv.replace_copy(...).replace(...).split();
That's a nice idea right?
I'm also working on unicode aware version as well.
I'll try to use as much as SIMD as possible in these kinda classes; I still haven't used them in the framework itself but they're a good tool to have.
Currently for SIMD stuff I'm using eve project; but of course, it's absolutely crucial to have enough benchmarks and tests for this kinda tools before putting them to use.
Maybe someday I have to use the std::simd proposal instead of eve project, but the author of eve project is just a great guy and even though it's fairly new project, it's a promising project.
Someone on this twitter thread mentioned that a free function is sometimes better, but I kinda like to have both options but I like the free function style to be more generalized (at least from the implementation point of view).
There's also this "ustring" template class as well which I'm trying to make it an alternative to std::string that supports unicode; so half of the implementation currently is a direct copy of GCC's implementation but I have to change most of them and remove lots of noise (which I have already at some extent) and also convert those GCC specific stuff to a more generalized implementations.
By any means these classes are finished and I'm still working on them but I'd be glad to have your support and help; there's so much to do and it's a lot of fun.
Here you can find all of the C++20 features that's been added to the language:
https://oleksandrkvl.github.io/2021/04/02/cpp-20-overview.html
https://oleksandrkvl.github.io/2021/04/02/cpp-20-overview.html
Oleksandr Kovalβs blog
All C++20 core language features with examples
Introduction
I added a discussion about properties and their usage; help me out to discuss this feature and see how this idea can help us write better application classes in this framework.
https://github.com/the-moisrex/webpp/discussions/11
https://github.com/the-moisrex/webpp/discussions/11
GitHub
Properties Β· Discussion #11 Β· the-moisrex/webpp
I updated the main Readme file and added a few description. I should've added a FAQ page but this way seems more eye-catching!
I hope it to help persuade some developers to come and help me out in the development process of this framework since I can't work on it for at least a few months.
I hope it to help persuade some developers to come and help me out in the development process of this framework since I can't work on it for at least a few months.
Web++: A C++ Web Framework
Photo
Even though I don't believe in luck, but wish me luck so I can continue working on this project so God willing someday all of us can use it together and add more value to our communities and make the world an easier place to live, all with the help of this little project of mine!
Thank you all for staying with me even though I wasn't able to work on it for such a long time.
I'm still not able to work on the project the way that I wanted to but I am trying my best to keep going even if I have to code on a handheld device!
Thank you all for staying with me even though I wasn't able to work on it for such a long time.
I'm still not able to work on the project the way that I wanted to but I am trying my best to keep going even if I have to code on a handheld device!
This media is not supported in your browser
VIEW IN TELEGRAM
Working as much as I can is the right of my project; doing any less is wronging my project in a way that making it up is just not possible. So I should code as much as I can so I won't be in debt to my own creation.
I'm deeply thinking of making a few DSLs (Domain Specific Language) in order to make development for the users easier.
DSL N. 1: VML (View Markup Language)
This one gets processed to a C++ file which will be run on the server. Based on it, you can design what gets sent to the client. It's modular and probably will look like Qt's QML but with some changes.
And the cool thing about this language is that there will be some output generators; meaning you can select which kinda output you want this language to have:
- HTML/CSS/JS
- QML
- VueJS
- ReactJS
- You can even make your own generator
This means you can design your UI once in this language and never not worry about the actual output generated.
Another feature that I'm thinking about is making sure the user can use C++ in the language.
And also make sure those codes can be chosen wheather you want to be run in the client or the server.
How we're gonna run C++ on client you ask? Well with WebAssembly of course.
Imagine this still psudo code:
Page {
Image {
// ...
server.onclick: {
// C++ code to run in server
// When the user clicks the img
}
client.onclick: {
// C++ wasm to run on client
}
}
}
What do you think?
I'd like to have a deep discussion about this before starting to code this idea! So help me out!
DSL N. 1: VML (View Markup Language)
This one gets processed to a C++ file which will be run on the server. Based on it, you can design what gets sent to the client. It's modular and probably will look like Qt's QML but with some changes.
And the cool thing about this language is that there will be some output generators; meaning you can select which kinda output you want this language to have:
- HTML/CSS/JS
- QML
- VueJS
- ReactJS
- You can even make your own generator
This means you can design your UI once in this language and never not worry about the actual output generated.
Another feature that I'm thinking about is making sure the user can use C++ in the language.
And also make sure those codes can be chosen wheather you want to be run in the client or the server.
How we're gonna run C++ on client you ask? Well with WebAssembly of course.
Imagine this still psudo code:
Page {
Image {
// ...
server.onclick: {
// C++ code to run in server
// When the user clicks the img
}
client.onclick: {
// C++ wasm to run on client
}
}
}
What do you think?
I'd like to have a deep discussion about this before starting to code this idea! So help me out!
Here's a link to this channel's reddit community:
https://www.reddit.com/r/webpp/
https://www.reddit.com/r/webpp/
reddit
webpp β’ r/webpp
C++ web development framework: https://github.com/the-moisrex/webpp
I would like to see is_specialization_of in the C++ Standard Library.
Just copy and pasted the implementation into the project.
Just copy and pasted the implementation into the project.
Media is too big
VIEW IN TELEGRAM
I love watching advance live coding sessions and I always learn something in those. I also like to make them as well but the work that has to be put into the converting, rendering, and sharing the final video is just takes too much sometimes.
Here's a timelapse of me dealing with Termux, clang, libc++, router and a few other things in the project.
Interestingly, the project currently compiles on clang 12.0.0 on Arch Linux, but for some reason, it doesn't compile on Termux with the same version of clang that works on Linux.
Here's the full video on YouTube.
Here's a timelapse of me dealing with Termux, clang, libc++, router and a few other things in the project.
Interestingly, the project currently compiles on clang 12.0.0 on Arch Linux, but for some reason, it doesn't compile on Termux with the same version of clang that works on Linux.
Here's the full video on YouTube.