-
Notifications
You must be signed in to change notification settings - Fork 23
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
asm/emit syntax: explicit capture of symbols; heredoc string litterals; syntax highlight hints #210
Comments
there are 2 separate parts to this proposal part 1: symbol capture via
|
-1 from me and I already debunked point (4). If it's easy to find a token that is not in the string literal you can simply use const
TripleQuote = "\"\"\""
"""string
UNUSED
literal
""".replace("UNUSED", TripleQuote)
We can add TripleQuote to strutils if enough people think it's valuable. No lexer additions required. |
I am thinking about editor support right now, in the terms of, the editor detects that there is an emit statement, and it should emit C code. Then for the C code it would be great to highlight with C syntax highlighting. But for this to work the editor would need to detect that the string literal is actually C code, not just a generic block string literal. Therefore I suggest that the emitC(efHere, [s, T]):
s = sizeof(T); // remember, this is C's code without quotes in Nim code Not entirely sure if this works though. The idea here is, that the editor could detect the |
Why do we need an even more powerful emit statement though? Why not let Nim be a real language that compiles via C or LLVM to binary code. |
The reason Scala is a successful language is, it plays nice with an existing Java codebase. The reason C++ is successful is, it plays nice with an existing C codebase. The reason typescript is successful is, it plays nice with an existing javascript codebase. The reason Nim is successful is ... No wait, Nim isn't successful, because nice C and C++ integration has been removed in order to make it a "real language". Yes, there is a price for this emit. But it is worth it. |
Please don't delete my comments just because you don't feel comfortable with it. |
I delete them because it's pure trolling, Scala and C++ do not even have emit to begin with. |
C++ also don't have an emit. What an argument. |
Yet Nim needs an even better emit in order to be successful. Your argument, not mine. |
Yes. |
Every improvement matters.
|
A minimum of effort has to be put into RFCs, every clear RFC matters. Just look at the title -- "asm/emit syntax: explicit capture of symbols; heredoc string litterals; syntax highlight hints", that's not an RFC, that's a figleaf for your PR. If you want better string literals, there is an existing RFC for that, see #161 If you want typo-safe emit sections, write an RFC for that and outline how future code generators can deal with it. |
I know that's exactly what I pointed out in my reply to top post, see #210 (comment)
will get to it and clean up this RFC (please don't close in meantime)
no disagreement there |
The meantime is now 6 months. Closing. |
discussing here @krux02 proposal for new asm/emit syntax (from nim-lang/Nim#13953 (comment))
I will comment below on this
The text was updated successfully, but these errors were encountered: