To see how much C++ can get closer to dynamic langagues typically used for web programming and at the same time make absolutely no compromise on performances.
How long have you been working on it?
8 months on lithium, but I already wrote another framework (silicon, which I rewrote from scratch because of slow compilation time).
What do you do professionally?
I worked for several company, doing different things including, real time image processing, neural nets for photography, web programming, robotics
What are your plans for it?
No big plans yet, just having fun for now, but I'd like to keep implementing the features if the users ask for it, improve the doc. In the more long term, building websockets would be nice too, and other services on top of it.
Given that the whole framework is in roughly 31kloc of C++ written mostly by you and this not your first framework. Can you talk more about your design choices, what the architectural patterns are and how metaprogramming plays a role [1] ?
Besides your experience from writing Silicon [2], what other frameworks do you like the design of? What C++ codebases do you like or find interesting from a design perspective?
I think I need to write a blog post to do a retrospective on what I learned writing iod, silicon, lithium (and vpp, a small image processing lib). There is so much to tell.
Just to be short, here is my phylosophy:
- don't think too much when you write it the first time, just do it quick. Do all the mistakes and ugly code first and then rething/rewrite things when it can actually simplify the codebase. Big refactors are much more productive and successful than big premature design thinking.
- Only expose the complexity that the user need. Simple things should stay simple even if we can do more complex stuff. Look for simplicity everywhere.
- Profile before optimizing, the bottleneck is never where you think it is.
For you question about metaprogramming, it is used yes. The core of the framework is build around a compile time key/value map that unroll json and get/post parameter de/serialization at compile time [1] so no dynamic dictionary involving costly malloc is needed.
For Rust vs c++:
- I never used rust but I like the language and the safety it provides.
- a mainstream package/dependency manager is missing in C++ so rust is clearly better on this point. This is a big problem for the C++ community where code is much less shared than in the javascript community for example.
- The other big problem I have with C++ is compile time, I heard that Rust is slow too but I never compared the two.
Why did you create lithium?
To see how much C++ can get closer to dynamic langagues typically used for web programming and at the same time make absolutely no compromise on performances.
How long have you been working on it?
8 months on lithium, but I already wrote another framework (silicon, which I rewrote from scratch because of slow compilation time).
What do you do professionally?
I worked for several company, doing different things including, real time image processing, neural nets for photography, web programming, robotics
What are your plans for it?
No big plans yet, just having fun for now, but I'd like to keep implementing the features if the users ask for it, improve the doc. In the more long term, building websockets would be nice too, and other services on top of it.