String Tapas Redux: Beyond mere string interpolation

Remi Forax forax at univ-mlv.fr
Fri Sep 17 00:10:16 UTC 2021


Brian explicitly ask me to not talk about invokedynamic so i will not say that there is already an existing protocol between invokedynamic and a user defined implementation, it's the bootstrap method, 

Let's talk about the elephant in the room: macro. 
Templated Strings as currently defined is indiscernible from a hygienic String based macro system [1]. 

Using javac as an API (like jshell does), it seems trivial to come with something like EVAL."\(a) + \(b)" being able to evaluate at runtime any Java expressions. 

I'm not sure if it's a good thing or a bad thing. 

Rémi 

[1] https://en.wikipedia.org/wiki/Hygienic_macro 

> From: "Jim Laskey" <james.laskey at oracle.com>
> To: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Sent: Jeudi 16 Septembre 2021 15:28:41
> Subject: String Tapas Redux: Beyond mere string interpolation

> Amber experts,

> Now that JDK 17 has been plated and left the kitchen, we should have a look-see
> at one of the new menu items Brian and I have had on a slow boil for these last
> few months; Templated Strings.

> Before you start shouting out, "Templated Strings? This isn't what I ordered!
> The subject said string interpolation!!!", take the time to follow this link [
> https://github.com/openjdk/amber-docs/tree/master/site/design-notes/templated-strings.md
> |
> https://github.com/openjdk/amber-docs/tree/master/site/design-notes/templated-strings.md
> ] . After reading, we hope you'll see that the offering is much better than
> interpolation meat and potatoes.

> Cheers,

> -- Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210917/d2cd65f9/attachment.htm>


More information about the amber-spec-experts mailing list