Specifically, I’m wondering if it would be worth it to implement less by the server. What is less?
It’s a form of css that allows for variables and some other degree of programmatic magic. It was developed for the Ruby on Rails environment, but I’m wondering if it would be practical to do it in C++ as an apache extension, especially if the extension cached the results.
A quick look at the less link shows it’s NOT a server thing, it’s coding of CSS. Given that, then WHY would you want to implement it via a server extension?
Less is not standard CSS. It has to be parsed into CSS that the client understands. Just like PHP (at it’s simplest level) is not HTML, it needs to be parsed.
CSS doesn’t have support for nested rules, variables and calculations that Less allows for. So a program needs to go in and convert the less sheet into a css sheet before handing the file to the browser.
The current implementation of Less uses Ruby to handle this, specifically a module for Rails. I’m interested in doing this in C++ since it will be faster, especially if caching is supported.
Essentially I’m looking to build a baby parser like mod_php, mod_python or the like, but without anywhere near that level of functionality or complexity.