3 ms·
The layout system is declarative (with escape hatch to looping and conditionals), and so is the finite state machine syntax DSL inside, and the regular expressi
by magicmouse 5y ago
The layout system is declarative (with escape hatch to looping and conditionals), and so is the finite state machine syntax DSL inside, and the regular expression syntax (a novel reformulation).
But the nicest feature, invisible in the syntax because it is a property of the runtime under the hood, is that when you change your mutable state, any layout that used those variables is automatically scheduled for refresh. You thus declare what is on the screen, and how it is arrange, and the system knows what to do. In this sense it more like SQL, where you give it a goal, and don't specify the ordering of how to achieve the task.
There are also mini-solvers built into the language for the common tasks of solving for rectangles and points, which are quite handy.
Please take it for a spin, you might like it!
- brundolf 5y agoMobX does this for JS, in a more generalized way that can be paired with any DOM-update strategy (or other arbitrary side-effects)
- bawolff 5y ago"Reactivity" is a common paradigm in the javascript world. There are many libraries to essentially do this or variations on this theme.
- brundolf 5y agoThere are two key elements in this case: 1) Changes are triggered through regular mutation, not special API calls 2) Reactive dependencies are automatically determined The combination of these two traits is somewhat unique, and is offered by MobX and (apparently) Beads.
- bawolff 5y agoI don't think having an embedded DSL for defining layouts makes it a declaritive language. By that definition, almost every language is declarative as its a somewhat common way to define layouts (certainly not universal, but common enough that i suspect every language has at least one library that supports it). If the main facilities for writing logic in the language are procedural, than i'd call that a procedural language.