mingodad Messages: 46 Registered: February 2008 Location: UK
The problem happen because I have a "$post_identity()" instruction on a form but I'm accessing this page through GET somehow it dies here:
String GetIdentity(const Renderer *r)
// This ugly hack expects that __identity__ is always present in r->var
Http *http = const_cast<Http *>(dynamic_cast<const Http *>(r));
throw Exc("invalid POST identity call");
String s = http->var; ///<<<<<<<<< it dies here because I'm accessing through get / it's intended to do this way mixed GET/POST
s = AsString(Uuid::Create());
http->var = s;
Isn't worth to use something like Lua for witz, it already has all error handling well done and has more capabilities out of box.
I'm not saying to move business logic to templates, but having flexibility to try new things/variations without need to recompile is an interesting feature.
I guess that is quite tough design decision in all template systems.
Before creating witz I was, of course, investigating other templating systems, then defined witz in a way that about permits as much as them.
I would say that if templates are common pactice with PHP framework, then perhaps putting more flexibility into templates is a bad idea (because pure PHP can be considered a templating system with ultimate flexibility .
I did a microbenchmark with ESC, lua, luajit, SquiLu:
There is no surprise there, Esc is just a very simple pure scripting language intended (originally) for .usc files, which are widget propery/visuals definitions for Layout Designer.
Note however that Esc is completely unrelated to .witz. Witz is compiled to object representation and runs without interpreting anything. I have benchmarked WITZ and found it about 8 times slower than optimized C++. In real use, witz spends 80-90% of time just concatenating texts, therefore I doubt it would ever be performance bottleneck.