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

Compiler feature request #41

Open
progmboy opened this issue Oct 20, 2022 · 10 comments
Open

Compiler feature request #41

progmboy opened this issue Oct 20, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@progmboy
Copy link
Contributor

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.

@Enn3Developer
Copy link
Member

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).

@Maiori44
Copy link
Member

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)

@Maiori44 Maiori44 added the enhancement New feature or request label Oct 20, 2022
@progmboy
Copy link
Contributor Author

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*/ {
        ...
    }
}

@Enn3Developer
Copy link
Member

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

@Maiori44
Copy link
Member

What should be done of this issue?

@progmboy
Copy link
Contributor Author

progmboy commented Nov 28, 2022

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:

  1. Language server (3.0?)
  2. Debug server (we use luapanda to debug now)
  3. Documentation generator (generate documentation from comments, like luadoc or typedoc)

@Markos-Th09
Copy link
Member

Markos-Th09 commented Nov 28, 2022

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:

  1. Language server (3.0?)
  2. Debug server (we use luapanda to debug now)
  3. 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.

@Maiori44
Copy link
Member

The documentation generator could be added in 3.1

For the language server...I'm planning to do a beta before 4.0

@Maiori44 Maiori44 added this to the 3.1 milestone Nov 29, 2022
@Maiori44
Copy link
Member

Some initial progress is being made on the language server, but it's still mostly planning for now.

@Maiori44
Copy link
Member

The documentation generator on the other hand will have to be delayed as 3.1 became unexpectedly too big

@Maiori44 Maiori44 removed this from the 3.1 milestone Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants