[Ur] Ur/Web in production

Adam Chlipala adamc at csail.mit.edu
Sun Jan 19 14:34:53 EST 2014


On 01/18/2014 02:58 AM, Sergey wrote:
> On 17.01.2014 00:30, Vladimir Shabanov wrote:
>>
>> Compiler bugs. As you can expect from a new and complex tool there were
>> several bugs in compiler and runtime library. Most of them are in the 
>> past
>> now. However I'm still not sure about one nasty bug when some effectful
>> computation were optimized out (click on button and part of event 
>> handler
>> is not executed at all, whoops). It's the most annoying bug I've met in
>> Ur/Web. Usually solved by some code reordering or by calling it via
>> JavaScript FFI function (look for 'forceImpure' in the sources). Hope 
>> it's
>> fixed since I haven't seen it for a while.
>>
>
> Looks like I have an example of such bug. I've noticed that one test 
> for urweb-monad-pack library doesn't execute all the client-side 
> handlers:
>
> https://github.com/grwlf/urweb-monad-pack/blob/master/test/TestState1.ur
>
> The program should popup two alerts at startup but for some reason 
> only the last one appears.

Thanks for the example!  I found the bug, and now at least this example 
works properly.

Two fun facts:
1. Thanks to Vladimir's open-source release of the BazQux code, I've 
included it in my informal regression test suite for this change. :)
2. It may not be obvious, but all state monad execution in TestState1.ur 
actually happens at compile time!  If the compiler weren't so "clever" 
about reducing terms at compile time, then this bug wouldn't have had a 
chance to surface. ;)




More information about the Ur mailing list