# Call to write 1.9 extensions (and find pkgs that need those)

**URL:** <https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857>\
**Category:** Community\
**Tags:** package-extensions\
**Created:** [May 15, 2023, 2:38am UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857 "2023-05-15T02:38:48Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 16, 2023, 5:47pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/22 "2023-05-16T17:47:24Z")

</div>

Out of curiosity, what was the alternative you found?

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [May 16, 2023, 6:22pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/23 "2023-05-16T18:22:01Z")

</div>

I remodelled the struct to be more general (in my case a struct that among others used some caches, now generic caches).  
And I had to rethink/remodel a few functions that were working with said struct.

I am also not saying my original model was a good one (just because it was possible with Revise.jl), just that this rethinking and remodelling might be a con due to time constraints (eventually). So it might sometimes take a bit more time (especially when still learning details of extensions, which I definetly nearly know not much about).

---

<div class="post-metadata">

**Author:** ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Post date:** [May 16, 2023, 6:23pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/24 "2023-05-16T18:23:48Z")

</div>

Seems like `FileIO` can use extensions for different file formats, isn’t it?

---

<div class="post-metadata">

**Author:** ![Barget](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Barget](https://discourse.julialang.org/u/Barget)\
**Post date:** [May 17, 2023, 2:00pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/25 "2023-05-17T14:00:45Z")

</div>

> [@juliohm](#):
>
> My main concern with package extensions so far is that the LTS version doesn’t support it. I understand that we need to drop support of LTS to move forward with the new language feature.

Not exactly, it’s possible to keep a kind of [backward compatibility](https://pkgdocs.julialang.org/v1.9/creating-packages/#Backwards-compatibility), but this “requires” (pun intended) additional work, though.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [May 19, 2023, 6:45am UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/26 "2023-05-19T06:45:31Z")

</div>

If anyone can help on [Loading main package from higher-level env fails with extension of package in current env · Issue #49886 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/49886), it would be appreciated.

We moved to extensions in Plots in an effort to tidy up things, but the Ijulia problem might force us to go back to using Requires, and this is irritating.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [May 22, 2023, 12:49pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/27 "2023-05-22T12:49:05Z")

</div>

> [@Barget](#):
>
> Not exactly, it’s possible to keep a kind of [backward compatibility](https://pkgdocs.julialang.org/v1.9/creating-packages/#Backwards-compatibility), but this “requires” (pun intended) additional work, though.

It would be nice to have a package that defines a macro to handle this backward compatibility. To be honest, the package extensions functionality feels a bit hacky for someone looking at it for the first time.

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [May 22, 2023, 12:57pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/28 "2023-05-22T12:57:28Z")

</div>

Could someone with the expertise take a look at [MethodError in diff print: no method matching stat\_rep(::Nothing) · Issue #3327 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/3327)? This is leading to the invalidation check failing in two packages that I know of, which is stalling the work on package extensions. Presumably, other packages checking for invalidation using a standard script would also be impacted by this.

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [May 22, 2023, 4:25pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/29 "2023-05-22T16:25:09Z")

</div>

> [@juliohm](#):
>
> It would be nice to have a package that defines a macro to handle this backward compatibility.

> **[GitHub - cjdoris/PackageExtensionCompat.jl: Makes Julia's package extensions backwards...](https://github.com/cjdoris/PackageExtensionCompat.jl)**
>
> Makes Julia's package extensions backwards compatible

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [May 22, 2023, 4:59pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/30 "2023-05-22T16:59:21Z")

</div>

@cjdoris how would you adapt the following PR to use the PackageExtensionTools.jl?

> <https://github.com/JuliaML/DensityRatioEstimation.jl/pull/52>
>
> support for 1.9 extensions.
> there are some changes:
> \`Zygote\` -\> \`ChainRulesCor…e\` (more low level)
> \`CUArrays\` -\> \`GPUArrays\` (more general, \`CUArrays\` is deprecated in favor of \`CUDA\`, that uses \`GPUArrays\`)

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 22, 2023, 6:19pm UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/31 "2023-05-22T18:19:00Z")

</div>

> [@juliohm](#):
>
> the package extensions functionality feels a bit hacky for someone looking at it for the first time

Only if you also want to provide the functionality to earlier julia versions (through Requires). This part is hacky indeed.  
But package extensions by themselves look pretty clean, aside from a lot of unnecessary repetitions.  
Like, really?? `StructArraysStaticArraysExt = "StaticArrays"` [ref](https://github.com/JuliaArrays/StructArrays.jl/blob/b131762f199ab0ed079ea2723fdf0b9a457669b1/Project.toml#L22)

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [May 23, 2023, 3:41am UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/32 "2023-05-23T03:41:08Z")

</div>

> [@aplavin](#):
>
> But package extensions by themselves look pretty clean, aside from a lot of unnecessary repetitions.  
> Like, really?? `StructArraysStaticArraysExt = "StaticArrays"` [ref](https://github.com/JuliaArrays/StructArrays.jl/blob/b131762f199ab0ed079ea2723fdf0b9a457669b1/Project.toml#L22)

I remember that there was a reason for the long name, that pkgs could clash if pkg A and pkg B both load a C extension as `CExt`. Using `ACExt` and `BCExt` seems to disambiguate names. But i don’t know if this is still a problem on the current release

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [May 23, 2023, 10:16am UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/33 "2023-05-23T10:16:33Z")

</div>

Yeah, that was a PackageCompiler bug, didn’t affect normal usage of packages and is already fixed for some time ([ref](https://github.com/JuliaLang/PackageCompiler.jl/pull/805)).  
Another, remaining, case of repetition is the weakdep package name repetition (3x) in the common scenario of single-dependency extensions:

```julia
[weakdeps]
StaticArrays = ...

[extensions]
StaticArraysExt = "StaticArrays"

```

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [May 24, 2023, 2:13am UTC](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857/34 "2023-05-24T02:13:34Z")

</div>

from another thread: [Fixing Package Fragmentation - #94 by odow](https://discourse.julialang.org/t/fixing-package-fragmentation/98712/94)

[Previous page](https://discourse.julialang.org/t/call-to-write-1-9-extensions-and-find-pkgs-that-need-those/98857.md?page=1)
