# Cross platform package and package naming guidelines

**URL:** <https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506>\
**Category:** Package Management\
**Tags:** package, cross-platform\
**Created:** [June 7, 2021, 10:22am UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506 "2021-06-07T10:22:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [June 7, 2021, 10:22am UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/1 "2021-06-07T10:22:52Z")

</div>

I would like to create Github-repo **`erjulix`** for a package **`Erjulix`** which makes it possible to send messages/data from Erlang/Elixir to Julia and back and call functions or eval expressions cross-platform. The functionality is doable as my local tests show.

It should be ideally one repo and one package for Julia and Elixir. Now I have to follow some conventions when naming the package directory and the Github repo:

- the top-level package directory name must be lowercase for Elixir,
- module names in Elixir must be capitalized and written in `CamelCase`
- the Github repo should not have a `.jl` extension since it is not a pure Julia package.

The subdirectory structure and file naming seems to work. The Julia module would be` src/Erjulix.jl`, the module name in Julia and Elixir both would be `Erjulix`.

Now **my question is** : is it mandatory in Julia that

- the GitHub repo has a .jl extension like `MyPackage.jl`,
- the repo name, top-level module file name and module name must match each other (`MyPackage`) or can they be different,
- Julia module names must be capitalized

or would it be sufficient as mentioned in the [General README](https://github.com/JuliaRegistries/General) that I explain why I don’t follow those conventions?

Any other suggestions?

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 7, 2021, 11:19am UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/2 "2021-06-07T11:19:35Z")

</div>

Cool project! More language interopereability is fantastic. I don’t know the specific answer to your question - I _think_ the package manager doesn’t care about the parent directory, just that there’s a file name in `src` that matches the module name, and that both of those match what’s in the `Project.toml`, but I’m only like 60% confident.

I’m curious why a single repo is desired though - do the packages call code from one another?

---

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [June 7, 2021, 1:38pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/3 "2021-06-07T13:38:34Z")

</div>

> [@kevbonham](#):
>
> I’m curious why a single repo is desired though - do the packages call code from one another?

Mainly for simplicity and maintainability! For example, if the main application is a web server in Phoenix and wants to use Julia for stats, analysis and plotting, it may want to start a Julia session and server. This is easier if everything is in the same file tree. No, there is no shared code. Everything is done by messaging, Julia tasks and BEAM processes talking to each other via sockets.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 7, 2021, 1:46pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/4 "2021-06-07T13:46:41Z")

</div>

> [@pbayer](#):
>
> - the GitHub repo has a .jl extension like `MyPackage.jl`

This is not required for packages in subdirectories, where it is expected that there are other constraints on the repo naming.

> [@kevbonham](#):
>
> I _think_ the package manager doesn’t care about the parent directory, just that there’s a file name in `src` that matches the module name, and that both of those match what’s in the `Project.toml` , but I’m only like 60% confident.

That is all correct.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 7, 2021, 2:38pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/5 "2021-06-07T14:38:04Z")

</div>

For a somewhat similar example, I have made dual Julia/Python libraries at work with the general repo structure:

```julia
├── julia
│ ├── Project.toml
│ ├── src
│ │ └── MyPackage.jl
│ └── test
│ └── runtests.jl
├── python
│ ├── mypackage
│ │ ├── __init__.py
│ │ └── mypackage.py
│ ├── setup.py
│ └── tests
└── README.md

```

Being proprietary they are obviously not registered in General but in the company local registry (and in the local `devpi` server for the Python packages). From a technical point of view this works without a hitch.

---

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [June 7, 2021, 3:43pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/6 "2021-06-07T15:43:29Z")

</div>

Thank you very much. I also found the following remark in the [Julia Registrator README](https://github.com/JuliaRegistries/Registrator.jl#registering-a-package-in-a-subdirectory):

> ### Registering a package in a subdirectory
> 
> If the package you want to register is in a subdirectory of your git repository, you can tell Registrator to register it by adding the `subdir` argument to your trigger, e.g. `@JuliaRegistrator register subdir=path/to/my/package‘ .

But currently I have Julia, Erlang and Elixir files side by side in one structure:

```julia
erjulix
├── Project.toml
├── README.md
├── lib
│ └── erjulix.ex
├── mix.exs
├── mix.lock
├── src
│ ├── Erjulix.jl
│ ├── ejx_udp.erl
└── test
    ├── erjulix_test.exs
    ├── runtests.jl
    └── test_helper.exs

```

This works/compiles as an Elixir app. With your comments above this should work/register as a Julia package too. Right?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [June 7, 2021, 4:24pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/7 "2021-06-07T16:24:05Z")

</div>

Yes. The Julia package will contain all the elixir files as well, which is fine if that’s how you intend it. With this file structure it’s not a subdirectory package, so AutoMerge will complain if the repository name doesn’t have the `.jl` suffix. That doesn’t mean it’s not allowed but it will require some manual intervention and possibly convincing the General registry maintainers that there are good reasons for it.

Update: I was thinking `erjulix` was a repository name but maybe it’s a directory name. In the latter case the Julia package would indeed be a subdirectory package, inside `erjulix`.

---

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [June 7, 2021, 7:29pm UTC](https://discourse.julialang.org/t/cross-platform-package-and-package-naming-guidelines/62506/8 "2021-06-07T19:29:51Z")

</div>

Thank you again. Now I created the [erjulix](https://github.com/pbayer/erjulix) repo. It is – again for simplicity – both repo and directory.

> [@GunnarFarneback](#):
>
> it will require some manual intervention and possibly convincing the General registry maintainers that there are good reasons for it.

I will do my best to convince them 😀.
