Skip to content
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

Support Julia pre-v1.11? #35

Open
nsajko opened this issue Apr 24, 2024 · 6 comments
Open

Support Julia pre-v1.11? #35

nsajko opened this issue Apr 24, 2024 · 6 comments

Comments

@nsajko
Copy link
Collaborator

nsajko commented Apr 24, 2024

I think we could easily support Julia versions before v1.11 something like this: instead of defining struct FixedSizeArray directly at the top level, we could use @static if:

@static if VERSION < v"1.11-"
    struct FixedSizeArray{T,N} <: DenseArray{T,N}
        mem::Vector{T}
        size::NTuple{N,Int}
    end
    parent_type(::Type{<:FixedSizeArray{T}}) where {T} = Vector{T}
else
    struct FixedSizeArray{T,N} <: DenseArray{T,N}
        mem::Memory{T}
        size::NTuple{N,Int}
    end
    parent_type(::Type{<:FixedSizeArray{T}}) where {T} = Memory{T}
end

A downside is that this could complicate #33.

Given that Julia v1.11 seems to be getting released soon anyway, I'm not sure that it makes sense to do this, though.

@giordano
Copy link
Collaborator

That's a neat trick, but I'm not sure it's worth it. I think it's better to stick to Memory & Co. only, and forget about compatibility with older versions of Julia.

@nsajko nsajko closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@nsajko
Copy link
Collaborator Author

nsajko commented Apr 30, 2024

Actually, @static is not even necessary. A cleaner design than proposed above would simply introduce a single additional type parameter for the underlying storage type. This could fix this issue and #33 at the same time quite elegantly.

@nsajko
Copy link
Collaborator Author

nsajko commented Jul 10, 2024

@longemen3000 could you list some motivating points for doing this?

@longemen3000
Copy link

I want to use this library in one of my projects, but we have compatibility with Julia 1.6 (changing the minimum compat to 1.10 as soon as 1.11 is released), so adding this dependency would not be possible on those systems.

@nsajko
Copy link
Collaborator Author

nsajko commented Jul 10, 2024

Given that Julia v1.10 will become LTS (I think I read that somewhere?), perhaps we should support it in some manner.

On the other hand, perhaps our users could use the package extension mechanism, available in Julia v1.10, to work around the incompatibility themselves?

@longemen3000
Copy link

Given that Julia v1.10 will become LTS (I think I read that somewhere?), perhaps we should support it in some manner.

https://www.youtube.com/live/OQnHyHgs0Qo?si=vQ6y8gA2kUOBVx3F&t=4844

On the other hand, perhaps our users could use the package extension mechanism, available in Julia v1.10, to work around the incompatibility themselves?

that would work on direct users of FixedArrays, but not indirect users via indirect dependencies i think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants