<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="64197" data-post-id="64197">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bbense" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bbense/120/1074_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bbense
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Insert semi made up quote about “Every sufficiently concurrent program includes a buggy half-implemented version of the BEAM”.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64197" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-64197" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64197"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="64258" data-post-id="64258">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Justin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Justin/120/11330_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Justin
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My concern was not the theory or benefits of Elixir. My question was about where the rubber meets the road.</p>
<p>In a simple real world example, you have a task to query and join a half dozen different data sources, perform a bunch of arbitrary logic and output something. In Elixir, would that simply be a set that you pipe thru a ton of functions?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64258" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-64258" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64258"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="64286" data-post-id="64286">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aseigo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aseigo/120/10674_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aseigo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Justin" data-post="13" data-topic="11196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/justin/48/11330_2.png" class="avatar"> Justin:</div>
<blockquote>
<p>you have a task to query and join a half dozen different data sources, perform a bunch of arbitrary logic and output something. In Elixir, would that simply be a set that you pipe thru a ton of functions?</p>
</blockquote>
</aside>
<p>That is the essence of functional programming in the rough, yes. You have functions which take data as input and return some value as a result. So you could describe any / all functional programs in the way you have.</p>
<p>Where it gets more interesting in this case is in the details of the “how” with Elixir. For instance, querying a handful of data sources: this is trivial to do in parallel with Elixir by putting each query into its own process. You may choose to do this with one-off usage of <code>Task</code>s, or you might create GenServers that are re-used between queries. You may even create a worker pool to limit the number of queries being made in parallel. (The latter is what Ecto does behind the scenes.)</p>
<p>Those processes would then preferably be monitored by a Supervisor (or by just manually linking, via <code>spawn_link</code> e.g.), so that if something goes wrong in one of them they can be restarted / retried, or even abort the parent process that is doing the top-level task.</p>
<p>Depending on the shape of the data being processed, the “arbitrary logic” you mention can be written elegantly using Elixir’s facilities for pattern matching, pipelining using the <code>|&gt;</code> operator, etc.</p>
<p>You can then very easily turn that into a distributed application where a bunch of computers (high end servers or clusters of little RPi’s even) work on that task together.</p>
<p>So .. while you could describe it as a “ton of functions”, and you could literally write it that way, there is a lot more in the toolbox. Personally, that toolbox added on top of FP, great tooling, etc. is what makes Elixir so exciting.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64286" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-64286" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64286"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="64360" data-post-id="64360">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Justin" data-post="13" data-topic="11196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/justin/48/11330_2.png" class="avatar"> Justin:</div>
<blockquote>
<p>In Elixir, would that simply be a set that you pipe thru a ton of functions?</p>
</blockquote>
</aside>
<p>Pretty much - for example:</p>
<pre data-code-wrap="Elixir"><code class="lang-Elixir">defmodule Summary  do
  defstruct order_id: 0, items: [], customer_name: "", date: Date.utc_today()

  defp cons_description(order_id),
    do:
      fn
        (%Item{order_id: id, item: description}, items) when id === order_id -&gt;
          [description | items]
        (_, items) -&gt;
          items
      end

  defp gather_descriptions(items, order_id),
    do: List.foldl(items, [], cons_description(order_id))

  defp find_customer(customers, customer_id),
    do: Enum.find(customers, fn(%Customer{id: id}) -&gt; id === customer_id end)

  defp lookup_name(customers, id) do
    with %Customer{name: name} &lt;- find_customer(customers, id) do
      name
    else
      _ -&gt; "N.A."
    end
  end

  def summarize_order(items, customers) do
    fn(%Order{id: order_id, customer_id: customer_id, date: date}) -&gt;
      %Summary{
        order_id: order_id,
        items: gather_descriptions(items, order_id),
        customer_name: lookup_name(customers, customer_id),
        date: date
      }
    end
end

  def from(orders, items, customers) do
    orders
    |&gt; Enum.map(summarize_order(items, customers))
  end
end
</code></pre>
<pre data-code-wrap="shell"><code class="lang-shell">$ elixir demo.exs
Customers:
[%Customer{id: 1, name: "Samson Bowman"},
 %Customer{id: 2, name: "Zelda Graves"}, 
 %Customer{id: 3, name: "Noah Hensley"},
 %Customer{id: 4, name: "Noelle Haynes"},
 %Customer{id: 5, name: "Paloma Deleon"}]
Orders:
[%Order{customer_id: 3, date: ~D[2014-03-20], id: 1},
 %Order{customer_id: 4, date: ~D[2014-04-25], id: 2},
 %Order{customer_id: 5, date: ~D[2014-07-17], id: 3},
 %Order{customer_id: 2, date: ~D[2014-01-05], id: 4},
 %Order{customer_id: 5, date: ~D[2014-06-09], id: 5}]
Items:
[%Item{item: "gum", order_id: 2}, %Item{item: "sandals", order_id: 4},
 %Item{item: "pen", order_id: 3}, %Item{item: "gum", order_id: 1},
 %Item{item: "pen", order_id: 2}, %Item{item: "chips", order_id: 3},
 %Item{item: "pop", order_id: 1}, %Item{item: "chips", order_id: 5}]
Summaries:
[%Summary{customer_name: "Noah Hensley", order_id: 1, date: "2014-03-20", items:
 ["pop","gum"]},
 %Summary{customer_name: "Noelle Haynes", order_id: 2, date: "2014-04-25", items:
 ["pen","gum"]},
 %Summary{customer_name: "Paloma Deleon", order_id: 3, date: "2014-07-17", items:
 ["chips","pen"]},
 %Summary{customer_name: "Zelda Graves", order_id: 4, date: "2014-01-05", items:
 ["sandals"]},
 %Summary{customer_name: "Paloma Deleon", order_id: 5, date: "2014-06-09", items:
 ["chips"]}]
$
</code></pre>
<p>Full code (with alternate Summary module):</p>
<pre data-code-wrap="Elixir"><code class="lang-Elixir"># https://stackoverflow.com/questions/25438893/haskell-how-to-implement-sql-like-operations#answer-25438952

defmodule Customer do
  defstruct id: 0, name: "First Last"

  def new(id, name),
    do:
      %Customer{
        id: id,
        name: name
      }
end

defmodule Order do
  defstruct id: 0, customer_id: 0, date: Date.utc_today()

  def new(id, customer_id, date),
    do:
      %Order{
        id: id,
        customer_id: customer_id,
        date: date
      }
end

defmodule Item do
  defstruct order_id: 0, item: "Description"

  def new(order_id, item),
    do:
      %Item{
        order_id: order_id,
        item: item
      }
end

defmodule Summary  do
  defstruct order_id: 0, items: [], customer_name: "", date: Date.utc_today()

  defp cons_description(%Item{order_id: id, item: description}, m),
    do: Map.update(m, id, [description], &amp;([description|&amp;1]))

  defp make_descriptions_map(items),
    do: List.foldl(items, Map.new(), &amp;cons_description/2)

  defp put_name(%Customer{id: id, name: name}, m),
    do: Map.put(m, id, name)

  defp make_names_map(names),
    do: List.foldl(names, Map.new(), &amp;put_name/2)

  def summarize_order(items, customers) do
    descriptions = make_descriptions_map(items)
    names = make_names_map(customers)

    fn(%Order{id: order_id, customer_id: customer_id, date: date}) -&gt;
      %Summary{
        order_id: order_id,
        items: Map.get(descriptions, order_id, []),
        customer_name: Map.get(names, customer_id, "N.A."),
        date: date
      }
    end
  end

  def from(orders, items, customers),
    do: Enum.map(orders, summarize_order(items, customers))

end

defimpl Inspect, for: Summary do
  import Inspect.Algebra

  def inspect(summary, opts) do
    concat [
      "%Summary{customer_name: ",
      to_doc(summary.customer_name, opts),
      ", order_id: ",
      to_doc(summary.order_id, opts),
      ", date: ",
      to_doc(Date.to_iso8601(summary.date), opts),
      ", items: ",
      to_doc(summary.items, opts),
      "}"
    ]
  end
end

