concept disk in category elixir

appears as: disk, disk
Elixir in Action

This is an excerpt from Manning's book Elixir in Action.

Notice how you define a module directly in the shell. This is permitted and makes it possible to experiment without storing any files on disk.

This isn’t an accident. When you compile the source containing the Geometry module, the file generated on the disk is named Elixir.Geometry.beam, regardless of the name of the input source file. In fact, if multiple modules are defined in a single source file, the compiler will produce multiple .beam files that correspond to those modules. You can try this by calling the Elixir compiler (elixirc) from the command line

$ elixirc source.ex

where the file source.ex defines a couple of modules. Assuming there are no syntax errors, you’ll see multiple .beam files generated on the disk.

In the runtime, module names are aliases, and as I said, aliases are atoms. The first time you call the function of a module, BEAM tries to find the corresponding file on the disk. The VM looks for the file in the current folder and then in the code paths.