Call-by-name is generally seen as an annoyance by programmers. Fortunately, if your programming language has mutable state you can force evaluation at ground type by using assignment, so by writing
new v in v := x; f(!v)
you achieve the same effect as calling f(x) by-value. This is tedious, so ALGOL use
to achieve the same effect by using simpler syntax. We have added this feature to Verity now as well.
This was also an opportunity to me to get used to the compiler, which was written by my student Alex Smith. So I sat down with him and had him guide me in implementing this syntactic transformation in the GOS compiler. So that I don’t forget all this stuff I screencasted our session, which you can watch here.
Warning: it is not a very exciting video, other than the mild amusement generated by my constant fumbling.
On the plus side, the whole compiler change took as long as the video, i.e. about one hour including some simple testing. And it worked, no bugs, first time, which is yet another testament to what a nice programming OCaml is.