-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Expose the pony version during compile time #104
Comments
There are at least two ways how to approach this problem: Custom Defines The first way would be using custom defined with the ponyc flag
one for each level of the version number. Defines with Values The external defines would not needed to be added over and over again if ponyc would set those defines on its own. It would be even better if those defines had a value that could be used in some more involved statement for conditional compilation:
Then those conditional statements could be used to maintain one codebase for multiple pony versions and make it easy to use it as a package. |
I'm wondering. @jemc @mfelsche, is there a reason that if we added compile time expressions that this wouldn't be possible? Something like I have worries about this as a general feature, but I am interested if compile time expressions could make this possible if we exposed the version values. |
During sync, I mentioned concerns about how we would support from a "typecheck everything". Do I need multiple ponyc compilation environments? Joe mentioned "how do we support if there's a syntax change in the compiler". I think the easiest thing would be a c preprocessor type functionality but that is a mess unto itself. |
This would make conditional compilation possible as we currently have for the platform (windows, darwin, linux, ...) but for different pony versions for which there might exist breaking changes in the stdlib or the comper itself.
This would make it possible to maintain compatibility between different pony versions within one codebase.
The text was updated successfully, but these errors were encountered: