Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Xtend use Java multi-line strings for Xtend multi-line strngs if Java 17 is the target version #3091

Open
rubenporras opened this issue Jun 19, 2024 · 2 comments

Comments

@rubenporras
Copy link
Contributor

I have noticed that Xtend does not use Java multi-line strings for Xtend multi-line strings, even if Java 17 is the target version.

This incurs in an overhead because strings which could be constants need to be constructed at runtime, which can as well created duplicated strings, even if the resulting string is always the same.

Have I missed some configuration option or is this not implemented? If so, any plans on implementing it?

@LorenzoBettini
Copy link
Contributor

That's something I had in mind to work on if @szarnekow thinks it's worthwhile. I've always forgotten to open an issue, though.

Note however that a direct translation into text blocks (I think that's what you meant) is not always possible I guess, especially in the presence of nested if and loops.

Moreover, Java text blocks always end with \n, while Xtend template strings use the OS' end of line, so that's something we should discuss first, I guess.

@rubenporras
Copy link
Contributor Author

Note however that a direct translation into text blocks (I think that's what you meant) is not always possible I guess, especially in the presence of nested if and loops.

Yes, that what I meant, thanks.

What is the problem with nested if and loops if the text block is constant?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants