TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fun - a new programming language for the realtime web

122 pointsby marcuswestinalmost 15 years ago
"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."

15 comments

Twisolalmost 15 years ago
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.
评论 #1590081 未加载
necubialmost 15 years ago
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.
评论 #1589216 未加载
seanalltogetheralmost 15 years ago
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.
评论 #1589028 未加载
bobbywilson0almost 15 years ago
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.
评论 #1589087 未加载
sshumaker_2almost 15 years ago
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).
评论 #1592295 未加载
asnyderalmost 15 years ago
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
评论 #1589272 未加载
mgrouchyalmost 15 years ago
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.
评论 #1589104 未加载
Jachalmost 15 years ago
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.
jackowayedalmost 15 years ago
I notice that you haven't technically OSSed it yet (not released under any license). Is this just an oversight?
评论 #1589130 未加载
thomasflalmost 15 years ago
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.
zokieralmost 15 years ago
"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.
enduseralmost 15 years ago
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.
评论 #1592317 未加载
wazooxalmost 15 years ago
Jemplate, anyone? This was already done.
评论 #1592294 未加载
parisbaalmost 15 years ago
This is really awesome!
AlphaPlusalmost 15 years ago
Sounds fun