title: How to compile an Erlang application into executable binary and run it?
body: <p>Now I am learning Erlang and I have a question about kind of running and testing Erlang applications.</p>
  
  <p>We have some views of running and testing Erlang programs: </p>
  
  <ol>
  <li>We can run Erlang shell and test in there our function.</li>
  <li>We can compile some files with our Erlang code, than create .app file, and then again run Erlang shell and call <code>application:start(AppName)</code>.</li>
  </ol>
  
  <p>My question: Can we make binary executable file from Erlang code, Like C code? How can I run programmes without Erlang shell, in a way that I can run program, input something command and after that calls Erlang functions for this command?</p>
  
  <p>For example I have a module (<code>test.erl</code>) with three functions:</p>
  
  <pre><code>foo1() -&gt; ...
  
  foo2() -&gt; ...
  
  foo3() -&gt; ...
  </code></pre>
  
  <p>Then I want to run the programme in terminal and input <code>-a</code> flag to call function <code>foo1</code>, <code>-b</code> flag for <code>foo2</code> and so on.</p>