A series of exercises for Elixir newcomers to practice with language basics and local development.
There are a lot of quality sources for learning Elixir out there, the top of which being the official documentation. Spirit was specifically developed with these goals in mind:
-
Complement the official docs: the exercises follow the same order as the official Elixir Getting Started guide. If you are new to Elixir, we would love to encourage you to get used to referring to the documentation as early in your Elixir learning journey as possible.
-
Practice in a real-life environment: instead of writing code in an artificial environment (like web-based learning platforms), your workflow with Spirit would closely match working with any Elixir (or Phoenix) project, giving you means of not only practicing with the language but also getting used to the project structure and builtin tooling.
Make sure you have Elixir 1.17 and Erlang/OTP 27 installed. The recommended method of installation is via asdf.
To start using Spirit, clone this repo (or fork it first if you would like). Then, the workflow should go as follows:
-
Read a section in the guide (e.g., Basic Types)
-
Generate the section's exercises and tests using the Mix task
spirit.gen
(e.g.,mix spirit.gen basic_types
) -
Solve the exercises in the generated module
-
Run the tests with
mix test
-
Repeat steps 3 & 4 until all the tests pass
-
Proceed to the next guide
-
You can use the Mix task
spirit.intro
to print the instructions above in your terminal. Simply runmix spirit.intro
when you are in the project root. -
Running
iex -S mix
in your terminal will compile your code and open an interactive REPL that you can use for quick-and-dirty experimentation or testing with the modules.
Contributions are welcome! And there is more than one way to help with the main project or the exercise material. Please read our contribution guide to learn more if you are interested.