-
Notifications
You must be signed in to change notification settings - Fork 6
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
Introduce UnsupportedPlatformError
#25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code as-is LGTM.
For a discussion over beverages, not to hold up present progress.
Since we have LinktimeInfo and alternate compilation paths, I probably
would have introduced a compile time error with a good comment, on
the "Unsupported" path. That would inform the developer earlier in the cycle.
Right now, the "throw" code looks like a runtime error and quacks like
a link error.
Scala does not have C's "#error". Sometime when I am not at my work machine
and am spending time on the cell phone, I can rat around and see what the
current Scala 2 & 3 conventions are.
FYI & for future reference , not to hold up current rapid & welcome progress. Scala 3: https://docs.scala-lang.org/scala3/guides/macros/compiletime.html
Doubtful that there is something similar in scala 2. Perhaps a good comment and the compilation error of |
Thanks for your ideas. Actually I would like to be thoughtful about this proposal.
I am not entirely sure how this would work. I am almost certain we want a link-time error: the problem is, we are publishing pre-compiled artifacts. So when a developer wants to build an application with the epollcat dependency, they will not be compiling our code, only linking it. So our only opportunity to stop them will be at link time. I do agree it would be nice if we could directly inject a link-time error (similar to how in Scala 3 we can inject a compile-time error) instead this "hack". But I do not think that's possible. |
Ah, now I understand. Concern resolved, thank you for your patience. I have been building too many things How does the larger ecosystem deal with less-than-universal artifacts. Say for |
Yes, I think for less-than-universal artifacts they are published separate under different names. We are operating in bit of a strange space: we are distributing compiled artifacts, but they have been compiled to NIR and not yet to platform-specific code. Thus platform-specific differences are resolved at linking time. This is unlike C for example, where platform issues are resolved at compile-time via preprocessor macros. |
This will be helpful for the
else
case of conditional linking statements we will use for #2.