I would like to share some general thoughts of mine about the KSS project. I discovered KSS just few months ago while playing around Plone 3. My previous experiences were mostly Zope 2 development and older Plone releases (i.e. < 3.0). At first I was unaware of this project and inline editing in Plone was for me just a neat future that it has built-in and the competition doesn't have. Later on I came to know that Plone incorporates external package called "kss" - a full-blown framework to work with Javascript and Ajax without actually programming in JS.
When I came deeper into the topic at some point I said to myself - Eureka ! This is a brilliant idea ! Awesome ! Finally someone found a way to describe the "dynamicism" of a web page - and in such an elegant way - a Kinetic Stylesheet! Just like CSS describes the static things on a page - great! I don't even have to attach actions through code (like in jQuery after page loads). You guys are genius ! But then came the disappointment ... Sadly speaking - this framework is actually ... useless. To be more specific - it is "unusable in production". It's just a toy. Why do I speak of KSS with grains of salt, why I can't use it in production? Because of two really simple, trivial things: 1) kss is heavy 2) kss is slow The second problem does not exists in Plone since it only has few rules in .kss files, so the parser can handle them. Big problem arises when I want to implement a serious app and put A LOT of rules (imagine something like Gmail with kss). It just takes too long time. Anything more then 1 second of processing after the page is loaded makes the app unusable - which questions the usage of Ajax in the first place (full page reloads could be faster). The first problem is also a serious one (100k is too much). The CSS parsing library of course will be always slow and big since it's Javascript anyway. I'm happy that CSSQuery was replaced by a better, faster and smaller library. But still this is javascript parser! The Plone team even had a proposal to remove kss completely from the project and make it only optional (see PLIP http://dev.plone.org/plone/ticket/8809). So what can be done to deal with these two major problems? I would really be happy to be able to use KSS in production not just as a curiosity or toy! I want KSS to be a serious thing ! My idea is not in the code, not in optimizing things, not in replacing libraries - it is somewhere else. Try to look at the problem from a different perspective! Why not to harness the power of the browsers? They handle CSS since long and they're doing it fast. They could handle KSS as well ! Isn't the KSS project mature enough to become a ..... standard ! Yes, a web standard ! A standard that everybody uses - CSS/KSS - this pair plays nice together. It's not up to me to decide about that but in my humble opinion KSS should become a W3C standard alongside CSS. It should be posted as a proposal to the World Wide Web Consortium. Kss files should have their own registered mime type - Really I do think so ! Am I going too far ??? Hmmm. Maybe. Micro$oft can post some shitty proposals to W3C (which are mostly rejected) and the community cannot post a great idea? Hmmm. Maybe not. If I'm looking too far ahead there is another solution, not as "grand design" as the first one but should suffice. Different browsers have different capabilities which are non standard. Even Ajax itself is only a "de facto" standard (XMLHttpRequest is still a working draft at w3c) and has separate implementations (Firefox/IE/...). The Canvas library (if I remember the name correctly) can draw on the screen using javascript fast and it's also non standard. Wikimapia project uses that if I am not wrong. So there is a need for browsers to give you a library which parses CSS using browser's engine. The easiest way would be to contact the teams of open-source projects (like Firefox) and ask them if they can provide you with this capability. Of course other projects which parse CSS selectors could benefit (like jQuery), so forces can be joined. The problem is that KSS is not well recognized in the web community. Why?! I ask you !! This is such a brilliant project, KSS could be ported to any web framework! Be it Java, PHP, whatever, it doesn't has to be Python based framework. But when I ask Java folks if they did hear about the big, innovative web project named "KSS" they make big eyes! They live in their Java world and KSS lives in the Python world. These worlds are mostly separate. Why? The problem with KSS is with marketing. This project doesn't have any marketing! Or maybe these marketing efforts are not enough. KSS doesn't have a worldwide recognition it deserves! Plone is a nice example of successful marketing that even overtakes the product itself. Plone has many glitches, is slow, huge framework, sometimes hard to work with - but still many clients want it. Actually these times we live in are very interesting when it comes to web applications which are closer and closer to desktop apps. Many client side functions is done using slow javascript code, so there is a need to use some of browsers' native libraries from inside JS code to speed things up. This includes XPath selectors, XSLT transformations, using RPC's - just to mention a few needs. More and more JS code is replacing server side code to push load on the client side. I am hoping one day KSS will use browsers' native CSS parsing capability and will finally be fast and lightweight. And what do you think ? Appreciations for all comments and answers. _______________________________________________ Kss-devel mailing list Kss-devel@codespeak.net http://codespeak.net/mailman/listinfo/kss-devel