Re:Show HN: An Isomorphic JavaScript Framework Faster Than R...
by insin on Tuesday May 26, 2015 @10:08AM
(#9604927)
<div data-query="each(products)"> ... </div>
The React (or Mithril, or Mercury, or other virtual DOM libraries - just change the function being called) equivalent would be: products.map(product => React.createElement('div', null, ... ))
Which you can use JSX (again in any virtual DOM library, via Babel) to sugar as: products.map(product => <div> ... </div>)
The flow control is outside the DSL, not part of it.
Re:Show HN: An Isomorphic JavaScript Framework Faster Than R...
by reverius42 on Tuesday May 26, 2015 @05:11PM
(#9607685)
A DSL for logic inside of a declarative markup language is very different from a DSL for declarative markup inside a programming language.
> Well, one problem is declarative programming has never been as expressive as imperative programming
Haskell is declarative, are you saying Haskell isn't expressive ?
> Flow control does not belong in markup
> In React you'd use JavaScript for this iteration
There is no flow control in HTML , but some frameworks use DSLs in the HTML. If you are saying frameworks shouldn't be using DSLs yet you praise React which uses JSX which contains a declarative DSL in form of XML markup ... your point is a big contradiction.