...

/

Generating Functions from External data

Generating Functions from External data

Explore how to use Elixir’s module system to embed data and behavior within modules directly from outside sources of information.

We'll cover the following...

We’ve performed compile-time code generation through careful use of macros. In this chapter, we will exploit Elixir’s module system. With advanced metaprogramming, we can embed data and behavior within modules directly from outside sources of information.

When we use Elixir’s module system, countless lines of boilerplate can be removed while producing highly optimized programs. First, we’ll explore how Elixir embeds an entire Unicode database at compile time for its robust Unicode support.

Next, we’ll build MIME-type validation and internationalization libraries, while applying compile-time optimizations that aren’t possible in many languages.

Note: Knowing when and where to use this technique ...