String template interpolation as a two steps process

Ron Pressler ron.pressler at oracle.com
Thu Apr 4 15:24:01 UTC 2024



> On 4 Apr 2024, at 15:31, forax at univ-mlv.fr wrote:
> 
> 
> In the past, due to the fact that an interface was used for the processor, it was hard, not impossible, but hard, to provide a good api without adding security issues to the platform (the Lookup object being transfered to the string template processor). With the new design, I think we can provide a better API to the library implementors, not a priviledged API like only the JDK can use but a better API that the one currently proposed.

Yes — assuming you mean some non-privileged mechanism for caching parsing results — but that shouldn’t necessarily be in the first preview of the new design. It is a performance optimisation that can be postponed until we’re sure we’re on the right track from the perspective of the consumer. Writing good template processors is an interesting and challenging aspect done by “template processing professionals” (e.g. see what’s required of proper HTML template processing: https://rawgit.com/mikesamuel/sanitized-jquery-templates/trunk/safetemplate.html) and there’s much for library authors to digest before considering caching (even though it may become an issue later on).

— Ron


More information about the amber-spec-observers mailing list