4 ms·
The demo code on http://impredicative.com/ur/demo/ http://impredicative.com/ur/demo/ mixes HTML with ur. Is this some kind of functional PHP? No real templates
by stesch 12y ago
The demo code on http://impredicative.com/ur/demo/ http://impredicative.com/ur/demo/ mixes HTML with ur. Is this some kind of functional PHP?
No real templates?
- klibertp 12y agoThe difference is that the HTML in Ur/Web is not just a string like in PHP. Ur provides a special syntax for building XML trees and so if you include the code like "<b>something<b" in Ur/Web it just won't compile. You can't ever output malformed HTML in Ur. This also allows for type checking of HTML - for example you can be sure that you won't have unescaped output in your HTML because the type system makes it impossible (won't compile) to use unescaped string in place of escaped one. So in short, what you saw already is a template engine (also look at React (and maybe Opa?), which also has a special syntax for building XML/HTML), and it's already insanely powerful.