ConstraintJS: A library for creating dynamic web apps(cjs.from.so)
cjs.from.so
ConstraintJS: A library for creating dynamic web apps
http://cjs.from.so/
6 comments
Databinding can be seen as poor-man constraints: better than nothing, but still not full fledged constraints! One-way databinding is still even more impoverished.
Unfortunately from what I can tell, ConstraintJS is just another databinding framework without an expressive general constraint solver. It really is too bad that the constraint systems that were explored in the 80s and 90s have yet to resurface (production has just made it to the 70s).
Unfortunately from what I can tell, ConstraintJS is just another databinding framework without an expressive general constraint solver. It really is too bad that the constraint systems that were explored in the 80s and 90s have yet to resurface (production has just made it to the 70s).
Constraints have two problems though:
1. The semantics of data binding is much better behaved. Constraint solving doesn't have an obvious sweet spot, where you can say that you can solve a certain obvious class of constraints. Which is why you had such a cottage industry of constraint solvers.
2. Data binding is powerful enough for most things you want to express, and for those things that it's not powerful enough for, a generic constraint solver isn't powerful enough for either (e.g. ui layout, you quickly start to want a linear programming solver or something else that's domain specific).
1. The semantics of data binding is much better behaved. Constraint solving doesn't have an obvious sweet spot, where you can say that you can solve a certain obvious class of constraints. Which is why you had such a cottage industry of constraint solvers.
2. Data binding is powerful enough for most things you want to express, and for those things that it's not powerful enough for, a generic constraint solver isn't powerful enough for either (e.g. ui layout, you quickly start to want a linear programming solver or something else that's domain specific).
A physics engine is the ultimate constraint solver and works well for problems like layout :)
I think they could have added a better explanation for this. I looked at the first example and assumed only 'friend' could be the input.
Turns out I was wrong :p
But, seriously, what's the difference between this and say, Angular.js? They seem to be solving a similar problem with similar syntax
Turns out I was wrong :p
But, seriously, what's the difference between this and say, Angular.js? They seem to be solving a similar problem with similar syntax
At first glance this reminds me a lot of the reactive templating that Meteor does using handlebars like syntax. It even registers dependencies with invalidations, a lot like Meteor. I'd love to see a comparison between the two to see if there is any big difference.
My first thought was that this would be like iOS constraints, which position elements on the screen. This is more of a dynamic templater. I'd be interested to see the performance of this
That would be http://gridstylesheets.org/
Its not a "web app" if it isn't dynamic.
meh
That's not to say there isn't value in creating new libraries, if they have something new of value to add. I think ReactJS falls into this category, amongst others.
But if you are trying to re-solve a problem that has been solved to absolute death, please put at the top of your web page a rational for why you created this library, and why all the existing efforts fall short. Otherwise I, and I suspect many other developers, will never take the time to find out.