[Ur] Blogpost

Vladimir Shabanov dev at vshabanov.com
Mon Apr 27 08:34:47 EDT 2020


> In case anyone is interested, I wrote a blog post some time ago about my experiences with Ur/Web.
> 
> http://frigoeu.github.io/urweb1.html

Great post. I agree that build times for large projects is perhaps the most annoying thing in Ur/Web.

They caused mostly by excessive inlining. To cut them down I'm generating neverInline pragmas for almost all or my functions. Since JavaScript supports functions as values it works very well for frontend (and reduces app.js file size as well). Backend requires polymorphic functions to be inlined but most of them live in standard library so I just don't generate neverInline pragmas for them.

Here's pragma generation from my Makefile

neverInline.urp: *.ur
 @perl -n -e 'use File::Basename; $$ARGV =~ s/.ur//; s/\(\*.*\*\)//; /.*( val|^val| fun|^fun) +([^ ()]+)/ && print "neverInline $$2\nneverInline ",ucfirst(basename($$ARGV)),"/$$2\n"' $^ | grep -vE " (not|inlined|functions)$$" | sort | uniq | grep -ve "^$$" > $@

And of course I'm using Ur/Web daemon (and thinking to try your LSP server as well).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20200427/a346a1a6/attachment.html>


More information about the Ur mailing list