defmodule Demo do

  defp make_customers,
    do: [
      Customer.new(1, "Samson Bowman"),
      Customer.new(2, "Zelda Graves"),
      Customer.new(3, "Noah Hensley"),
      Customer.new(4, "Noelle Haynes"),
      Customer.new(5, "Paloma Deleon")
    ]

  def to_date(year,month,day) do
    with {:ok, date} &lt;- Date.new(year, month, day) do
      date
    else
      _ -&gt; Date.utc_today()
    end
  end

  def make_order(id, customer_id, year, month, day),
    do: Order.new(id, customer_id, to_date(year, month, day))

  defp make_orders,
    do: [
      make_order(1, 3, 2014, 3, 20),
      make_order(2, 4, 2014, 4, 25),
      make_order(3, 5, 2014, 7, 17),
      make_order(4, 2, 2014, 1, 5),
      make_order(5, 5, 2014, 6, 9)
    ]

  defp make_items,
    do: [
      Item.new(2, "gum"),
      Item.new(4, "sandals"),
      Item.new(3, "pen"),
      Item.new(1, "gum"),
      Item.new(2, "pen"),
      Item.new(3, "chips"),
      Item.new(1, "pop"),
      Item.new(5, "chips")
    ]

  def run() do
    customers = make_customers()
    orders = make_orders()
    items = make_items()

    IO.puts("Customers:")
    IO.inspect(customers)
    IO.puts("Orders:")
    IO.inspect(orders)
    IO.puts("Items:")
    IO.inspect(items)

    IO.puts("Summaries:")
    IO.inspect(Summary.from(orders, items, customers))
  end

end

Demo.run()
</code></pre>
<p>One thing to keep in mind is that functional programming is “value-oriented programming” while imperative programming is largely PLace-Oriented Programming (PLOP) due to the fact that it heavily relies on mutable state (locations). See Rich Hickey’s <a href="https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ValueOfValues.md" rel="noopener nofollow ugc">Value of Values</a> talk.</p>
<p>Ultimately value based computations compose better (again Rich Hickey <a href="https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/SimpleMadeEasy.md%7D" rel="noopener nofollow ugc">Simple made Easy</a>).</p>
<p>The preceding demonstration code is entirely <em>sequential</em>. As already mentioned with BEAM languages exploiting <em>concurrency</em> relentlessly is always an <strong><em>option</em></strong>. For example for the lifetime of the script:</p>
<ul>
<li>one process could steward the customer list and be responsible for looking up the customer <code>name</code> by <code>customer_id</code>.</li>
<li>another process could steward the items list and be responsible for serving the list of item descriptions for a particular <code>order_id</code>.</li>
<li>each order record could be serviced by it’s own process, returning the completed summary upon termination.</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64360" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-64360" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64360"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="64368" data-post-id="64368">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MikeAnthony" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MikeAnthony
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Justin" data-post="13" data-topic="11196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/justin/48/11330_2.png" class="avatar"> Justin:</div>
<blockquote>
<p>My concern was not the theory or benefits of Elixir. My question was about where the rubber meets the road.</p>
</blockquote>
</aside>
<p>I wouldn’t buy anymore books. You are a kindred spirit as practical is how I really learn and 90% of the books on programming SUCK for that.  I found Google better for finding practical tutorials and Udemy had a slightly helpful video series.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64368" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-64368" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64368"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="64390" data-post-id="64390">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Justin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Justin/120/11330_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Justin
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Google is great when you just want to get something done. Books have their use too. They can help to answer questions you didn’t even know to ask.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="64390" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-64390" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="64390"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="66931" data-post-id="66931">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="DevotionGeo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/DevotionGeo/120/20538_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  DevotionGeo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="bbense" data-post="12" data-topic="11196" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bbense/48/1074_2.png" class="avatar"> bbense:</div>
<blockquote>
<p>Insert semi made up quote about “Every sufficiently concurrent program includes a buggy half-implemented version of the BEAM”.</p>
</blockquote>
</aside>
<p>Who said that quote? Looks like I will say this quote in some of my Quora answers in near future!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66931" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-66931" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66931"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="66932" data-post-id="66932">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="gon782" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  gon782
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="DevotionGeo" data-post="18" data-topic="11196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/devotiongeo/48/20538_2.png" class="avatar"> DevotionGeo:</div>
<blockquote>
<p>Who said that quote? Looks like I will say this quote in some of my Quora answers in near future!</p>
</blockquote>
</aside>
<aside class="onebox allowlistedgeneric" data-onebox-src="http://rvirding.blogspot.com/2008/01/virdings-first-rule-of-programming.html">
  <header class="source">
      <img src="https://forum.elixirforum.com/uploads/default/original/2X/3/30ef5c54b8bbc3487ea2b4c45cd11ea2932e4340.ico" class="site-icon" alt="" data-dominant-color="FE9E5E" width="32" height="32">

      <a href="http://rvirding.blogspot.com/2008/01/virdings-first-rule-of-programming.html" target="_blank" rel="noopener nofollow ugc">rvirding.blogspot.com</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="http://rvirding.blogspot.com/2008/01/virdings-first-rule-of-programming.html" target="_blank" rel="noopener nofollow ugc">Virding's First Rule of Programming</a></h3>

  <p>After reading the blogs about how good Erlang's concurrency model is and how we just just made a super implementation of it in XXX I have be...</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<blockquote>
