[Ur] Feedback and questions

Adam Chlipala adamc at impredicative.com
Wed Dec 23 08:29:51 EST 2009


Thanks for the feedback.

Artyom Shalkhakov wrote:
> Weird things are happening with the attached program.
>
> - the Unicode text is displayed correctly when pages are statically
> generated (that is, in the case of postMain) but when a remote call
> for data is made, the text is turned to garbage.
>
> - a form generated by asyncMain is displayed incorrectly in Firefox
> 3.0 (somehow, both<input>s are moved outside of<body>  tag), but okay
> in Chromium and Midori.
>    

Would you mind opening a Mantis issue for each of these problems?
     http://www.impredicative.com/mantis/

> What happens when an RPC fails?

All handlers registered with [Basis.onConnectFail] are called.  If you 
haven't set any handlers, you get a generic alert box.  The thread 
waiting for the RPC result is aborted.

> Is RPC synchronous or not?

It's synchronous, in the sense that a thread that makes an RPC suspends 
until the result is available.

> How is asynchronous message passing implemented?
>    

It's the standard long-polling approach.  Clients hit a special URL on 
the server.  When the next message is available, it is returned as the 
HTTP result.

> Also, how do you develop against Ur/Web? (e.g., when one uses a
> mainstream scripting language, the development cycle goes like this:
> "write or fix ->  fire up a browser ->  notice nothing works ->
> repeat".)
>    

I think you just add a "compile" step in the second slot, with a nested 
loop between that step and the "write or fix" step, to deal with 
compile-time errors.  It would be possible to add a #! line at the start 
of the Ur source and get it compiled on-the-fly as needed, but the 
compiler is so slow that I wouldn't recommend it.  (You'd also have to 
write your own wrapper to implement this.)

> Is REPL functionality planned?
>    

I'm not planning that for any time soon.  Since the only compiler is 
whole-program, a REPL would require significant extra implementation.

> And finally, is there a more accessible introduction for the rest of
> us than the raw typing judgments in the manual? If not, what do you
> recommend to read on type theory? (I'm interested in not only using
> Ur/Web for shipping applications, but also in its inner workings.)
>    

Benjamin Pierce's "Types and Programming Languages" should be an 
adequate introduction, though it also covers many topics that are not 
needed.  I've tried to design Ur/Web so that it's fairly straightforward 
to stick to the ML-like fragment, with the main possible source of 
confusion being error messages that mention advanced features 
explicitly.  I'm also planning to, in the next few months, create a wiki 
where different kinds of learning material can be maintained.



More information about the Ur mailing list