

Ask HN: Any language-like frameworks that combine server/client relations? - TimothyBurgess

I'm not entirely sure what to google for something like this so I figured I'd just ask.<p>And I'm not talking about frameworks like Ruby on Rails, CakePHP, etc. etc. etc.  While I'm not entirely familiar with all of them... I get the impression that they're all fairly separate in terms of scripting/markup; i.e., you specify your html, include your css, include your javascript and specify when to use its functions, and do some server-side scripting to interact with databases and what not.  Even though all of these pieces work together, they're still quite separate and it seems to me like it's not nearly as efficient as it could be.  I mean... obviously there is a limit to how efficient it can be given current standards but even so, this limit has yet to be reached.<p>I may get some responses saying this isn't possible given the nature of web development, but I'm 100% sure it is.  The nature of programming is inherently complex relative to the world as the human brain immediately understands it... so it would suffice to say what I'm suggesting really just boils down to another abstraction layer on top of current methods.  It's just a matter of how feasible/easy it would be to implement given current standards and technology.<p>And I wonder this because the framework I've developed allows me to whip together nearly any highly functional multidimensional relational database (aka most modern websites lol) in a short period of time while still being fairly customizable.  I say fairly because it's definitely limited to the structure I've given it (the framework).  The more abstract the layers become, the less flexible it becomes... the less control you really have.  But even then... that's not entirely what I'm looking for.<p>For instance, my framework allows me to do something like this:<p><pre><code>		'Home' =&#62; array(
			'_Step_' =&#62; 'Profile',
			'Profile' =&#62; array(
				'_Step_' =&#62; 'Group',
				'Group' =&#62; array(
					'_AffectedBy_' =&#62; array(
						array('Home', 'Requests', 'Incoming')
					),
					'_Form_' =&#62; array(
						array(
							'DimText' =&#62; 'E-Mail',
							'input' =&#62; 'text',
							'attributes' =&#62; array(
								'name' =&#62; '_E-Mail_',
								'tip' =&#62; array(
									'_Function_' =&#62; array(
										array('Chef', 'DoTip'),
										array('RecommendTips', 'It is &#60;b&#62;highly&#60;/b&#62; recommended that you follow these tips your first time through.  There\'s more going on here than meets the eye!', true, false, true)
									)
								),
								'tsq' =&#62; $tsq++
							)
						),
						array(
							'DimText' =&#62; 'Other Websites',
							'input' =&#62; 'list',
							'attributes' =&#62; array(
								'name' =&#62; 'Other Websites'
							)
						),
						array(
							'Etc...'
						)
					)
				),
				'User' =&#62; array(
					'_Form_' =&#62; array(
						array(
							'_Function_' =&#62; array(
								array('Chef', 'ChangePass'),
								array('_Data_')
							),
							'_DisableBreak_' =&#62; true
						),
						array(
							'_UserData_' =&#62; true,
							'DimText' =&#62; true,
							'input' =&#62; 'text',
							'attributes' =&#62; array(
								'name' =&#62; 'First Name'
							)
						),
						array(
							'_UserData_' =&#62; true,
							'DimText' =&#62; true,
							'input' =&#62; 'text',
							'attributes' =&#62; array(
								'name' =&#62; 'Last Name'
							)
						)
					)
				)
			)
		)
</code></pre>
Now, I cut out quite a bit of it just so I'm not posting an insanely long message but you should get the idea.<p>The only two files I ever need to modify are the multidimensional array (site structure/contents) file and the css file to change the layout/look.  It operates like a desktop app with no refreshing, including all navigation.  All of the database handling and html/css/javascript/ajax generation is performed in the background and everything is at a minimum - no whitespace, minimum required javascript/css is included, etc.  Ideas like headers, navigation, content, etc. are given wrappers with logical corresponding IDs and/or class names so that all you have to do is follow an easy standard to know what CSS you need to add to give it the look you want.  And when custom functions are to be performed on the data, you can retrieve it like this:<p><pre><code>		$D['Home']['Profile']['Group']['Other Websites']
</code></pre>
Of course, as I said earlier, this is fairly limited functionality-wise to the structure I've given it - but let's be real... there's a limit to the extent of flexibility 90% of web apps really need.  So back to the question now that I hope it's clear... is there something out there like my framework but more flexible?  And I mean to the extent of... as if you're coding a typical desktop application.
======
kunley
I know your concerns as I've recently had lots of thoughts on client-server-
ajax-comet-websockets state of the art.

While your matrix seems quite radical, it's interesting approach. You may find
other approaches attractive as well. For example Zed Shaw's Tir is making an
webapp flow looking procedural by smart using coroutines underneath. While the
idea was invented before, I like his implementation; i didn't yet hack
anything serious in it though.

If you like evented style, Nitrogen is also very interesting. It allows you to
program callbacks which jump from server to client and back in a clean way,
IMO. That'll work for you if you can swallow Erlang syntax of course. I'd say
this product is really production ready, btw.

