-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generated code needs a prefix to prevent clash #153
Comments
For example if there was a default prefix (user definable or not) like
Generates this C code:
|
Looking through the code I can see that there is |
I can see that it's used in |
I'm not really sure if the cure isn't worse than the disease. The symbol prefix makes a big mess of things generally... it is possible to get a conflict but it's not easy and usually it's obvious what's happened. Having a prefix feature in the C output -- and camel casing -- is one of my biggest regrets in the C codegen. I'd rather just make the names more obscure or disallow user names that begin with cql_ or something. |
The problem is that with more language backends (more can come like go, c#, rust, pascal, ...) the chances of getting the same |
The reverse is also a problem. If you add prefixes then when calling into CQL from say lua it looks weird and you have to know the magic prefixes. If you're trying to find the procedure you have to search for something different. I've been living in that world for years and it's horrible. The prefix is not nearly as bad as the option to convert snake_case to PascalCase which I think was a true disaster... |
Still adding the rt support to LUA so that people have the option by configuring rt_common.c or adding an override in rt.c (which you're supposed to do with RT_EXTRA) is reasonable. It's a lot of work though... |
Id did an experiment trying to add a prefix to the
|
Hello my friend, I'm sorry but I was laid off today, so I won't be able to help land this. I don't know who will take over or how long before they come up for air and are able to look at OSS issues. |
Thank you for your contributions, it was a pleasure working with you. I may make a personal fork of this to make rico-ql but I dunno. |
Leaving the issue open and signing off. |
I'm sorry and I would be glad to continue cooperating in any OSS with you. |
After this reply #150 (comment) I started thinking about it and discovered that the code generated doesn't have any prefix and this can lead to name clash with internal function/variable names like:
Generates this Lua code:
Generates this C code:
The text was updated successfully, but these errors were encountered: