-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Investigate using math types in fj
crate
#122
Comments
Due to #193, a lot has changed since I opened this issue. Any investigation should include whether using the |
Shouldn't the intrinsic types from Trying to figure out where #246 is actually coming from has not been too much fun, yet. The values are going in as |
Yes. See my previous comment in this issue.
Yeah, you're right about that. I'm always careful about including stuff in |
fj
cratefj
crate
Updated issue title and description to reflect the current situation. |
I've experimented with this. The compile times of the star model go up from ~0.5s to ~1.5-1.6s when integrating the math types into I consider this issue blocked on #14, as we'd need some radical progress there, before we can attempt this again. |
|
Thank you for your comment, @LoganDark. I didn't know about Definitely worth experimenting with. |
Is there any particular reason why you couldn't use a sealed trait for this? AFAIK, it's definitely possible to smooth over the different structs using a trait. P.S. (slightly offtopic) is there some switch I can flip to make the newsletter send non-tracking links? |
That should work. More trait infrastructure could negatively affect compile times though. No idea if it would be an improvement in the end. Maybe there's a fundamental conflict here: Being generic over dimensions is valuable in the kernel, but probably less so in model code. Maybe it's a mistake to want to use the same library for both use cases, since the constraints are so different. Would be nice to have just one library, of course, but maybe that's not the best solution.
No, sorry. I would like to disable link tracking for the whole list, but my mailing list provider (MailerLite) doesn't support that. I contacted support about that a while ago. They acknowledged the feature request, but made no promises on how much of a priority that is going to be. Didn't seem worth switching providers over this issues, but I'd definitely prefer having no tracking at all in my emails. |
Would certainly be less of an impact than
Perhaps you could, drumroll please, have separate structs and then... use a trait in the kernel to smooth over both of them. :^) |
Good to know! I have to admit, I don't have great intuition about what kind of feature is going to incur how much of a compile-time cost.
I think that would be roughly the same as using two different libraries. And if we decided that having those smoothing-over-traits only available in the kernel would not be enough, it would turn into exactly the same as using two libraries 😄 Your suggestion about using |
Well, if you put the traits in the main math library with the rest of the stuff, it would turn into having one library.
I don't have any experience with |
P.S. did you actually notice |
I hadn't heard of |
This comment was marked as outdated.
This comment was marked as outdated.
I don't think that's right? According to crates.io, |
...Oh, I stand corrected. I guess I misread it as |
I've had an idea: We could move the math types into a new crate, say As a result, the kernel could keep using the math types with minimal change, but the By itself, this would be an incremental improvement. The math types are not any worse than using arrays for vectors and such, while reducing friction between models and kernel. Even increasing reliability, by using However, it may be possible to come up with some trait-based proxy approach, so models could call the math operations through the FFI boundary, without having to compile them. I'm not sure about that, as it's just a vague idea at this point. But if that's possible to do in a relatively low-friction way, there's the potential to use this technique for many other APIs beyond just math. |
This issue is no longer applicable. The affected code has been removed. See A New Direction for context. |
Right now, the
fj
crate doesn't use a math library, instead just using arrays to represent points and vectors. This works well enough for simple models, but might become inconvenient for more complex ones. I assume that any non-trivial model would benefit from a math library, and having to convert data types into arrays would be an inconvenience.Using the
math
module infj
seems like the obvious choice. It would need to be extracted into a separate library, but that is desirable anyway. We need to be careful though: To keep modeling productive, compile times are critical. I don't know, if addingmath
as a dependency infj
could cause models to compile more slowly.The text was updated successfully, but these errors were encountered: