"What if you could build realtime web apps with the same ease as you build static web pages in PHP today? Without long polling, event handling and state synchronization, the engineering complexity of realtime web applications would drop by an order of magnitude. There would be a fundamental shift in the way we build the realtime web. This is the future of Fun."
Quote - "What if you could build realtime web apps with the same ease as you build static web pages in PHP today?"<p>It's interesting how far we've come, no? PHP-based pages were once considered dynamic.
From a cursory reading, this isn't particularly new, even on the web. Essentially what he's done is implement bindings/key value observing, but with a new syntax instead of the one we already know (i.e., javascript). On the desktop Cocoa has done this very well, and on the web Cappuccino and SproutCore have copied the cocoa approach. There are also more lightweight libraries that provide binding support without a heavy framework.
What they are describing is essentially data binding at the language level. The thing to keep in mind is that "out of sight, out of mind" data binding can result in very slow code, but it's a fantastic pattern for UI dev.
This certainly is an interesting idea. It seems to me though that all of your application logic is jammed into a single file at the presentation layer. This might suffice for very small apps, and that's fine if it is your goal. I can't imagine that you just define all of your logic in one file.<p>How would you go about reusing code?
Could you potentially separate out logic from your template?<p>I would also like to see how this could be done more unobtrusively. It would also be good to show what the output html looks like after it is compiled to html.
Actually, there's a lot more to it than simple 'key/value' binding, depending on how it's implemented. It allows you to build very live pages that are driven directly off your data model. Normally, websites build dynamic content using a templating system on the backend, but live updates need to be done in a horribly awkward manner using a Javascript builder syntax or manually gluing together things in JS. This avoids this problem and unifies it into one nice syntax.<p>I built a similar language like this powered a site of mine that was actually in production (well, Alpha) - and it was a huge productivity boost, resulting in far more interactive pages. (The site never got out of alpha, and never had designer love, so it's stale, but you can see it at <a href="http://www.magnifeast.com" rel="nofollow">http://www.magnifeast.com</a> - try entering a los angeles address).<p>The downsides to this approach are compatibility (most libraries won't work out of the box), SEO, and performance problems for generating large pages (particularly in IE).<p>(BTW: this is a secondary account, I'm normally sshumaker - noprocast rule and all).
A similar sort of thing is already possible using the NOLOH PHP Framework (<a href="http://www.noloh.com" rel="nofollow">http://www.noloh.com</a>) using its Listener Control. Using a quick example similar to the post you can simply do something like: <a href="http://noloh.diffpaste.com/#/691/" rel="nofollow">http://noloh.diffpaste.com/#/691/</a>. Furthermore, you can specify the various options, whether it's stream, short-poll, or long-polling.<p>A video demonstrating it from this past March's Confoo web conference can be found here: <a href="http://www.youtube.com/phpframework#p/c/C102458C2FFD8ACF/7/8r0FR0Dx4zE" rel="nofollow">http://www.youtube.com/phpframework#p/c/C102458C2FFD8ACF/7/8...</a><p>We're also planning to add a more direct syntax in the future so that you can easily set properties of objects directly to a changing data source without having to handle the assignment in a controlled callback, which we initially mandate due to taking the cautious route, thus allowing you to handle for data and security issues.<p>Disclaimer: I'm a co-founder of NOLOH
Is it just me or does this seem like a "Fun" way to code up an unmaintainable mess?<p>Some of the ideas such as the state synchronization stuff is neat, but would probably be better suited as part of another framework/template language.
Reminds me of how Flex does data binding, but with the added feature of blurring server and client. I don't think I like this idea, and I'm not sure it would save me code or headache in the long run... Still neat though.
The "Fun" language looks a lot like Ruby and the Camping web framework with inline Markaby templates created by Why (the lucky stiff): <a href="http://camping.rubyforge.org/" rel="nofollow">http://camping.rubyforge.org/</a><p>It's 4k of pure ruby art. Check it out.
"To bind an element that reflects a piece of state to a piece of data, all you do is set data attribute in the element."<p>Reminds me bit of register globals. And generally blurring the line between clientside and serverside processing feels bit scary.
For those of us who gravitate toward the code examples instead of the English it would be more clear to leave out the PHP example at the very beginning. Took me a moment to figure out what was going on.