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

Support template literals #466

Open
vgrichina opened this issue Feb 6, 2019 · 5 comments
Open

Support template literals #466

vgrichina opened this issue Feb 6, 2019 · 5 comments

Comments

@vgrichina
Copy link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Regular template literals would be very nice for stuff like logging, so that you can basically have stuff like:

log(`transaction: ${hash} status: ${status}`);

instead of current

log('transaction: ' + hash.toString() + ' status: ' + status.toString());

This looks like a feature which only requires compiler-level sugar and zero runtime support.

More than that, we probably can hijack tagged templated literals to support UTF-8 string literals, i.e. have stuff like:

let utf8String = u`Hello, World`;
@mdaj06
Copy link

mdaj06 commented Mar 5, 2021

@dcodeIO can i have a look at it?

@vgrichina
Copy link
Author

@mdaj06 BTW this issue is something we are interested to give grant for:
https://gov.near.org/t/assemblyscript-grant-q1-2021/697/3

@mdaj06
Copy link

mdaj06 commented Mar 16, 2021

sure got it!

@MaxGraey
Copy link
Member

Template literals mostly finished: #1715

@dcodeIO
Copy link
Member

dcodeIO commented Mar 26, 2021

Initial support for template literals has been merged now, with tagged template literals not enabled just yet due to having to account for an edge case first, which requires implementing ReadonlyArray.

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

No branches or pull requests

4 participants