<p>After reading the blogs about how good Erlang’s concurrency model is and how we just just made a super implementation of it in XXX I have been led to formulate Virding’s First Rule of Programming:</p>
</blockquote>
<blockquote>
<p>Any sufficiently complicated concurrent program in another language contains an ad hoc informally-specified bug-ridden slow implementation of half of Erlang.</p>
</blockquote>
<blockquote>
<p>With all respect to Greenspun.</p>
</blockquote>
<p>The quote is an adaptation of <a href="https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule" rel="noopener nofollow ugc">Greenspun’s Tenth Rule</a> that says:</p>
<blockquote>
<p>Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="66932" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-66932" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="66932"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="87339" data-post-id="87339">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Justin" data-post="13" data-topic="11196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/justin/48/11330_2.png" class="avatar"> Justin:</div>
<blockquote>
<p>My question was about where the rubber meets the road.</p>
</blockquote>
</aside>
<p><em>Apologies for necroing to the mods but this discussion is interesting.</em> <img src="https://forum.elixirforum.com/uploads/default/original/2X/a/a1c41c89c299189a3f85edfeb4973563d8bac781.gif?v=15" title=":023:" class="emoji emoji-custom" alt=":023:" loading="lazy" width="20" height="20"></p>
<p>The way I educated myself with Elixir professionally pretty quickly was to try and replicate parts of, or the entirety of, my recent past projects in other languages (in my case Ruby and Go). I still sometimes write and rewrite functionality for a small e-commerce app I was allowed to keep the source of (but forbidden to distribute) and I keep teaching myself various aspects of Elixir’s more heavy-duty tooling through it (like <code>Flow</code> and <code>GenStage</code>). I managed to make report generation there 17x - 25x faster than the Ruby counterpart, to create a small macro-based DSL for the CMS section, rewrote some of the REST APIs in GraphQL (through Elixir’s excellent Absinthe library) and made them tens of times faster without caching… examples abound.</p>
<p>You come off like a practical and somewhat skeptical person (being skeptical is a healthy habit). So IMO for you the best way would be to make direct analogies: if you have the free time, try to rewrite some of your professional apps or libraries in Elixir and, of course, feel free to ask a lot of questions along the way. We are here to help.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="87339" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-87339" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="87339"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="87648" data-post-id="87648">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Justin" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Justin/120/11330_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Justin
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I always look at new languages in terms of existing apps I’ve done. FP is just such a mind shift.</p>
<p>Since this post, I wrote a tiny utility in functional Scala. It took a ridiculous amount of time.  I guess for existing apps I need to think of the smallest possible app, rather than a “real” app.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="87648" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/getting-things-done-with-elixir-tips/11196/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-87648" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="87648"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/11196/load_more?page=3">Load more posts (9 remaining)</a>
</div></template></turbo-stream>