# Module Aliasing ## Problem Elixir, Fez and Alpaca modules are prefixed have a fixed prefix and then a possible nested path of dot separated modules. Calling those modules from languages like Erlang, Efene, LFE, Clojerl and others implies writting the full name each time and quoting the atom to support uppercase and dots in the name. Note: erlang supported nested module names as an experimental feature that was later removed, this could be revisited here. ## Proposed Solution Standard way to alias modules to give them a shorter and language friendly name ## Solution 1: Module level aliasing with module attributes ```erlang -alias('Elixir.String', exString). ``` ### Pros * Simple to implement with a parse transform * Per module declaration of aliases ### Cons * Alias used frequently must be aliased on each module they are used + Not too different than imports in other languages ## Solution 2: rebar3 plugin rebar3 plugin that allows to specify the aliases at project level, possibly with a convention based conversion (for example, replace the language for a shorter one Elixir -> ex and the dots for underscores) provide a way to dump all the existing modules into a file to make manual changes later ### Pros * Less work for the user ### Cons ... ### Open Problems * how to handle nested module references from aliases @micmus on slack: It still leaves open the question of how elixir aliases allow working with nested modules, e.f. `alias Foo.Bar, as: Baz` and later `Baz.X` actually refers to `'Elixir.Foo.Bar.X'` module