<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[/home/andreas]]></title>
  <link href="http://aprell.github.io/atom.xml" rel="self"/>
  <link href="http://aprell.github.io/"/>
  <updated>2020-10-03T14:03:23+02:00</updated>
  <id>http://aprell.github.io/</id>
  <author>
    <name><![CDATA[Andreas Prell]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Classic Programming Languages Papers]]></title>
    <link href="http://aprell.github.io/blog/2019/09/15/classic-programming-languages-papers/"/>
    <updated>2019-09-15T18:37:07+02:00</updated>
    <id>http://aprell.github.io/blog/2019/09/15/classic-programming-languages-papers</id>
    <content type="html"><![CDATA[<p>I found an old note reminding me that I wanted to compile a list of my
favorite papers in the area of programming languages. So, at long last, here
we go. Rather than trying to summarize each paper in a few (or more)
sentences, I take the easy way out and only drop a few keywords to highlight
important contributions or outstanding explanations.</p>

<!--more-->


<ul>
<li><p>Peter J. Landin, <a href="https://www.cs.cmu.edu/afs/cs/user/crary/www/819-f09/Landin64.pdf">The Mechanical Evaluation of Expressions</a>, 1964:
applicative expressions, syntactic sugar, evaluation, environment, abstract
machine (<a href="https://www.youtube.com/watch?v=QZzRritGiyI">Papers We Love presentation</a>)</p></li>
<li><p>Peter J. Landin, <a href="http://www.inf.ed.ac.uk/teaching/courses/epl/Landin66.pdf">The Next 700 Programming Languages</a>, 1966: ISWIM family
of programming languages, functional core, imperative features, equivalence
rules, declarative languages. (This paper ends with the transcript of an
interesting discussion that is still relevant today, over 50 years later.)</p></li>
<li><p>John C. Reynolds, <a href="http://surface.syr.edu/cgi/viewcontent.cgi?article=1012&amp;context=lcsmith_other">Definitional Interpreters for Higher-Order Programming
Languages</a>, 1972 / 1998: meta-circular interpreter, defunctionalization,
continuation-passing style (<a href="http://homepages.inf.ed.ac.uk/wadler/topics/history.html#definitional-interpreters">Papers We Love presentation</a>)</p></li>
<li><p>Paul Hudak, <a href="https://pdfs.semanticscholar.org/e694/49921581f1e00b801994236f840f5b459e00.pdf">The Conception, Evolution, and Application of Functional
Programming Languages</a>, 1989: history of functional programming
languages, including lambda calculus, Y combinator, order of evaluation,
call by value, call by name, and call by need (lazy evaluation)</p></li>
<li><p>Christopher Strachey, <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.332.3161&amp;rep=rep1&amp;type=pdf">Fundamental Concepts in Programming Languages</a>,
2000: L-values and R-values, call by value, call by reference, first-class
objects, ad hoc polymorphism, parametric polymorphism (<a href="https://www.youtube.com/watch?v=cO41uoi5cZs">Papers We Love
presentation</a>)</p></li>
</ul>


<p>That&rsquo;s it for now. I hope to grow this list over time.</p>

<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Safe Systems Programming]]></title>
    <link href="http://aprell.github.io/blog/2016/04/23/safe-systems-programming/"/>
    <updated>2016-04-23T22:03:59+02:00</updated>
    <id>http://aprell.github.io/blog/2016/04/23/safe-systems-programming</id>
    <content type="html"><![CDATA[<p>Rust seems like a good choice for systems programming. See <a href="http://kamalmarhubi.com/blog/2016/04/13/rust-nix-easier-unix-systems-programming-3">this recent
post</a> for an example of the safety afforded by using Rust instead of C.
Another language that deserves consideration is OCaml, where forking a process
looks like this:</p>

<!--more-->




<div class="highlight"><pre><code class="language-ocaml" data-lang="ocaml"><span class="k">match</span> <span class="nn">Unix</span><span class="p">.</span><span class="n">fork</span> <span class="bp">()</span> <span class="k">with</span>
<span class="o">|</span> <span class="mi">0</span> <span class="o">-&gt;</span> <span class="c">(* child process *)</span>
<span class="o">|</span> <span class="n">pid</span> <span class="o">-&gt;</span> <span class="c">(* parent process *)</span></code></pre></div>


<p>Short and sweet, but besides being pleasant to read, is this code actually
safe? What if <code>Unix.fork</code> returns -1? Well, it can&rsquo;t. <code>Unix.fork</code> calls a <a href="https://github.com/ocaml/ocaml/blob/trunk/otherlibs/unix/fork.c">C
function</a> that starts with the following lines of code:</p>

<div class="highlight"><pre><code class="language-c" data-lang="c"><span class="kt">int</span> <span class="n">ret</span><span class="p">;</span>
<span class="n">ret</span> <span class="o">=</span> <span class="n">fork</span><span class="p">();</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ret</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="n">uerror</span><span class="p">(</span><span class="s">&quot;fork&quot;</span><span class="p">,</span> <span class="n">Nothing</span><span class="p">);</span></code></pre></div>


<p>That is, if the actual system call fails, <code>Unix.fork</code> raises an exception that
may terminate our program. We can&rsquo;t accidentally kill -1 because <code>pid</code> is
guaranteed to be a valid process ID.</p>

<p>If this sounds interesting, I recommend checking out <a href="https://ocaml.github.io/ocamlunix">Unix Systems Programming
in OCaml</a>.</p>

<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Dependent Types in Haskell]]></title>
    <link href="http://aprell.github.io/blog/2015/08/20/dependent-types-in-haskell/"/>
    <updated>2015-08-20T21:58:46+02:00</updated>
    <id>http://aprell.github.io/blog/2015/08/20/dependent-types-in-haskell</id>
    <content type="html"><![CDATA[<p>It looks like GHC is getting closer to supporting dependent types with a patch
that <a href="https://typesandkinds.wordpress.com/2015/08/19/planned-change-to-ghc-merging-types-and-kinds">eliminates the distinction between types and kinds</a>. What is a
dependent type? The most accessible introduction I&rsquo;ve found is an article
called <a href="http://okmij.org/ftp/Haskell/dependent-types.html">Approximate Dependent-Type Programming</a>:</p>

<!--more-->


<blockquote><p>An ordinary type such as <code>[a]</code> may depend on other types &ndash; in our case, the
types of list elements &ndash; but not on the values of those elements or their
number. A dependent type does depend on such dynamic values. [&hellip;] One
should distinguish a dependent type (which depends on a dynamic value) from
a polymorphic type such as <code>Maybe a</code>. The type <code>List n a</code> from our running
example is indexed by the value (the list length) and by the type (of its
elements): it is both dependent (in <code>n</code>) and polymorphic (or, technically,
parametric), in <code>a</code>.</p></blockquote>

<p>In other words, <code>List n a</code> is parameterized by a value in addition to a type.</p>

<blockquote><p>The different nature of the two arguments in <code>List n a</code> has many
consequences: since the list length <code>n</code> is a natural number, one may apply
to it any operation on natural numbers such as addition, increment,
multiplication, etc.</p></blockquote>

<p>The article brings up an interesting example in which the type checker must be
convinced that <code>List (n+m) a</code> and <code>List (m+n) a</code> are the same type.</p>

<blockquote><p>Now, deciding if two types are the same involves determining if two
expressions are equal, which is generally undecidable (think of functions or
recursive expressions). There is a bigger problem: in our example, <code>n</code> and
<code>m</code> are just variables, whose values will be known only at run-time. The
type-checker, which runs at compile-time, therefore has to determine that
<code>n+m</code> is equal to <code>m+n</code> <em>without</em> knowing the concrete values of <code>n</code> and
<code>m</code>. We know that natural addition is commutative, but the type-checker does
not. It is usually not so smart to figure out the commutativity from the
definition of addition. Therefore, we have to somehow supply the <em>proof</em> of
the commutativity to the type-checker. Programming with dependent types
involves a great deal of theorem proving.</p></blockquote>

<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[More Lua Gotchas]]></title>
    <link href="http://aprell.github.io/blog/2015/02/21/more-lua-gotchas/"/>
    <updated>2015-02-21T18:49:01+01:00</updated>
    <id>http://aprell.github.io/blog/2015/02/21/more-lua-gotchas</id>
    <content type="html"><![CDATA[<p>Speaking of Lua gotchas, here&rsquo;s another one. In Lua, a function with <em>n</em>
parameters is similar to a variadic function. As an example, consider:</p>

<!--more-->




<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="k">function</span> <span class="nf">f</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="k">end</span></code></pre></div>


<p>We can call <code>f</code> with as many arguments as we like. Missing arguments become
<code>nil</code>, extra arguments are discarded:</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="n">f</span><span class="p">()</span>        <span class="c1">-- nil nil</span>
<span class="n">f</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>       <span class="c1">-- 1   nil</span>
<span class="n">f</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>    <span class="c1">-- 1   2</span>
<span class="n">f</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c1">-- 1   2</span></code></pre></div>


<p>In fact, function <code>f</code> could be written as:</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="k">function</span> <span class="nf">f</span><span class="p">(</span><span class="o">...</span><span class="p">)</span>
    <span class="kd">local</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="o">...</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="k">end</span></code></pre></div>


<p>The <a href="http://www.lua.org/manual/5.2/manual.html#3.3.3">reference manual</a> has the following to say about <code>local a, b = ...</code>:</p>

<blockquote>Before the assignment, the list of values is <i>adjusted</i> to
the length of the list of variables. If there are more values than needed, the
excess values are thrown away. If there are fewer values than needed, the list
is extended with as many <b>nil</b>&#8217;s as needed. If the list of expressions
ends with a function call, then all values returned by that call enter the
list of values, before the adjustment (except when the call is enclosed in
parentheses; see §3.4).</blockquote>


<p>There is no observable difference, whether we call <code>f(1)</code> or <code>f(1, nil)</code>. But
for some functions, there is. Suppose we have</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="nb">table.insert</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">g</span><span class="p">())</span></code></pre></div>


<p>where <code>t</code> is a table and <code>g</code> is a function that may or may not return a value.
As long as <code>g</code> returns a value, including <code>nil</code>, everything works as expected.
(We don&rsquo;t mind appending <code>nil</code> to a table.)  When <code>g</code> happens to return
nothing, <code>table.insert</code> complains about a missing argument, which may be
<a href="http://lua-users.org/lists/lua-l/2011-02/msg01444.html">surprising</a>, considering that Lua is supposed to <a href="http://www.lua.org/pil/5.html">adjust the number of
arguments to the number of parameters</a>:</p>

<div class="highlight"><pre><code class="language-text" data-lang="text">stdin:1: wrong number of arguments to &#39;insert&#39;
stack traceback:
    [C]: in function &#39;insert&#39;
    stdin:1: in main chunk
    [C]: in ?</code></pre></div>


<p>We can introduce a variable</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="kd">local</span> <span class="n">b</span> <span class="o">=</span> <span class="n">g</span><span class="p">()</span>
<span class="nb">table.insert</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span></code></pre></div>


<p>or put parentheses around the call to <code>g</code></p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="nb">table.insert</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="p">(</span><span class="n">g</span><span class="p">()))</span></code></pre></div>


<p>to force exactly one result, turning nothing into <code>nil</code>, as if <code>g</code> returned
<code>nil</code>. And <code>nil</code> is not nothing. All three functions</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="k">function</span> <span class="nf">f</span><span class="p">()</span> <span class="k">end</span>
<span class="k">function</span> <span class="nf">g</span><span class="p">()</span> <span class="k">return</span> <span class="k">end</span>
<span class="k">function</span> <span class="nf">h</span><span class="p">()</span> <span class="k">return</span> <span class="kc">nil</span> <span class="k">end</span></code></pre></div>


<p>are interchangeable when used liked this:</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="kd">local</span> <span class="n">x</span> <span class="o">=</span> <span class="n">f</span><span class="p">();</span> <span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1">-- nil</span>
<span class="kd">local</span> <span class="n">y</span> <span class="o">=</span> <span class="n">g</span><span class="p">();</span> <span class="nb">print</span><span class="p">(</span><span class="n">y</span><span class="p">)</span> <span class="c1">-- nil</span>
<span class="kd">local</span> <span class="n">z</span> <span class="o">=</span> <span class="n">h</span><span class="p">();</span> <span class="nb">print</span><span class="p">(</span><span class="n">z</span><span class="p">)</span> <span class="c1">-- nil</span></code></pre></div>


<p>But only <code>h</code> returns <code>nil</code>, whereas <code>f</code> and <code>g</code> return nothing:</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="nb">print</span><span class="p">(</span><span class="n">f</span><span class="p">())</span> <span class="c1">--</span>
<span class="nb">print</span><span class="p">(</span><span class="n">g</span><span class="p">())</span> <span class="c1">--</span>
<span class="nb">print</span><span class="p">(</span><span class="n">h</span><span class="p">())</span> <span class="c1">-- nil</span></code></pre></div>




<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Lua Gotchas]]></title>
    <link href="http://aprell.github.io/blog/2014/12/21/lua-gotchas/"/>
    <updated>2014-12-21T18:26:15+01:00</updated>
    <id>http://aprell.github.io/blog/2014/12/21/lua-gotchas</id>
    <content type="html"><![CDATA[<p>Lua is one of my favorite programming languages. Lua is easy to learn, but not
entirely without <a href="http://www.luafaq.org/gotchas.html">gotchas</a> if you&rsquo;re used to other languages. One gotcha is
related to for-loops. What do you think the following piece of code will
print?</p>

<!--more-->




<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="k">for</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span> <span class="k">do</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="mi">3</span> <span class="k">then</span> <span class="n">i</span> <span class="o">=</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="k">end</span>
<span class="k">end</span></code></pre></div>


<p>The numbers from 1 to 5, skipping 4? Because that&rsquo;s what we expect from an
equivalent loop in, say, C++:</p>

<div class="highlight"><pre><code class="language-c--" data-lang="c++"><span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;=</span> <span class="mi">5</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">i</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span><span class="n">i</span> <span class="o">==</span> <span class="mi">3</span><span class="p">)</span> <span class="n">i</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span></code></pre></div>


<p>Except it&rsquo;s not equivalent. Lua&rsquo;s for-loops are implemented in terms of while.
Above example is translated to:</p>

<div class="highlight"><pre><code class="language-lua" data-lang="lua"><span class="k">do</span>
    <span class="kd">local</span> <span class="n">_i</span><span class="p">,</span> <span class="n">_end</span><span class="p">,</span> <span class="n">_step</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">1</span>
    <span class="k">while</span> <span class="n">_i</span> <span class="o">&lt;=</span> <span class="n">_end</span> <span class="k">do</span>
        <span class="kd">local</span> <span class="n">i</span> <span class="o">=</span> <span class="n">_i</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="mi">3</span> <span class="k">then</span> <span class="n">i</span> <span class="o">=</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="k">end</span>
        <span class="n">_i</span> <span class="o">=</span> <span class="n">_i</span> <span class="o">+</span> <span class="n">_step</span>
    <span class="k">end</span>
<span class="k">end</span></code></pre></div>


<p>Quoting from <a href="http://www.lua.org/pil/4.3.4.html">Programming in Lua</a>:</p>

<blockquote>The for loop has some subtleties that you should learn in order to
make good use of it. First, all three expressions are evaluated once, before
the loop starts. [&#8230;] Second, the control variable is a local variable
automatically declared by the for statement and is visible only inside the
loop. [&#8230;] Third, you should never change the value of the control
variable.</blockquote>




<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Code Mesh 2014]]></title>
    <link href="http://aprell.github.io/blog/2014/11/13/code-mesh-2014/"/>
    <updated>2014-11-13T21:15:39+01:00</updated>
    <id>http://aprell.github.io/blog/2014/11/13/code-mesh-2014</id>
    <content type="html"><![CDATA[<p>Two of my personal highlights from <a href="http://www.codemesh.io">Code Mesh</a> in one picture: QuickCheck
and Idris. :)</p>

<!--more-->




<p align="center">
<img src="http://aprell.github.io/images/codemesh2014.jpg" title="QuickCheck Evolution presented by John Hughes" alt="Code Mesh 2014" width="800"/>
</p>




<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Masterminds of Programming]]></title>
    <link href="http://aprell.github.io/blog/2014/10/11/masterminds-of-programming/"/>
    <updated>2014-10-11T17:19:43+02:00</updated>
    <id>http://aprell.github.io/blog/2014/10/11/masterminds-of-programming</id>
    <content type="html"><![CDATA[<p>A few interesting and amusing quotes from the book <a href="http://shop.oreilly.com/product/9780596515171.do">Masterminds of
Programming</a>:</p>

<!--more-->




<blockquote>Some 20 years ago I wanted to develop a tool to design VLSI chips.
I didn&#8217;t have a Forth for my new PC, so I thought I&#8217;d try a different
approach: machine language. Not assembler language, but actually typing the
hex instructions. [&#8230;] My conclusion was that Forth is more efficient than
machine language. Partly because of its interactivity and partly because of
its syntax.<br>&#8212;Charles Moore</blockquote>




<blockquote>My opinion is that OOP is one of the great frauds perpetrated on
the community. [&#8230;] OOP was designed so that its clients could claim superior
wisdom for being on the &#8220;inside&#8221;. The truth of the matter is that the single
most important aspect of OOP is an approach devised decades ago: encapsulation
of subroutines and data. All the rest is frosting.<br>&#8212;Thomas E.
Kurtz</blockquote>




<blockquote>The best way to avoid tough debugging is to write things very
carefully in the first place.<br>&#8212;Brian Kernighan</blockquote>




<blockquote>Software engineering is in many ways a very pathetic field,
because so much of it is anecdotal and based on people&#8217;s judgments or even
people&#8217;s aesthetic judgments.<br>&#8212;Peter Weinberger</blockquote>




<blockquote>C is a reasonably good language for compilers to generate, but the
idea that human beings should program in it is completely
absurd.<br>&#8212;Bertrand Meyer</blockquote>




<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Concurrency for Parallelism?]]></title>
    <link href="http://aprell.github.io/blog/2014/10/03/concurrency-for-parallelism/"/>
    <updated>2014-10-03T20:35:36+02:00</updated>
    <id>http://aprell.github.io/blog/2014/10/03/concurrency-for-parallelism</id>
    <content type="html"><![CDATA[<p>So, following up on the previous post, what is the difference between
concurrent programming and parallel programming?</p>

<!--more-->


<p>In my view, concurrent programming is concerned with coordination, whereas
parallel programming is concerned with efficiency. In a way, you could say
parallel programming is about avoiding coordination to the extent possible for
the sake of performance. It seems reasonable to assume that <a href="http://yosefk.com/blog/parallelism-and-concurrency-need-different-tools.html">concurrency and
parallelism call for different tools</a>.</p>

<p>Concurrent languages such as <a href="http://golang.org">Go</a> support parallelism basically out of the
box: create a number of independent tasks and make sure they are scheduled by
a pool of worker threads. Done in a few lines of code. Problem solved?</p>

<p>I agree that a single set of concurrency constructs is too limiting for the
kind of parallel programs we&rsquo;d want to write. Consider parallel loops, for
example. Relatively straightforward to implement in Go, but <a href="http://www.golangpatterns.info/concurrency/parallel-for-loop">starting a
goroutine for each iteration</a>? Hardly practical. This is not to say that
goroutines and channels can&rsquo;t be used to implement parallel loops efficiently;
they can, it&rsquo;s just more work. But programmers shouldn&rsquo;t have to worry about
goroutines and channels when all they want to do is run some iterations of a
loop in parallel.</p>

<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Concurrency versus Parallelism]]></title>
    <link href="http://aprell.github.io/blog/2014/09/24/concurrency-versus-parallelism/"/>
    <updated>2014-09-24T15:56:09+02:00</updated>
    <id>http://aprell.github.io/blog/2014/09/24/concurrency-versus-parallelism</id>
    <content type="html"><![CDATA[<p>Explain the difference between &ldquo;concurrency&rdquo; and &ldquo;parallelism&rdquo;. Easy, right.
Well&hellip; Depending on who you ask, the conclusion is either that <a href="http://books.google.de/books?id=J5-ckoCgc3IC&amp;lpg=PA1&amp;dq=introduction%20to%20concurrency&amp;hl=de&amp;pg=PP1#v=onepage&amp;q&amp;f=false">parallelism
implies concurrency</a> or that <a href="http://existentialtype.wordpress.com/2011/03/17/parallelism-is-not-concurrency">parallelism has nothing to do with
concurrency</a>&hellip;</p>

<!--more-->


<p>The simplest definitions I can think of are: Concurrency is dealing with
multiple things at the same time (multiple things interleaved within the same
time frame). Parallelism is multiple things happening at the same time (truly
simultaneously).</p>

<p>That&rsquo;s all. No mention of processes or threads, just &ldquo;things&rdquo;, which might be
single instructions. Neither definition implies determinism or nondeterminism.
There is deterministic concurrency (coroutines) as well as nondeterministic
parallelism (threads). Concurrency may be the answer to our nondeterministic
woes, but concurrency per se is a more general concept. Ditto for parallelism.</p>

<p>Given above definitions, it seems plausible to think of parallelism as an
instance of concurrency: every parallel program is also a concurrent program.
If there&rsquo;s parallelism, and it doesn&rsquo;t look like we&rsquo;re dealing with multiple
things at the same time, it&rsquo;s because a lower level is taking care of it for
us.</p>

<p>Can concurrency exist independently of parallelism? Certainly! Can parallelism
exist independently of concurrency? That&rsquo;s the more interesting question. I&rsquo;m
tempted to say no.</p>

<!--References-->



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Hello Blog]]></title>
    <link href="http://aprell.github.io/blog/2014/09/16/hello-blog/"/>
    <updated>2014-09-16T16:43:40+02:00</updated>
    <id>http://aprell.github.io/blog/2014/09/16/hello-blog</id>
    <content type="html"><![CDATA[<p>Random entries coming soon</p>
]]></content>
  </entry>
  
</feed>
