What does the contents of the _build folder mean?

Hi!

I’m a beginner in Elixir and I just did a simple project using mix tool. After I compile the project I saw thant a folder called _build was created, but I didn’t understand what the files inside it means. I imagine it’s the files that run on BEAM or something. Is that right?

Thank you.

1 Like

Elixir is a compiled language. _build will contain the build artifacts. This includes the built code (.beam files), NIF binaries/libraries, contents of the priv directories of dependencies, files related to Mix releases, etc.

5 Likes

It contains the compiled bytecode. Note that Erlang/Elixir compile to an intermediate bytecode which is then interpreted in real-time after the program is started – sort of like Java and C# / .NET.

4 Likes

Go it. Thanks!

Thanks for the answer

On top of the other answers, it is what gets compiled when you run mix compile or iex -S mix.
Run mix compile twice and the last time it will do nothing, because everything has been compiled already and placed in that _build folder. Edit a file, and it will update whatever needs to be updated. Delete a file in _build, or the whole folder, and run mix compile again, and the compiler will compile whatever is missing.

2 Likes

Thanks for the add-on.

1 Like