improve use of using inline ...
#403
erikerlandson
started this conversation in
Ideas
Replies: 1 comment
-
currently I try to use lambda functions as the superclass whereever it makes sense, for example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@armanbilge made interesting use of
using inline
along with other inlined code, for example here:https://github.com/gemini-hlsw/lucuma-refined/blob/fa0b3d9a990e1ae94f56f1423473d95e6fcdc5f5/refined/src/main/scala/main/lucuma/refined.scala#L31
This is a discussion thread for re-visiting my thoughts about what (ideally) coulomb expressions "should" compile down to, and how close it is possible to get to that ideal.
I currently create in-line conversion coefficients, so that
coefficient_double[U1, U2]
compiles directly to a double literal, and in a world where I could get all the definitions maximally in-lined, and the jvm bytecode supported it, a conversion from U1 to U2 would always compile directly toc*v
wherec
is the coefficient constant andv
is the original value.Beta Was this translation helpful? Give feedback.
All reactions