The LM317 when used as the regulator is not very accurate. This starts with the output pins / contacts and the heating of the reference and amplifier part. So a serate build regulator is often the more accurate way. Adding current limiting / regulator to a LM317 regualtor circuit is challanging, arguably more tricky than starting from scratch with OPs and power transistors.
Usually the regulation is done analog - a digital solution is rather demanding on the ADC / DAC side and still often slow.
When starting with PWM as a set signal one goes PWM -> fitler to get an analog set voltage and than goes with an analog regulator (e.g. classic PID style) from there.