How To Run Pure Erlang Functions In Elixir — Tentamen Software Testing Blog

Erlang base64 Pure function in Elixir

TL;DR

In the previous post, we presented how to run modules and functions in runtime. Elixir is integrated with Erlang. Today we present how to run pure Erlang functions from Elixir. This post is part of the functional language series, and it is based on the remarkable book Elixir In Action by Sasa Juric.

Pure Erlang Function

In the previous post we used our first pure Erlang function from Elixir:

Before inventing the wheel in your own Module, first, search for that functionality in Erlang Module

Dynamic Execution

Elixir is a static language because it requires compilation before execution. But it is possible to execute an Elixir function in runtime using the function. You will see a lot of this function in stack traces, during the development of your future applications.

Elixir dynamic execution using Kernel apply function.

Remember

  • find Erlang Module
  • use its name as an atom
  • how to dynamically execute Elixir function

Originally published at https://blog.tentamen.eu on November 11, 2020.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store