-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[macro] How likely TypeScript will consider adding macro in the future #50815
Comments
Polo? |
Assuming you mean macro, then #4892. |
I initially assumed this is about macros too, but the phrasing is... very odd.
Given the commitment to this odd phrasing (and conspicuous capitalization of Marco) in an otherwise well-written issue, I'm left to ask either or both of these questions:
|
nah, I just typed everything wrong. Didn't mean't Macro Poll. |
Okay, now you're just doing it on purpose. 😉 |
I think macros probably fall under "non-ECMAScript syntax with JavaScript output", but I'm not positive. It does seem like a bit of a gray area w.r.t. the TS design goals. |
Thanks for sharing (just realized the reason I didn't find related issues on macros is that I typed it as marcos). I read through the issue and found some related topics or comments on this one:
After reading through the above issue still haven't found any positive or negative responses from the team 😭 I guess this proposal is already been refused a long time ago. |
I'm confused. You correctly identified
but then you check
in the viability checklist. Besides that, I find it highly unlikely to expect anything like this in the next 5 years, if ever. |
The most likely outcome, by a very large margin, is that macros are not happening. We've looked into this in the past and it doesn't seem like there's any tractable path that doesn't violate critical design constraints. If you macro with existing syntax (like how C's preprocessor works), there's a violation of the "all JS is TS" principle, plus it's super weird (what happens if you indirect a macro function?). If you macro with novel syntax, then there's a problem of how you even parse a file, especially in contexts like tooling where you expect to be able to open a TS file and get reasonable behavior without knowing the entire project context. |
Suggestion
I believe the team of TypeScript definitely has considered related topics about macro in the past. Since we do not have macro right now in TypeScript, there must be some concerns or flaws about macro. I am actually kind of curious and want to know a few reasons why not having macro today.
I can guess a few points so far:
I personally wish to have macro to increase readability while writing TypeScript.
🔍 Search Terms
macro
✅ Viability Checklist
My suggestion meets these guidelines:
📃 Motivating Example
TBD
💻 Use Cases
TBD
The text was updated successfully, but these errors were encountered: