What is Mix in Elixir?
Answer
Mix is Elixir's build tool and project management system — the equivalent of npm/cargo/mix (or rake in Ruby). Key commands: mix new my_app: create a new project. mix compile: compile the project. mix test: run tests. mix deps.get: fetch dependencies (like npm install). mix run: run a script. mix phx.server: start a Phoenix server. mix ecto.migrate: run database migrations. Mix uses mix.exs for project configuration and dependencies (similar to package.json). Dependencies are fetched from Hex (Elixir's package registry, hex.pm). Custom mix tasks: defmodule Mix.Tasks.MyTask do; use Mix.Task; def run(_), do: IO.puts("hello"); end. Mix integrates with the broader OTP tooling and makes Elixir project management straightforward.
Previous
What is ExUnit in Elixir?
Next
What is the difference between send/receive and GenServer in Elixir?