Clue
Clue copied to clipboard
Compiler feature request
When I use Clue to generate lua, I found that the original comments are discarded, can the compiler add an option to keep the comments.
Is it really helpful and necessary? As I see it, Clue is like C code and Lua machine code, you need the comments in the original code (so inside the Clue files) but when you compile it you don't need them anymore (so inside Lua files). Another point is that right now the compiler does change the code, rearrange some thing, add new variables and etc... In the future it may do even some kind of optimization and thus making the original comments obsolete in the Lua code (although this does happen even now).
It could be done but I'm not sure if it would be useful, the output Lua code doesn't prioritize readability and can seem messy when compiling many files. I think it may be faster to read the output to identify the line in the Clue code, and continue debugging from there. (3.X may add better debugging too)
Is it really helpful and necessary? As I see it, Clue is like C code and Lua machine code, you need the comments in the original code (so inside the Clue files) but when you compile it you don't need them anymore (so inside Lua files). Another point is that right now the compiler does change the code, rearrange some thing, add new variables and etc... In the future it may do even some kind of optimization and thus making the original comments obsolete in the Lua code (although this does happen even now).
Yes, I agree, but it is useful in the following scenarios, such as we have multiple people developing lua. Not everyone has the hope of using Clue then convert to Lua, but some people want to use Clue. In order to ensure the unity of the code base language, we can let those who like to use Clue compile Lua code with comments.
It is true that some annotations can complicate the implementation:
like. some comments in expression or some comments in block
match expr {
1 => {
...
}
2 || 3 => /*this is comments*/ {
...
}
}
I think in this case it is better to develop a library in Clue with all the comments and everything else and from Lua use the compiled version of that library
What should be done of this issue?
After a few days of using clue a lot in the project, I feel that this feature is useless if we implement our own language server and debug server. Our project team has reached an agreement to use clue for development.
In addition, we found that some other features may be useful:
- Language server (3.0?)
- Debug server (we use luapanda to debug now)
- Documentation generator (generate documentation from comments, like luadoc or typedoc)
After a few days of using clue a lot in the project, I feel that this feature is useless if we implement our own language server and debug server. Our project team has reached an agreement to use clue for development.
In addition, we found that some other features may be useful:
- Language server (3.0?)
- Debug server (we use luapanda to debug now)
- Documentation generator (generate documentation from comments, like luadoc or typedoc)
we are considering to make a language server in the future but we haven’t really discussed the about the rest. Also a language sever would require changes to how the parser works.
The documentation generator could be added in 3.1
For the language server...I'm planning to do a beta before 4.0
Some initial progress is being made on the language server, but it's still mostly planning for now.
The documentation generator on the other hand will have to be delayed as 3.1 became unexpectedly too big