
Please help – stuck with recursive speculative display list algorithm - exikyut
https://softwareengineering.stackexchange.com/questions/404293/recursive-speculative-display-list-engine-computing-text-length-across-stack-b
======
abecedarius
Look up papers on pretty-printing with dynamic programming. “A prettier
printer” was a good starting point, though in Haskell, so it might be easier
to find something citing it using a perhaps-more-familiar language.

~~~
exikyut
This is awesome, thanks!

It's also given me the idea to ask around in functional-programming
communities.

The "prettier printer" paper was actually more accessible than I expected it
would be too :) although I get the impression it wants me to define group
starts and ends before it does its work, and the algorithm I'm currently
headscratching on works as a streaming buffer.

~~~
abecedarius
You're welcome! I think the lazy evaluation effectively does streaming -- that
was the other reason to look at followup work, like the "Strictly Pretty"
paper which had code in ML, a non-lazy language. I'm forgetting the titles of
newer ones than that.

