[Ur] Compiling code at runtime

Adam Chlipala adamc at impredicative.com
Fri Oct 7 21:44:31 EDT 2011


Marc Weber wrote:
> Excerpts from Anand Patil's message of Fri Oct 07 19:08:43 +0200 2011:
>    
>> I'm wondering about Ur/Web's suitability as a compilation target for
>> scripting languages that are used from a web console. As a very simple
>> example, I'd like to write an Ur/Web web application featuring a text
>> entry field, in which users can paste Ur programs (perhaps using only
>> a subset of Ur), which are then compiled and executed. How feasible
>> would this be?
>>      
> The only way to run ur dynamically is by
> - compiling ur
> - invoking ur
> using kind of proxying
>    

Not entirely true.  The support for protocol plugins makes it possible 
to compile shared object files and load them dynamically, in the same 
process that initiated compilation.  I've done this in unreleased code, 
so I know it's possible. :)

The whole approach is likely to be unappealing to folks used to 
"scripting" environments.  The Ur/Web compiler is fundamentally 
whole-program, so you won't be able to create natural interaction 
between bits of Ur code compiled at different times.



More information about the Ur mailing list