[Ur] FFI and transactions

Robin Green greenrd at greenrd.org
Sun May 29 13:14:19 EDT 2011


Adam Chlipala wrote:
> There _is_ the (admittedly minor) fact that a function with a
> transactional type may turn out to have a completely pure implementation
> under the hood, such that effectfulness annotations can help the
> optimizer make better decisions.

I can't imagine an impure function which has a completely pure
implementation. Examples of the reverse are easy to come up with, however.

Can you give an example of when this might happen?

> Perhaps the piece you're missing is that abstract types in FFI modules
> may be implemented with arbitrary C types, with no restrictions?  (They
> may even be implemented with structs (not just struct pointers)!)

Yes, I was indeed missing that. But... how does Urweb know how much stack
space to allocate for them - does it parse the .h files? Or is there
something about x86 calling conventions that I'm missing?




More information about the Ur mailing list