<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.0">Jekyll</generator><link href="https://tomekw.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://tomekw.com/" rel="alternate" type="text/html" /><updated>2023-04-20T09:49:29+00:00</updated><id>https://tomekw.com/feed.xml</id><title type="html">Tomek Wałkuski</title><subtitle>Software engineer. I solve problems by (not) writing Clojure.</subtitle><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><entry><title type="html">(N)vim for Clojure development</title><link href="https://tomekw.com/nvim-for-clojure-development/" rel="alternate" type="text/html" title="(N)vim for Clojure development" /><published>2020-08-24T00:00:00+00:00</published><updated>2020-08-24T00:00:00+00:00</updated><id>https://tomekw.com/nvim-for-clojure-development</id><content type="html" xml:base="https://tomekw.com/nvim-for-clojure-development/"><![CDATA[<p>Everything you need to write Clojure using (N)vim.</p>

<p>I used different editors and IDEs over the years: Netbeans, Vim, Emacs, and IntelliJ.
And on all of them, I always enabled Vim keybindings.</p>

<p>Few months ago, after more than 10 years writing Ruby, I started my first commercial
role as a Clojure Software Engineer at <a href="https://commsor.com">Commsor</a>! I’m lazy,
so I picked <a href="https://cursive-ide.com">Cursive IDE</a> (which is great BTW!), with IdeaVim
plugin enabled. Everything worked out of the box, but after while I, obviously, started to envy
my colleagues their custom workflows and setups…</p>

<p>Now that I’m sure I am Vim person to the bone - why not to give it a go? I decided to configure
a pretty minimal, as close to the Vim philosophy, setup as possible. Here it is!</p>

<h3 id="choosing-vim-distribution">Choosing Vim distribution</h3>

<p>I’m on MacOS, so I could either use <a href="https://macvim-dev.github.io/macvim">MacVim</a> distribution,
console <a href="https://neovim.io">nvim</a>, or some GUI client for it. I decided to try out
<a href="https://github.com/qvacua/vimr">VimR</a> and I’m not disappointed:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>brew <span class="nb">install </span>vimr
</code></pre></div></div>

<h3 id="essential-plugins">Essential plugins</h3>

<p>I decided to manage my plugin dependencies with <a href="https://github.com/junegunn/vim-plug">vim-plug</a>.
It keeps the configuration file small and readable, and just gets the job done:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">" ~/.config/nvim/init.vim</span>

<span class="k">call</span> plug#begin<span class="p">()</span>

<span class="c">" Plugins to install</span>
Plug <span class="s1">'first/plugin-vim'</span>
Plug <span class="s1">'second/plugin-vim'</span>

<span class="k">call</span> plug#end<span class="p">()</span>

<span class="c">" Rest to the configuation file</span>
<span class="c">" ...</span>
</code></pre></div></div>

<p>To install them we can reloaded the current file (<code class="language-plaintext highlighter-rouge">~/.config/nvim/init.vim</code>) with <code class="language-plaintext highlighter-rouge">:so %</code>
and run <code class="language-plaintext highlighter-rouge">:PlugInstall</code>.</p>

<p>I started by including:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'tpope/vim-sensible'</span>
Plug <span class="s1">'vim-airline/vim-airline'</span>
</code></pre></div></div>

<p>which provide universal set of defaults and a lean status line.</p>

<p>For file and project management I picked <a href="https://github.com/ctrlpvim/ctrlp.vim">ctrlp.vim</a>:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'ctrlpvim/ctrlp.vim'</span>
</code></pre></div></div>

<p>The only custom configuration I added was setting up additional project root marker and a different
user command to list files based on Git index:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">let</span> <span class="nv">g:ctrlp_root_markers</span> <span class="p">=</span> <span class="p">[</span><span class="s1">'deps.edn'</span><span class="p">]</span>
<span class="k">let</span> <span class="nv">g:ctrlp_user_command</span> <span class="p">=</span> <span class="p">[</span><span class="s1">'.git'</span><span class="p">,</span> <span class="s1">'cd %s &amp;&amp; git ls-files -co --exclude-standard'</span><span class="p">]</span>
</code></pre></div></div>

<p>Also, I chose Apprentice as my color scheme:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'romainl/Apprentice'</span>

<span class="k">colorscheme</span> apprentice
</code></pre></div></div>

<p>Mandatory screenshot:</p>

<p><img src="/assets/images/apprentice.png" alt="Apprentice" /></p>

<p>The must-have plugin for everyone is:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'axelf4/vim-strip-trailing-whitespace'</span>
</code></pre></div></div>

<p>which removes trailing whitespace on modified lines before saving.</p>

<p>Last but not least there is support for searching across the files in the project.
<a href="https://github.com/mileszs/ack.vim">ack.vim</a> supported
by <a href="https://github.com/BurntSushi/ripgrep">ripgrep</a> works perfectly!
Importantly, it takes <code class="language-plaintext highlighter-rouge">.gitignore</code> settings into account.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>brew <span class="nb">install </span>ripgrep
</code></pre></div></div>

<p>and</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'mileszs/ack.vim'</span>
</code></pre></div></div>

<p>Custom configuration sets the ripgrep as a backend, closes the search results popup after choosing
the result, and stops the plugin from jumping to the first result automatically.</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">let</span> <span class="nv">g:ackprg</span> <span class="p">=</span> <span class="s1">'rg --vimgrep'</span>
<span class="k">let</span> <span class="nv">g:ack_autoclose</span> <span class="p">=</span> <span class="m">1</span>
cnoreabbrev Ack Ack<span class="p">!</span>
</code></pre></div></div>

<p>All of that alone would be a potent general-purpose Vim setup.</p>

<h3 id="clojure-support">Clojure support</h3>

<p>To efficiently write Clojure code I needed syntax highlighting, structural editing
support, REPL management, and context-aware autocomplete.</p>

<p>These three plugins:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'guns/vim-clojure-highlight'</span>
Plug <span class="s1">'guns/vim-clojure-static'</span>
Plug <span class="s1">'luochen1990/rainbow'</span>
</code></pre></div></div>

<p>give me syntax highlighting, indentation, and rainbow parentheses to better distinguish forms
visually.</p>

<p>Next two plugins:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'guns/vim-sexp'</span>
Plug <span class="s1">'tpope/vim-sexp-mappings-for-regular-people'</span>
</code></pre></div></div>

<p>provide structural editing support with vim-like mappings.</p>

<p>These five:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'clojure-vim/vim-jack-in'</span>
Plug <span class="s1">'radenling/vim-dispatch-neovim'</span>
Plug <span class="s1">'SevereOverfl0w/vim-replant'</span><span class="p">,</span> <span class="p">{</span> <span class="s1">'do'</span><span class="p">:</span> <span class="s1">':UpdateRemotePlugins'</span> <span class="p">}</span>
Plug <span class="s1">'tpope/vim-dispatch'</span>
Plug <span class="s1">'tpope/vim-fireplace'</span>

</code></pre></div></div>

<p>allow me to start and / or connect to existing nREPL session, with <code class="language-plaintext highlighter-rouge">deps.edn</code> support
by just invoking:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">:</span>Clj <span class="p">-</span>A<span class="p">:</span>alias_1<span class="p">:</span>alias_2
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">vim-replant</code> adds handy keybindings for working with Clojure REPLs. Just invoke
<code class="language-plaintext highlighter-rouge">&lt;LocalLeader&gt;rf</code> to refresh namespaces by automatically calling your common <code class="language-plaintext highlighter-rouge">(stop)</code>/<code class="language-plaintext highlighter-rouge">(start)</code>
functions! Magic!</p>

<p>And you know what? All of this doesn’t need a single line of custom configuration.
I love the sane defaults and conventions!</p>

<p>Context-aware autocomplete needs more work, but it’s worth the effort.</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Plug <span class="s1">'clojure-vim/async-clj-omni'</span>
Plug <span class="s1">'prabirshrestha/asyncomplete.vim'</span>
</code></pre></div></div>

<p>These two plugins provide autocomplete which understands your code by using the existing REPL
connection! <code class="language-plaintext highlighter-rouge">asyncomplete</code> doesn’t come with any sources enabled and it needs to be registered:</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">au</span> <span class="nb">User</span> asyncomplete_setup <span class="k">call</span> asyncomplete#register_source<span class="p">({</span>
<span class="se">    \</span> <span class="s1">'name'</span><span class="p">:</span> <span class="s1">'async_clj_omni'</span><span class="p">,</span>
<span class="se">    \</span> <span class="s1">'whitelist'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'clojure'</span><span class="p">],</span>
<span class="se">    \</span> <span class="s1">'completor'</span><span class="p">:</span> <span class="k">function</span><span class="p">(</span><span class="s1">'async_clj_omni#sources#complete'</span><span class="p">),</span>
<span class="se">    \</span> <span class="p">})</span>
</code></pre></div></div>

<p>And that’s all! It’s ready to help you keep all the parentheses balanced :)</p>

<p>The complete configuration file, with few additional plugins, can be found on my
<a href="https://github.com/tomekw/dontfiles/blob/master/.config/nvim/init.vim">tomekw/dontfiles</a> repo.
I’m sure the current setup will grow in the future, but you can track the progress by following
me on <a href="https://twitter.com/_tomekw">Twitter</a>!</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[Everything you need to write Clojure using (N)vim]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/apprentice.png" /><media:content medium="image" url="https://tomekw.com/assets/images/apprentice.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Clojure + deps.edn, a basic guide</title><link href="https://tomekw.com/clojure-deps-edn-a-basic-guide/" rel="alternate" type="text/html" title="Clojure + deps.edn, a basic guide" /><published>2019-07-05T00:00:00+00:00</published><updated>2019-07-05T00:00:00+00:00</updated><id>https://tomekw.com/clojure-deps-edn-a-basic-guide</id><content type="html" xml:base="https://tomekw.com/clojure-deps-edn-a-basic-guide/"><![CDATA[<p>After a rather long break from programming and Clojure I decided give them another go. When it comes to managing
Clojure projects, <a href="https://leiningen.org">Leiningen</a> is de-facto standard tool. Recently, <a href="https://clojure.org/guides/deps_and_cli">Clojure CLI tools</a>
are becoming more and more popular, though. Switching to yet-another-build-tool doesn’t have any pragmatic value,
but it’s perfect for learning purposes.</p>

<p>From a build tool I expect it to perform certain tasks:</p>

<ol>
  <li>Creating a project.</li>
  <li>Managing source and tests paths.</li>
  <li>Managing dependencies.</li>
  <li>Running tests.</li>
  <li>Building a self-contained JAR, a.k.a. uberjar.</li>
  <li>Managing outdated dependencies.</li>
</ol>

<p>Let’s see how it’s performed using Clojure CLI tools, a.k.a. deps.edn.</p>

<h3 id="creating-a-project">Creating a project</h3>

<p>Leiningen allows to generate a project structure simply by invoking:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>lein new <span class="o">[</span>template] <span class="o">[</span>project-name]
</code></pre></div></div>

<p>We get a lot for free, but is it really needed? How is it done with Clojure CLI tools?</p>

<p>Imagine a simple project. It allows add and divide numbers, it also prints some example calculations when invoked.
We can start by simply creating a new directory:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">mkdir </span>cdeps <span class="o">&amp;&amp;</span> <span class="nb">cd </span>cdeps
</code></pre></div></div>

<p>Now, let’s add an empty <code class="language-plaintext highlighter-rouge">deps.edn</code> file:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; /deps.edn</span><span class="w">
</span><span class="p">{}</span><span class="w">
</span></code></pre></div></div>

<p>And now we can start adding some actual code to the project.</p>

<h3 id="managing-source-and-tests-paths">Managing source and tests paths</h3>

<p>To demonstrate the feature of managing source paths we will put our code at <code class="language-plaintext highlighter-rouge">src/main/clojure</code>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">mkdir</span> <span class="nt">-p</span> src/main/clojure
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">deps.edn</code> is no magic so we can just set the path in the file:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; deps.edn</span><span class="w">
</span><span class="p">{</span><span class="no">:paths</span><span class="w"> </span><span class="p">[</span><span class="s">"src/main/clojure"</span><span class="p">]}</span><span class="w">
</span></code></pre></div></div>

<p>Now, we can write the calculator code:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; src/main/clojure/com/tomekw/cdeps/calculator.clj</span><span class="w">
</span><span class="p">(</span><span class="nf">ns</span><span class="w"> </span><span class="n">com.tomekw.cdeps.calculator</span><span class="p">)</span><span class="w">

</span><span class="p">(</span><span class="k">defn</span><span class="w"> </span><span class="n">plus</span><span class="w"> </span><span class="p">[</span><span class="n">a</span><span class="w"> </span><span class="n">b</span><span class="p">]</span><span class="w">
  </span><span class="p">(</span><span class="nb">+</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">b</span><span class="p">))</span><span class="w">

</span><span class="p">(</span><span class="k">defn</span><span class="w"> </span><span class="n">divide</span><span class="w"> </span><span class="p">[</span><span class="n">a</span><span class="w"> </span><span class="n">b</span><span class="p">]</span><span class="w">
  </span><span class="p">(</span><span class="nb">/</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">b</span><span class="p">))</span><span class="w">
</span></code></pre></div></div>

<h3 id="managing-dependencies">Managing dependencies</h3>

<p>In such a simple project there is no real need to add external dependencies. We can always specify the Clojure version
we would like to use, though:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; deps.edn</span><span class="w">
</span><span class="p">{</span><span class="no">:paths</span><span class="w"> </span><span class="p">[</span><span class="s">"src/main/clojure"</span><span class="p">]</span><span class="w">
 </span><span class="no">:deps</span><span class="w">  </span><span class="p">{</span><span class="n">org.clojure/clojure</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"1.10.1"</span><span class="p">}}}</span><span class="w">
</span></code></pre></div></div>

<p>Clojure CLI tools allow to specify local and git dependencies too, see <a href="https://clojure.org/guides/deps_and_cli#_using_local_libraries">documentation and more examples</a>.</p>

<h3 id="running-tests">Running tests</h3>

<p>The calculator we wrote is super simple but we can still write some tests:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; test/main/clojure/com/tomekw/cdeps/calculator_test.clj</span><span class="w">
</span><span class="p">(</span><span class="nf">ns</span><span class="w"> </span><span class="n">com.tomekw.cdeps.calculator-test</span><span class="w">
  </span><span class="p">(</span><span class="no">:require</span><span class="w"> </span><span class="p">[</span><span class="n">clojure.test</span><span class="w"> </span><span class="no">:refer</span><span class="w"> </span><span class="no">:all</span><span class="p">]</span><span class="w">
            </span><span class="p">[</span><span class="n">com.tomekw.cdeps.calculator</span><span class="w"> </span><span class="no">:refer</span><span class="w"> </span><span class="no">:all</span><span class="p">]))</span><span class="w">

</span><span class="p">(</span><span class="nf">deftest</span><span class="w"> </span><span class="n">adding-numbers</span><span class="w">
  </span><span class="p">(</span><span class="nf">is</span><span class="w"> </span><span class="p">(</span><span class="nb">=</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="p">(</span><span class="nf">plus</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="mi">2</span><span class="p">))))</span><span class="w">

</span><span class="p">(</span><span class="nf">deftest</span><span class="w"> </span><span class="n">dividing-numbers</span><span class="w">
  </span><span class="p">(</span><span class="nf">is</span><span class="w"> </span><span class="p">(</span><span class="nb">=</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="p">(</span><span class="nf">divide</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="mi">2</span><span class="p">))))</span><span class="w">

</span><span class="p">(</span><span class="nf">deftest</span><span class="w"> </span><span class="n">dividing-numbers-by-zero</span><span class="w">
  </span><span class="p">(</span><span class="nf">is</span><span class="w"> </span><span class="p">(</span><span class="nf">thrown?</span><span class="w"> </span><span class="n">ArithmeticException</span><span class="w"> </span><span class="p">(</span><span class="nf">divide</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="mi">0</span><span class="p">))))</span><span class="w">
</span></code></pre></div></div>

<p>Now we need to run them to make sure they pass. We have to add an alias (a command we will run), and a test runner,
as an extra dependency. I picked <a href="https://github.com/lambdaisland/kaocha">kaocha</a>. Also, we need to tell the runner
where the tests are located:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; deps.edn</span><span class="w">
</span><span class="p">{</span><span class="no">:paths</span><span class="w">   </span><span class="p">[</span><span class="s">"src/main/clojure"</span><span class="p">]</span><span class="w">
 </span><span class="no">:deps</span><span class="w">    </span><span class="p">{</span><span class="n">org.clojure/clojure</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"1.10.1"</span><span class="p">}}</span><span class="w">
 </span><span class="no">:aliases</span><span class="w"> </span><span class="p">{</span><span class="no">:test</span><span class="w"> </span><span class="p">{</span><span class="no">:extra-paths</span><span class="w"> </span><span class="p">[</span><span class="s">"test/main/clojure"</span><span class="p">]</span><span class="w">
                  </span><span class="no">:extra-deps</span><span class="w">  </span><span class="p">{</span><span class="n">lambdaisland/kaocha</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"0.0-529"</span><span class="p">}}</span><span class="w">
                  </span><span class="no">:main-opts</span><span class="w">   </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"kaocha.runner"</span><span class="p">]}}}</span><span class="w">
</span></code></pre></div></div>

<p>Here is the test report:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>clj <span class="nt">-Atest</span>
<span class="o">[(</span>...<span class="o">)]</span>
3 tests, 3 assertions, 0 failures.
</code></pre></div></div>

<h3 id="building-a-self-contained-jat-aka-uberjar">Building a self-contained JAT, a.k.a. uberjar</h3>

<p>Presume, we would like to print example calculations to the console. Let’s add the code to do that:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; src/main/clojure/com/tomekw/cdeps/core.clj</span><span class="w">
</span><span class="p">(</span><span class="nf">ns</span><span class="w"> </span><span class="n">com.tomekw.cdeps.core</span><span class="w">
  </span><span class="p">(</span><span class="no">:gen-class</span><span class="p">)</span><span class="w">
  </span><span class="p">(</span><span class="no">:require</span><span class="w"> </span><span class="p">[</span><span class="n">com.tomekw.cdeps.calculator</span><span class="w"> </span><span class="no">:refer</span><span class="w"> </span><span class="no">:all</span><span class="p">]))</span><span class="w">

</span><span class="p">(</span><span class="k">defn</span><span class="w"> </span><span class="n">-main</span><span class="w"> </span><span class="p">[</span><span class="o">&amp;</span><span class="w"> </span><span class="n">args</span><span class="p">]</span><span class="w">
  </span><span class="p">(</span><span class="nf">do</span><span class="w"> </span><span class="p">(</span><span class="nb">println</span><span class="w"> </span><span class="p">(</span><span class="nf">format</span><span class="w"> </span><span class="s">"2 + 2 is %s"</span><span class="w"> </span><span class="p">(</span><span class="nf">plus</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="mi">2</span><span class="p">)))</span><span class="w">
      </span><span class="p">(</span><span class="nb">println</span><span class="w"> </span><span class="p">(</span><span class="nf">format</span><span class="w"> </span><span class="s">"4 / 2 is %s"</span><span class="w"> </span><span class="p">(</span><span class="nf">divide</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="mi">2</span><span class="p">)))))</span><span class="w">
</span></code></pre></div></div>

<p>To run the main function we can invoke the following command:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>clj <span class="nt">-m</span> com.tomekw.cdeps.core
2 + 2 is 4
4 / 2 is 2
</code></pre></div></div>

<p>It could be burdensome for the users of our calculator to install Clojure. To avoid this, we can package our project
as a standalone Java JAR. There is number of tools to do that, like <a href="https://github.com/luchiniatwork/cambada">cambada</a>,
but I’ve decided to try out <a href="https://github.com/tonsky/uberdeps">uberdeps</a>. Let’s add a proper configuration first:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; deps.edn</span><span class="w">
</span><span class="p">{</span><span class="no">:paths</span><span class="w">   </span><span class="p">[</span><span class="s">"src/main/clojure"</span><span class="p">]</span><span class="w">
 </span><span class="no">:deps</span><span class="w">    </span><span class="p">{</span><span class="n">org.clojure/clojure</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"1.10.1"</span><span class="p">}}</span><span class="w">
 </span><span class="no">:aliases</span><span class="w"> </span><span class="p">{</span><span class="no">:test</span><span class="w">    </span><span class="p">{</span><span class="no">:extra-paths</span><span class="w"> </span><span class="p">[</span><span class="s">"test/main/clojure"</span><span class="p">]</span><span class="w">
                     </span><span class="no">:extra-deps</span><span class="w">  </span><span class="p">{</span><span class="n">lambdaisland/kaocha</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"0.0-529"</span><span class="p">}}</span><span class="w">
                     </span><span class="no">:main-opts</span><span class="w">   </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"kaocha.runner"</span><span class="p">]}</span><span class="w">
           </span><span class="no">:uberjar</span><span class="w"> </span><span class="p">{</span><span class="no">:extra-deps</span><span class="w"> </span><span class="p">{</span><span class="n">uberdeps</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"0.1.4"</span><span class="p">}}</span><span class="w">
                     </span><span class="no">:main-opts</span><span class="w">  </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"uberdeps.uberjar"</span><span class="w"> </span><span class="s">"--target"</span><span class="w"> </span><span class="s">"target/cdeps-0.1.0.jar"</span><span class="p">]}}}</span><span class="w">
</span></code></pre></div></div>

<p>To package the project we simply run:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>clj <span class="nt">-Auberjar</span>
<span class="o">[</span>uberdeps] Packaging target/cdeps-0.1.0.jar...
+ src/main/clojure/<span class="k">**</span>
+ org.clojure/clojure 1.10.1
<span class="nb">.</span>   org.clojure/core.specs.alpha 0.2.44
<span class="nb">.</span>   org.clojure/spec.alpha 0.2.176
<span class="o">[</span>uberdeps] Packaged target/cdeps-0.1.0.jar <span class="k">in </span>567 ms
</code></pre></div></div>

<p>And now we can run the project with Java:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>java <span class="nt">-cp</span> target/cdeps-0.1.0.jar clojure.main <span class="nt">-m</span> com.tomekw.cdeps.core
2 + 2 is 4
4 / 2 is 2
</code></pre></div></div>

<h3 id="managing-outdated-dependencies">Managing outdated dependencies</h3>

<p>It’s often needed to manage the versions of all dependencies we put into our <code class="language-plaintext highlighter-rouge">deps.edn</code> file. There is a tool named
<a href="https://github.com/Olical/depot">depot</a>:</p>

<div class="language-clojure highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">;; deps.edn</span><span class="w">
</span><span class="p">{</span><span class="no">:paths</span><span class="w">   </span><span class="p">[</span><span class="s">"src/main/clojure"</span><span class="p">]</span><span class="w">
 </span><span class="no">:deps</span><span class="w">    </span><span class="p">{</span><span class="n">org.clojure/clojure</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"1.10.1"</span><span class="p">}}</span><span class="w">
 </span><span class="no">:aliases</span><span class="w"> </span><span class="p">{</span><span class="no">:test</span><span class="w">     </span><span class="p">{</span><span class="no">:extra-paths</span><span class="w"> </span><span class="p">[</span><span class="s">"test/main/clojure"</span><span class="p">]</span><span class="w">
                      </span><span class="no">:extra-deps</span><span class="w">  </span><span class="p">{</span><span class="n">lambdaisland/kaocha</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"0.0-529"</span><span class="p">}}</span><span class="w">
                      </span><span class="no">:main-opts</span><span class="w">   </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"kaocha.runner"</span><span class="p">]}</span><span class="w">
           </span><span class="no">:outdated</span><span class="w"> </span><span class="p">{</span><span class="no">:extra-deps</span><span class="w"> </span><span class="p">{</span><span class="n">olical/depot</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"1.8.4"</span><span class="p">}}</span><span class="w">
                      </span><span class="no">:main-opts</span><span class="w">  </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"depot.outdated.main"</span><span class="w"> </span><span class="s">"-a"</span><span class="w"> </span><span class="s">"outdated"</span><span class="p">]}</span><span class="w">
           </span><span class="no">:uberjar</span><span class="w">  </span><span class="p">{</span><span class="no">:extra-deps</span><span class="w"> </span><span class="p">{</span><span class="n">uberdeps</span><span class="w"> </span><span class="p">{</span><span class="no">:mvn/version</span><span class="w"> </span><span class="s">"0.1.4"</span><span class="p">}}</span><span class="w">
                      </span><span class="no">:main-opts</span><span class="w">  </span><span class="p">[</span><span class="s">"-m"</span><span class="w"> </span><span class="s">"uberdeps.uberjar"</span><span class="w"> </span><span class="s">"--target"</span><span class="w"> </span><span class="s">"target/cdeps-0.1.0.jar"</span><span class="p">]}}}</span><span class="w">
</span></code></pre></div></div>

<p>Everything should be up to date:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>clj <span class="nt">-Aoutdated</span>
All up to <span class="nb">date</span><span class="o">!</span>
</code></pre></div></div>

<h3 id="summary">Summary</h3>

<p>This guide covers basic use-cases in the daily workflow with Clojure. Of course there is always more than I presented
here, like deploying the project to <a href="https://clojars.org/">Clojars</a>. The process is still not fully automated and I
will try to cover it with the next post.</p>

<p>The source code for this post can be found <a href="https://github.com/tomekw/cdeps">here</a>.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[After a rather long break from programming and Clojure I decided give them another go. Recently, Clojure CLI tools are becoming more and more popular, though.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/clojure.png" /><media:content medium="image" url="https://tomekw.com/assets/images/clojure.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Stéphane Carrez</title><link href="https://tomekw.com/ada-programmers-stephane-carrez/" rel="alternate" type="text/html" title="Ada programmers: Stéphane Carrez" /><published>2019-05-07T00:00:00+00:00</published><updated>2019-05-07T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-stephane-carrez</id><content type="html" xml:base="https://tomekw.com/ada-programmers-stephane-carrez/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Edward Fish, can be found <a href="/ada-programmers-edward-fish">here</a>.</p>

<p>Today we will talk with Stéphane Carrez. You can follow him on <a href="https://github.com/stcarrez">Github</a> or on
<a href="https://twitter.com/StephaneCarrez">Twitter</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>While at school I created my own Z80 computer, because my father didn’t want to buy one. Instead, he gave me the Zilog
datasheets and encouraged me to build one. I started to write the code in Assembly on a paper and I typed the
hexadecimal opcodes by hand on the EPROM programmer. It was fun, difficult but I learnt a lot. My father was also a
defensor of Ada (retired now), and he also gave me the opportunity to learn Ada83 with the Alsys compiler in 1986.</p>

<p>After being graduated from ISEP in 1990, I worked on an Ada83 program for the French army during my military service.
It was challenging due to the lack of access types for functions and procedures (introduced in Ada 95). Ada generic was
the solution but there were bugs on the Alsys compiler (and MS-DOS didn’t helped either).</p>

<p>Later I created another computer board based on 68HC11 and to use it I also did a complete port of the GNU compiler,
the GNU binutils and the GNU debugger. My work was integrated in the FSF sources in 2000. The GNAT Ada compiler was
working! I was able to run a small Ada program that fit in less than 256 bytes!</p>

<p>With the support for interface types in Ada 2005, I realized I won’t be blocked anymore by a number of limitations in
Ada 83 and 95. I started to create a complete framework that would allow building web applications by using Java-like
design patterns. Since 2009, I’m building the <a href="https://github.com/stcarrez/ada-awa">Ada Web Application</a> framework by
using my professional experience in developing Java J2EE applications. Java J2EE is slow and bloated but it defines
several useful patterns that help in designing servers. I just pick some of them and implement them in Ada.</p>

<p>In 2016, AdaCore released a first version of the Ada Drivers Library and launched the first <a href="https://www.makewithada.org">MakeWithAda</a>
competition. I bought an STM32F746 board, played a little with their drivers and I was soon interested in writing an
embedded network IPv4 stack to analyse Ethernet packets (this was a part of my work at Bouygues Telecom).
<a href="https://github.com/stcarrez/etherscope">EtherScope</a> was born and I won the competion. Since then I participate in the
competition in the judging process.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>There is more than one feature I really love. To cite one, I’ll mention the Ada protected types. Having worked on a lot
of multi-threaded C++ applications, the Ada protected type provides the best encapsulation to protect concurrent accesses.
Writing safe multi-threaded applications is difficult and I’ve seen many developers doing things wrong, including me from
time to time. Ada protected type prevents a lot of mistakes.</p>

<h3 id="what-is-the-single-feature-you-dislike-the-most-in-ada">What is the single feature you dislike the most in Ada?</h3>

<p>Strings. Too many types to represent a string, you have to choose one between 9 possible types. And in many cases you
have to pick two (<code class="language-plaintext highlighter-rouge">String</code> and <code class="language-plaintext highlighter-rouge">Unbounded_String</code>) and then fall in the nightmare of continuously converting a string
type into another. Java did it better for that matter.</p>

<p>One string type to rule them all.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>Difficult. Ada is not an attractive language to newcommers. Our world is an immediate world where people don’t want to
spend time. Developers want to write fast and move on. For that matter, Python and JavaScript are more attractive.
The counter part is that many developers think short term: write code quickly, see it working (less than more),
deliver it or throw it away. Maintenance is out of scope.</p>

<p>Ada is a language for people who think long term. You have to think more about the design of your program. Because Ada
defines a lot of constraints this design phase is more complex and can be longer. It does not fit well in our immediate
world where you don’t want to think but see the thing run immediately. Of course the benefit is the quality of the final
program. This is why the language fits well for long term and big projects.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>In fact Ada 202X will have many new features that look very promising: parallel loops (<a href="http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0119-1.txt">AI12-0119-1</a>),
Map/Reduce attributes (<a href="http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0246-1.txt">AI12-0262-1</a>),
Bignum packages (<a href="http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0208-1.txt">AI12-0208-1</a>). To mention one
evolution, the new assignment target name described in <a href="http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0125-3.txt">AI12-0125-3</a>
(<code class="language-plaintext highlighter-rouge">@</code>) is nice to simplify constructs where you want to update a value by doing a computation on them.</p>

<p>Instead of:</p>

<div class="language-ada highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">My_Package</span><span class="p">.</span><span class="n">My_Array</span><span class="p">(</span><span class="n">I</span><span class="p">).</span><span class="n">Field</span> <span class="o">:=</span> <span class="n">My_Package</span><span class="p">.</span><span class="n">My_Array</span><span class="p">(</span><span class="n">I</span><span class="p">).</span><span class="n">Field</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
</code></pre></div></div>

<p>write:</p>

<div class="language-ada highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">My_Package</span><span class="p">.</span><span class="n">My_Array</span><span class="p">(</span><span class="n">I</span><span class="p">).</span><span class="n">Field</span> <span class="o">:=</span> <span class="err">@</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> 
</code></pre></div></div>

<p>Now I wish Ada could integrate several features that we see in other languages to simplify the syntax such as:</p>

<ul>
  <li>a case statement on strings</li>
  <li>a <code class="language-plaintext highlighter-rouge">finally</code> block statement similar to that of Java</li>
  <li>the generalization of the dot method call notation.</li>
</ul>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Stéphane Carrez]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Edward Fish</title><link href="https://tomekw.com/ada-programmers-edward-fish/" rel="alternate" type="text/html" title="Ada programmers: Edward Fish" /><published>2019-04-10T00:00:00+00:00</published><updated>2019-04-10T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-edward-fish</id><content type="html" xml:base="https://tomekw.com/ada-programmers-edward-fish/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Fabien Chouteau, can be found <a href="/ada-programmers-fabien-chouteau">here</a>.</p>

<p>Today we will talk with Edward Fish. You can follow him on <a href="https://github.com/OneWingedShark/">Github</a> or visit his
<a href="http://edward.fish/">website</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>I’m Edward Fish, my formal educational background is Computer Science with a bit of passion for Software Engineering.
I taught myself programming with Turbo Pascal for Windows 1.5, just the compiler and printed documentation back when I
was perhaps 12 or so. After that I did a little Delphi 5 and got into college where we did C, C++ and Java — the former
two were quite a shock because of how bad these were from a usability and correctness perspective: at least 90% of the
segment fault/core dump errors beginning students encountered could have been detected by the compiler given saner
language-design.</p>

<p>During this time I developed a bit of a passion for Operating Systems and their design, as well as a dislike for C, Unix,
and Linux — the latter because any time I brought up my interest in Operating Systems my fellow-students in the CS
program would say “why don’t you just download Linux [and tweak it from there]?”, completely missing the point that I
didn’t want to merely “tweak” other source code, be constrained to their design &amp; architectures, or hampered by the
implementation-language’s (read C’s) pitfalls — and ended up writing an OS (or rather the beginnings of one), in
Borland Pascal 7. I got it to the point where I had screen-display/mode-control, could recognize commands, and then got
stumped on memory-management (which I wanted to be available not only to the OS, but programs as well, much like .NET
Framework or Java do for their programs) before getting swamped with schoolwork and backburnering the project.</p>

<p>I was introduced to Ada in one single class, Programming Languages, which did a high-level introduction/survey of various
languages and instantly felt at-home. It did raise the question as to why a lot of the features aren’t common in more
languages: range-types; tasks; generics that can take functions, values, and other generics as parameters — why do so
many languages instead opt to copy C and its inherently broken syntax and anemic view of problem-solving? — I still
don’t have a real answer to this question, but suspect that it’s because C was easy to implement and basing a language
on it allowed a lot of language-designers to skip-over the hard parts… essentially ignoring “Everything should be as
simple as it can be but not simpler!” because the superficial solution seems to work; much like trying to use RegEx
to parse HTML or CSV.</p>

<p>After getting my degree, most of most of my career has been maintenance, everything from PHP to VB.net to C#, and it’s
this experience that made me really appreciate how Ada was designed for both correctness and for maintainability. About
a year ago I got onto the ARG and VASG boards, the standardization bodies for respectively Ada and VHDL, albeit as a
nonvoting member on both.</p>

<p>Nowadays I’m working for NMSU at the Dunn Solar Telescope at the observatory in Sunspot, NM. The system has everything
from a vxWorks running on a Motorola 68k to Solaris running on SPARC and Intel, to Windows 7 and Server 2008, all
kind-of organically grown over the course of three or four decades. — Right now I’m doing more IT support than
software-development, but I do have the intention of simplifying things into a designed system which Ada plays a big part.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>As some people have answered there’s no single feature — I really like Tasks, the generics, Private types, and
Packages… but I suppose a lot of this can be distilled to a single feature: design which values correctness
and maintainability.</p>

<p>It’s arguable if that’s a feature of the language though, so I’ll let the readers decide the answer for themselves.</p>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>If you’re referring to the language itself, then how protected-objects expose implementation within the specification
rather than forcing that into the private or body of the protected object.</p>

<p>If you’re referring to the standard-defined/-mandated libraries and such, then the combinatorial explosion of packages
due to <code class="language-plaintext highlighter-rouge">Character</code>, <code class="language-plaintext highlighter-rouge">Wide_Character</code>, <code class="language-plaintext highlighter-rouge">Wide_Wide_Character</code>, their respective <code class="language-plaintext highlighter-rouge">Strings</code>, and text-handling — I’d really
love to condense these down so that e.g. <code class="language-plaintext highlighter-rouge">[Wide_[Wide_]]Text_IO</code> were merely instantiations of a single generic package.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>I can see it going both ways, though obviously I hope for the good outcome. A lot of the issues can be illustrated by
the dominance of the language by AdaCore; on one hand it’s problematic in that they’re ignoring a lot of possibility
by marketing to the safety-critical and embedded-systems folks, on the other it’s positive in that there is some
corporate sponsorship of the language.</p>

<p>There’s a lot the language offers, and I think that a game-company jumping on the language could dominate the industry
on a technical level… or an OS developed in Ada, taking advantage of things like the Task construct — but both of
these have other factors that would make-or-break their success: the game-company is going to fail if the games aren’t
fun or they treat their customers poorly, even if vastly technically superior; just like the OS will fail if they
mindlessly copy existing OS-environments (e.g. rewrite Linux in Ada!) or don’t have user-applications.</p>

<p>There’s also a lot of “chicken-and-the-egg”-style bootstrapping problems that need to be overcome in various ways.
Just like the OS example above, or new/better tooling, or a successful game-company, or even getting a new &amp; functional
open-source compiler into the environment. It’ll take a lot of work, and perhaps a little luck, but the best possible
future of Ada is great… and even a modestly good future is pretty good.</p>

<p>Towards alleviating some of these problems, I am working on re-launching <a href="https://github.com/OneWingedShark/Byron">Byron</a>
— which is a MIT-licensed Ada compiler written in Ada — after I redo the design-documentation; and I am interested in
doing an OS in Ada, and might start a thread to that effect on OS-dev and/or comp.lang.ada if and when I write up a
design-document for it.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>Aside from the stuff already going in like parallel-blocks, parallel-for, and reductions?
<a href="http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0268-1.txt?rev=1.2&amp;raw=N">My own proposal</a>, which is a way to
automatically instantiate generics from the parameters of generics — admittedly some of that might be my own pride,
but I think the idea could be helpful in allowing tighter, more maintainable code.</p>

<p>It would also be really nice to have a sort of provable, abstract generic whereby [current (and future)] features of
the language could be described and verified… but that’s getting into a sort of meta-language rather than the language
itself.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Edward Fish]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Fabien Chouteau</title><link href="https://tomekw.com/ada-programmers-fabien-chouteau/" rel="alternate" type="text/html" title="Ada programmers: Fabien Chouteau" /><published>2019-04-04T00:00:00+00:00</published><updated>2019-04-04T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-fabien-chouteau</id><content type="html" xml:base="https://tomekw.com/ada-programmers-fabien-chouteau/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Olivier Henley, can be found <a href="/ada-programmers-olivier-henley">here</a>.</p>

<p>Today we will talk with Fabien Chouteau. You can follow him on <a href="https://twitter.com/DesChips">Twitter</a>
and <a href="https://github.com/Fabien-Chouteau">Github</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>My name is Fabien Chouteau, I am embedded software engineer at AdaCore, hobbyist in electronics, instrument
making and woodworking.</p>

<p>After my master degree at EPITA in 2010, I joined AdaCore for a six months internship to develop the support of
multicore systems (SMP) in the GNAT Ravenscar run-time. Beside a short introduction at school, this internship was my
first experience with Ada.</p>

<p>Since then, my technical work at AdaCore mostly revolves around the GNAT Ravenscar run-time (maintenance, customer
support, new features, new hardware platforms, certification activities, etc.) as well as the GNATemulator product
which is a CPU simulator based on QEMU.</p>

<p>A couple years ago I started the Ada Drivers Library project, at first it was just a way to have fun with an ARM
Cortex-M micro-controller board and see how Ada can be used on such hardware. It became a one stop shop for getting
started in embedded Ada programming and sparked many other projects like: <a href="https://blog.adacore.com/search/results?q=ARM">blog posts</a>,
<a href="https://github.com/adacore/certyflie">Certyflie</a>, <a href="https://github.com/adacore/svd2ada">svd2Ada</a>, AdaCore technical
demos, etc.</p>

<p>Around the same time, a group of colleagues and I started an effort inside AdaCore to help the Ada/SPARK community grow,
and revive the link between AdaCore and the community. Some of the results of this effort are:</p>

<ul>
  <li>Moving many of our projects to GitHub</li>
  <li>Have a simpler contribution process</li>
  <li>The <a href="http://makewithada.org/">Make with Ada</a> programming competition</li>
  <li>The new interactive learning website: <a href="https://learn.adacore.com/">learn.adacore.com</a></li>
</ul>

<p>And we have exciting plans for the future. As I said, one of the goals is to revive our link with the community,
so don’t hesitate to talk to us and share feedback or ideas.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>Representation clauses. They are a way to precisely describe the hardware representation of types. In particular it
can be used to describe memory-mapped registers of hardware devices. As driver developer I am so glad not to use bit
masks and shifts to communicate with the memory mapped registers. With representation clauses, Ada provides the safest
and most readable hardware/software interface.</p>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>I would say a feature that is both extremely good but also very annoying for embedded, is that Ada allows functions to
return objects of unconstrained types (the size in not known at compile time). This feature is awesome for string
manipulation, and it is one of the reasons why you don’t need as much pointers in Ada as you need in other languages.
But GNAT implements this with a second call stack. Call stacks are already difficult for users to manage on systems
where the resources are limited, because it is not easy to know what the size of the stack should be and because
detecting stack overflow is complicated. Having two is twice the pain.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>For the industrial side of things, it is safe to say that Ada and SPARK have a long and prosperous future in safety
critical domains such as aerospace or railway. It is also interesting to see new domains starting to use Ada and SPARK,
for instance for security reasons.</p>

<p>On the community side, my main interest is on embedded so I wish to see more people use Ada for this kind of projects.
There is also the Alire package manager project which I think will be a game changer for Ada. You can find many
interesting projects here and there, but having all of them in a single place, easy to find, easy to integrate into
your own code will boost collaboration within the community.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>On the real-time/embedded front there is the new profile called Jorvik, it is an evolution of <a href="https://blog.adacore.com/theres-a-mini-rtos-in-my-language">Ravenscar</a>
that is less restrictive. One of the differences is that it allows multiple entries on a protected object. For example
you can use this to have protected buffers with one entry for producers and one for consumers, which is not possible with
Ravenscar. A prototype implementation of Jorvik is already available in the ‘ravenscar-full’ run-times provided with
GNAT Pro and GNAT Community.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Fabien Chouteau]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Oliver Henley</title><link href="https://tomekw.com/ada-programmers-olivier-henley/" rel="alternate" type="text/html" title="Ada programmers: Oliver Henley" /><published>2019-03-08T00:00:00+00:00</published><updated>2019-03-08T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-olivier-henley</id><content type="html" xml:base="https://tomekw.com/ada-programmers-olivier-henley/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Vinzent Höfler, can be found <a href="/ada-programmers-vinzent-hofler">here</a>.</p>

<p>Today we will talk with Olivier Henley. You can follow him on <a href="https://twitter.com/olivierhenley">Twitter</a> and
<a href="https://github.com/ohenley">Github</a>. You can check out his <a href="https://github.com/ohenley/awesome-ada">awesome-ada</a>
repository: a curated list of awesome resources related to the Ada and SPARK programming language.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>I first graduated in Fine Arts but from as long as I can remember I always been attracted by the deep and beautiful
implications of rational thinking. In my twenties I started to be interested in creating sculptures using machines.
For a while I tried to learn the engineering needed to make robots as an autodidact but then quickly realised I needed
proper training to get anywhere serious. I entered engineering school, electrical, and from there felt in love with
programming. The depth of the discipline is incredible, you never stop learning fundamental stuff. I feel it always 
pushes me to better understand the world that surrounds us. To me it is one of the greatest mental exercise one can find.</p>

<p>Before attending engineering school, around 2004, I was working as an alpine ski instructor and learning C by myself 
using the Beej’s Guide to C Programming. One evening I give a class accompanied by an older, part-time, instructor 
that designed chips for a UK space company for a living. All proud I tell him about my part-time C autodidact learning. 
Upfront he said: “Don’t learn C, learn Ada?”. Back home that night, curious, I got informed about Ada on the web but did
not found much at the time. I understood the ‘deal’ with Ada but I also felt it was beyond my competencies to really
argue a perspective about it against any other programming languages let alone C.</p>

<p>In engineering school, they taught us C++. I first did an internship followed by a full fledge job at Ubisoft Montreal.
I developed a patent around the Kinect camera for the game Your Shape: Fitness Evolved; a 3D temporal filter implemented
over graphic shaders. Then moved to some R&amp;D, then AAA game productions such as Rainbow Six: Siege, followed by ForHonor.
At Ubisoft, everything is C++/C#. These days I work as a software contractor for Autodesk, again full C++.</p>

<p>In my spare time, I work on two distinct personal projects; the details being secrets for the moment. I work with Ada,
Golang and Dart.</p>

<p>During the years, the more I learned about software engineering, architectural strategies, optimization etc the more I
kept coming back to Ada; in part to see what was their take on these issues but also because other languages always
left me frustrated around some quirks elevated to defacto idioms.</p>

<p>Every single time I looked into Ada, I concluded they nailed the right solution. In my view the Ada design team always
address core issues and do not give much importance to the ‘sugar’. In the end that’s what you want. By constantly
addressing the fundamentals correctly, the language becomes ‘freakingly’ coherent and in turn, powerful. If you think
about it, this worths gold. When you learn something in Ada you will almost never get bit by a side effect or an exception
to the rule and everything is set in place to achieve correct program without impeding on performances. If you think
C++ can be elegant and performant, you have never seen Ada code.</p>

<p>Few engineers from other languages are accustomed to such reality so they often fail to even understand the case for Ada.
For them, software crafting is inherently a moving target and they accept all kind of ‘irregular frame of work’ as long
as they feel empowered by some tools, syntactic/semantic shortcuts and a perception of novelty; an overall impression
that a proper combination of these necessarily leads to a productivity speedup. What most do not realize is that any
fundamental flaw or missing fundamental feature in a language will cost you and others tenfold what you might gain from
the sum of any programming conveniences.</p>

<p>As an example, why would you even spend time using Python knowing that you’ll eventually hit the Global Interpreter Lock
(GIL) and generally poor performances all along? Absolutely no programming sugar will ever compensate the fundamental
limitations you locked you in over the long run. It is foolish to think that any ‘serious’ software does not need to be
fast and will not eventually need some proper concurrency. In my opinion, all efforts to circumvent these flaws, eg. C
core routines glued using Python, shows a tremendous lack of competency, curiosity, and knowledge. This kind of
‘architecture’ has systematically lead to pure extensibility and maintenance hell yet we are still flooded with ads and
blog post suggesting to learn and use Python for everything. Since the 80s competent engineers have argued for an
objectively better technology, named Ada, and most have ignored them, for dubious reasons, leading us to the mess we
are in today.</p>

<p>Other good examples are cURL and OpenSSL. Have you ever wonder how many bugs, problems, headaches, security breaches
and man hours would have been saved if those programs were written in Ada from the start? It is not even funny; yet you
will find armies of pals ‘a la’ Linus Torvald or Eric S. Raymond, a majority being clueless about how and why Ada would
have saved the show for decades now, to defend the C choice.</p>

<p>Ada shines because it is a pioneering low level and mature programming language that, when evaluated over all aspects
of programming is still, to this day, the most modern, powerful, productive and advanced language there is. If you
disagree or think that I am wrong, it is either because you do not know Ada or because you are not approaching the
problem objectively. Ada has no garbage collector, has pointers, is bare metal and therefore exhibit tremendous
performance on any platforms, is truly portable, has arguably the most advanced type system, has generics, is build
around concurrency, has predictable timing capabilities, has mature tooling, has tons of provision to make huge code
bases with complex requirements fly, is easy to learn, write, use, share and deploy. No other languages can claim to
offer all that, period.</p>

<p>The typical work flow in Ada generally goes like this. You write the program and work out your solution to make it
compile under the Ada ‘boundaries’ (the Ada compiler can be severe for newcomers that tries to code using a C based
approach). When it compiles, you already secured a lot; depending on the complexity, often the whole thing is just
virtually bug free at this point, hardened already. Then you run, test the program. Now if this soft has to fail it
will fail fast; again you are securing great things right away. Ada pushes your program flaws to the surface in such
a precise way, eg. compared to C++, it is almost a pleasure to find out about them; messages are concise, meaningful
and strict in regard to the ‘coding contract you developed with the language when you first learned it’. The language
mechanism and standard libraries exhibits excellency both conceptually and practically which really helps underlining
design flaws. Once you revisit and fix the offending parts of your programs, which were in essence always flimsy or
plain and simple not properly designed, the whole thing will start to run… and it will not stop. Rapidly your program
behaves like an ‘atomic clock’. Writing Ada code feels like playing with this super reliable hifi amplifier made in
the 70s that still delivers the best, clean and powerful sound there is even after having been abused for years; you
are dragged in ‘deep respect land’. Once you experience what I call the Ada ‘solidity’, other technologies starts to
feel like tacky toys … really.</p>

<p>The guys who laid out the Ada foundations were brutally smart. Take C++ global namespaces, named namespaces and
anonymous namespaces. Combination of those three often leads to pure abomination in terms of maintenance, integration,
compiling, porting, linking, errors reporting etc. These ‘flexible’ C++ features, when deployed in huge and complex
software projects become liabilities; they are in fact ‘unstable’ features. In stark contrast, Ada packages are
extremely straight shooters. They ‘behave’ correctly all the time, in all context; the thing is simple and just well
designed. If the Ada packages piss you off at some point, it’s always for a good reason; you are the “hackery pervert”,
not the language. In my experience even if it was sometimes hard to admit, in the end, Ada was always right about my
design and bending to its ruling undeniably made my architecture better.</p>

<p>If it was the end of the world and I had to choose a single compiler to get on a machine it would be an Ada one,
not because I am blindly sold to the language but because it has shown to me, practically, to be superior in every
possible way.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>Not a single feature per se but I would say, its super low level to super high level capabilities wrapped in sound
mechanism with virtually no redundancy. Look at any <a href="http://rosettacode.org/wiki/Rosetta_Code">Rosetta Code</a> problem;
the Ada solution always shines for its clarity and implicit performance; C/C++ ballpark. It has the approachability of
modern scripting languages, flexibility/reach of true bare metal and the maturity of a language ecosystem that kept
evolving over many decades; from a time where resources were limited to a time where computing is ubiquitous. Ada is
geared towards making applications in a productive, reliable way without wasting CPU cycle. What more would I want?</p>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>None really. I get there is some annoyances here and there (see <a href="/ada-programmers-luke-a-guest">Luke A. Guest interview</a>
for a comprehensive overview), but I do not consider those fundamental flaws. I am used to deal with way worse. I too,
would appreciate a fork, a reboot, without compromises but the politics and the money does not seem to be there.
On the other hand Ada is more than good enough, so.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>Very bright actually. I think more and more talented people are getting over syntactic sugar, hype, typeless uselessness,
bloated abstraction, functional orthodoxy and realize how it adds nothing to ‘real world software’ quality. From that
point on Ada will pick up because it has more to offer than anyone can need.</p>

<p>Personally, under comparable effort and tech availability, I do not see why any of my company’s software would not
deserve to be built upon what makes airplanes stay in the air and satellites tick. I actually think the best competitive
advantage one could get, as we speak, is to build everything in extremely robust and performant, yet productive, fashion;
this is exactly what Ada offers you. If I was a big boss I would force everything in Ada because over time building upon
previous solid work can only get you lasting results. Do not forget that compared to C++11, Ada 2012 is really easy to
learn, use and deploy; I know what I am talking about, I experience both almost every day.</p>

<p>The state of affairs these days in big C++ shops is a bit sad in my opinion; reusability is near zero (with reasons),
redundancy is all over, maintenance is a nightmare, most solutions are more complex than they would need to be, velocity
is always halted by extremely cryptic ‘legacy bugs’ of all sorts, major refactoring is practically impossible and any
prior foundation is shaky or has blurred boundaries more often than not … because of the combination of the previous
facts. It’s the ‘hacking culture meets corporations short term objectives and complete disinterest in craft’ crumbling
under its own weight in a sense.</p>

<p>I often say to people: “Let’s start to code airplanes in Javascript … Python maybe, no PHP of course!?” to make them
realize how absurd the current situation we live in is. I think more and more people starts to draw the same conclusion
and/or realise the profound meaning of such problematic postulate. If you ever find yourself fighting your smartphone,
your web browser, your OS, look no further; the whole thing has been ‘an almost complete hack’ for over 30 years now.
Ada is the low hanging solution and has a proven track record.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p><code class="language-plaintext highlighter-rouge">parallel for</code> … from what I understand it will be there.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Oliver Henley]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Vinzent Höfler</title><link href="https://tomekw.com/ada-programmers-vinzent-hofler/" rel="alternate" type="text/html" title="Ada programmers: Vinzent Höfler" /><published>2019-02-28T00:00:00+00:00</published><updated>2019-02-28T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-vinzent-hofler</id><content type="html" xml:base="https://tomekw.com/ada-programmers-vinzent-hofler/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Patrick Kelly, can be found <a href="/ada-programmers-patrick-kelly">here</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>My name is Vinzent Höfler, my first programming experience was at the age of 12, when I wrote BASIC programs into a
little notebook to be typed in later at the three to four hours a week during which I had access to an actual computer,
which was an 8-bit machine, comparable to the C64. Years later I started with Turbo-Pascal on my first owned computer
(a used IBM PS/2, with an amazingly fast 16 MHz Intel 386SX processor and whopping 2 megabytes of RAM). Then came the
Internet and with it Usenet and newsgroups, and it was around 1996 when a guy whose opinion I valued, mentioned Ada in
a discussion thread, so I dug into it. Coming from Pascal, the transition was relatively easy, the language syntax and
concepts are similar, but considerably strengthened in Ada. I actually learned the language from reading the reference
manual. I tried applying Ada in the job I had at that time, with some success. After a brief interlude at an automotive
company where I wrote applications in C for tiny microcontrollers, I got lucky and landed a contract job at the
Eurofighter program, which was my first all Ada job. These days I work at Eurocontrol in the team responsible for the
tactical flight planning (e.g. ETFMS).</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>The type system. First, the ability to declare types which relate to actual things in the real-world instead of just
being a machine type. Second, being able to make them distinct types which are not compatible to each other even if
they incidentally implemented the same way. You can have a type <code class="language-plaintext highlighter-rouge">Altitude</code>, a type <code class="language-plaintext highlighter-rouge">Voltage</code>, and a type <code class="language-plaintext highlighter-rouge">Light_Year</code>
and even though they all may be 32-bit integers, there’s no way to confuse them. Looking at other languages, where I’ve
seen functions that take ten parameters of a type int(eger), ask yourself: How do you even ensure that each one gets
their correct value? In Ada, these can all be different types and even if they are of the same type, you can use named
notation which makes it possible to distinguish.</p>

<p>Also, Ada’s tasking system gets a honorable mention here.</p>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>Hate is a strong word. There is no single feature I can think of that I actually hate. I have some things I don’t
exactly agree with, but most of the time I understand the design decision behind them. Fixed string handling can be
cumbersome. Also, I don’t particularly like the notion of having <code class="language-plaintext highlighter-rouge">out</code> parameters in function calls, but I acknowledge
that the restriction has been rather artificial, anyway; since functions could always have side effects via global 
variables or could change their parameters by simply giving an “access” to them.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>Ok’ish, in a sense. From what I’ve seen, the adoption of Ada has grown slowly, but it is far from what I would wish.
It has always been quite strong in the safety critical software development (avionics, railways, etc.), but since
Ada2012 introduced pre- and post-conditions into the language, and the SPARK subset for formal proof was revised
accordingly, it also seems to gain some traction in the security critical community and I expect that particular
interest to grow. We live in a time where virtually every device wants to be connected to the internet software related
security issues are still ubiquitous. The adoption of Ada/SPARK would certainly be helpful in alleviating a lot of
those. But there seems to be a steep learning curve involved, still many companies don’t even acknowledge that
security should be part of their product requirement.</p>

<p>I’d like to see more compilers for Ada, though. If you want to have a compiler for the current language, AdaCore’s
GNAT is the only option. There are a few other compiler vendors out there, but to my knowledge, GNAT is the only
Ada2012 compiler and will most likely be for the foreseeable future. Luckily, GNAT is part of GCC, so at least in
that regard it’s not likely to disappear.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>Honestly, I actually haven’t really thought about it. I’m quite happy with what we have now. That being said, I look
forward to Ada202X, language support for fine grained parallelism is a nice thing to have.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Vinzent Höfler]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Patrick Kelly</title><link href="https://tomekw.com/ada-programmers-patrick-kelly/" rel="alternate" type="text/html" title="Ada programmers: Patrick Kelly" /><published>2019-02-21T00:00:00+00:00</published><updated>2019-02-21T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-patrick-kelly</id><content type="html" xml:base="https://tomekw.com/ada-programmers-patrick-kelly/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>The previous interview, with Luke A. Guest, can be found <a href="/ada-programmers-luke-a-guest">here</a>.</p>

<p>Today we will talk with Patrick Kelly. You can follow him on <a href="https://twitter.com/pkell7">Twitter</a> and
<a href="https://github.com/Entomy">Github</a>. You can check out his <a href="https://github.com/Entomy/Ada-vscode">Ada extension</a>
for Visual Studio Code and a <a href="https://github.com/Entomy/Ada-tools">collection of tooling for Ada projects</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>My name is Patrick Kelly, although I usually go by Entomy in online circles. I’m likely one of the more abnormal
programmers, especially in something as formal as Ada, as I have no CS/IT background at all. I don’t have any formal
education in CS/IT. I’ve never even taken a class in it. I’ve done work as a nurse, saleman, and cook.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<p>My single most loved feature of Ada might come as a surprise to others, but it’s not how “safe” the language is. I’m
glad it is, but honestly it could be a bit less safe and I’d still be happy. Rather, I go for an odd one: Ada’s finely
granular and sophisticated type system. I’ve taken advantage of this to enable or ease all sorts of things that other
languages either struggle with or have bizarre syntax to accomplish.</p>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>As for hate, is the userbase a feature? In all seriousness though, aspects are obnoxiously rigid. We can override
<code class="language-plaintext highlighter-rouge">Input</code>/<code class="language-plaintext highlighter-rouge">Output</code> and <code class="language-plaintext highlighter-rouge">Read</code>/<code class="language-plaintext highlighter-rouge">Write</code>, but we can’t override <code class="language-plaintext highlighter-rouge">Image</code>? Why? For composite types <code class="language-plaintext highlighter-rouge">Image</code> is just a function
call to the composition of the constituent images. While things like <code class="language-plaintext highlighter-rouge">Size</code> or <code class="language-plaintext highlighter-rouge">Unchecked_Access</code> should definitely
never be overridable, there’s valid reason to override certain aspects. Because of this you have to keep track of which
types actually have the <code class="language-plaintext highlighter-rouge">Image</code>, or which have a function to do the same and what that function is called. It’s
unnecessary developer complexity.</p>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>I see it as horrible. Most of the community is blindly full of themselves and it means while things develop nicely for
existing Ada developers, very little is actually done to attract new developers to the language. Clearly there is an
interest with the explosion of Rust. One of the most important things learned in sales is, obviously, how to sell, and
I can safely say Ada isn’t being “sold” well at all, mostly because of a complete lack of understanding or
misunderstanding of why people aren’t adopting the language.</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>What I’d most like to see is never going to happen. A complete rewrite of the garbage that is GNAT/GCC-Ada with a
toolchain and toolset that isn’t as fragile as sugar glass.</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Patrick Kelly.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ada programmers: Luke A. Guest</title><link href="https://tomekw.com/ada-programmers-luke-a-guest/" rel="alternate" type="text/html" title="Ada programmers: Luke A. Guest" /><published>2019-02-15T00:00:00+00:00</published><updated>2019-02-15T00:00:00+00:00</updated><id>https://tomekw.com/ada-programmers-luke-a-guest</id><content type="html" xml:base="https://tomekw.com/ada-programmers-luke-a-guest/"><![CDATA[<p><em>This is series of interviews with software developers interested in Ada programming language. The goal is to promote
the community members and the language itself. Do you want to take part in this? Contact me!</em></p>

<p>Today we will talk with Luke A. Guest. You can follow him on <a href="https://twitter.com/Lucretia9000">Twitter</a>
and <a href="https://github.com/Lucretia">Github</a>.</p>

<h3 id="could-you-introduce-yourself-whats-your-background-what-do-you-do">Could you introduce yourself? What’s your background? What do you do?</h3>

<p>My name is Luke A. Guest. I started programming on a ZX Spectrum where I learnt Spectrum BASIC, I later moved onto an
Atari ST where I was mainly messing about in STOS BASIC. It wasn’t until getting an Amiga 500+ that I came across
a multitasking OS and started using more serious languages.</p>

<p>On the Amiga I learnt m68k assembly in a week and started messing about with the hardware, programming game type things,
i.e. getting sprites on the screen and moving them about. Learning about the Copper was really cool, this extra
processor with three instructions, which controlled the entire display something I’d never come across before. Other
machines of the time either did what they needed with a single external chip, i.e. Spectrum’s ULA, I have no clue what
the ST used, but I know it wasn’t anything special, only high-end machines, e.g. SGI, were using custom chips for each
part of the hardware.</p>

<p>I can’t remember the timeline exactly, but I did learn C at college on 386’s at the time using Borland’s Turbo C. I was
also using AmigaE developing native applications on the OS using the Intuition libray (Amiga’s UI). Even though I’d read
that AmigaE had it’s history in Ada, C++ and Lisp, I didn’t really take much notice of the Ada part as I’d never heard
of it at that time.</p>

<p>I had a number of Amiga machines, A500+, A1200, A4000 until I finally caved and went PC with Linux as the OS. I’ve been
using Linux excusively since the late 1990’s I think. I’ve used various distributions, Red hat, Manjaro, Debian, but
finally stuck with Gentoo. I actually had Debian m68k running on my A1200 at uni.</p>

<p>I’m currently not doing any programming work now, but I am looking at getting back into it.</p>

<h3 id="why-did-you-start-using-ada">Why did you start using Ada?</h3>

<p>We had to learn Ada at uni in 1995, then it was called Ada9X, they said it was going to be called Ada95 eventually.
I have no idea how Ada9X from then differs from Ada95 now. I remember liking it, it made sense, but didn’t stick with
it at uni after the first year.</p>

<p>I was struggling for work and I ended up at a “games” company, which was a massive mistake, they were completely
Microsoft based, using MSVC 6 and Sourcesafe. There were many red flags I should’ve taken note of and left, but I didn’t
and I suffered for it, my health has declined massively. We were promised a lot and they never delivered at all.</p>

<p>Initially the projects were in C++, compiles took ages because of templates, even with pre-compiled headers.
Intellisense worked for the first week of the project then stopped and would never work again. It messed up formatting
all over the place which in turn would make the compiler would complain because of missing braces. Trying to find that
was a nightmare, because numerous closing braces were at the same level! You’d have to go and manually format it to find
where it was missing a brace. These weren’t small functions either, they were huge that would often go over multiple
pages on a 17” monitor. VisualStudio 7 was in alpha at that time and it was really unstable and just not usable.</p>

<p>Another source of frustration were crashes, you could literally spend weeks inside the debugger (which was the only good
part of MSVC, BTW) trying to find the error. The error was always a pointer or boundary error, which is the nature of
working with such languages.</p>

<p>Due to working there, I burned out badly, I was massively underpaid and overworked (I’m talking 15 hour days at times)
and treated like absolute shit, I was barely alive, to be honest.</p>

<p>They forced me out a month before they “went under” only to restart in private, they had the money by that time to do
that due to not paying us properly. I decided I wasn’t going back into games ever again and that I was not going to use
C or C++ again if I could help it.</p>

<p>At least for my own projects, I didn’t have to use it, I could whatever I wanted. I remembered using a language where
I’d never had to touch a debugger with, that was Ada95, and I’ve been with it ever since. Since using Ada, I have had
to go into a debugger, but nowhere near as much, but the reason for having to use a debugger? Always pointers, even Ada
cannot stop this, but it can help by asserting on the error and giving exact locations of the errors.</p>

<p>I really think Ada is the best programming language for game development, it has all the tools you need built into the
language.</p>

<h3 id="what-is-the-single-feature-you-love-the-most-in-ada">What is the single feature you love the most in Ada?</h3>

<ol>
  <li>Ranges, being sable to saying a percentage is <code class="language-plaintext highlighter-rouge">0 .. 100</code> instead of just int, is so powerful.</li>
  <li>Attributes, having a type system that can be queried and the results used is amazing.</li>
  <li>Modular types, auto-wrapping types are used all the time, but you can easily forget to do it correctly, it’s a
simple thing, but at three in the morning it’s not so easy to see an error. In games you want to have some kind of
animated sprite, if it’s a loop, you don’t want to be checking which frame you’re on, just increment the frame count,
it does it for you!</li>
  <li>A real for loop which isn’t dangerous like C’s is, how simple is <code class="language-plaintext highlighter-rouge">for Index in -50 .. 75 loop</code>? You cannot go wrong
there, you can’t use the wrong symbol and wonder why the final value isn’t being iterated!</li>
  <li>Visible blocks using <code class="language-plaintext highlighter-rouge">begin..end</code>.</li>
  <li>Packages, Ada has many ways to separate code, including separates.</li>
  <li>Real generics rather than hacky C++ templates.</li>
  <li>Not having to use <code class="language-plaintext highlighter-rouge">Main()</code>/<code class="language-plaintext highlighter-rouge">main()</code> as your entry point, creating a function or procedure with the name of the
application just seems obvious.</li>
  <li>Arrays can start anywhere, they can also be indexed by enumerations and characters (which are enumerations).</li>
  <li>With representation clauses you can define types with the <strong>exact</strong> data definition you need without issues <sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>.
You can define this is a higher level, even a lower level language like C can’t get that right.</li>
</ol>

<h3 id="what-is-the-single-feature-you-hate-the-most-in-ada">What is the single feature you hate the most in Ada?</h3>

<p>As with the previous list, there’s no one thing:</p>

<ol>
  <li>Strings are a mess.</li>
  <li>The <a href="http://www.ada-auth.org/arg.html">ARG</a> doesn’t deprecate parts of the language properly, or at all??
The last time they did a major change was Ada83 -&gt; Ada95, they need to do something like that again.</li>
  <li>The language doesn’t evolve fast enough, the ARG is loathe to evolve the language too much as major changes will
break compatibility with existing code bases, which is a fair point, but is also a good reason to do it as a new
redesigned language.</li>
  <li>Ada has been irrationally hated since it’s inception and people hate it without even giving it a chance. Some people
look at it and if it doesn’t look like C, they won’t bother, even though it could easily save them hours of debugging
time or thousands/millions in financing a project.</li>
  <li>IDE integration is non-existent to very basic, a lot of the complaints of Ada being “a pain to write” would be
mitigated with auto-completion that works, and with <a href="https://langserver.org/">LSP</a> this is just the tip of the ice-berg.</li>
  <li>We cannot target iOS at all and Android easily, having an LLVM based compiler would help here.</li>
  <li>Monopoly of compilers. Vendors still think it’s right to charge a fortune for access to their compilers, this isn’t
the 80’s anymore, people didn’t like it then, they don’t like it now. There could be multiple compiler’s out there and
they could’ve been expanded to the new standards quicker if they were open.</li>
  <li>Unfortunately, representing endian-ness is a pain in Ada, it’s not easily done and can only really be done
with separate implementations for each endian type.</li>
  <li>No decent UI libraries are available for the language.</li>
</ol>

<h3 id="how-do-you-see-the-future-of-ada">How do you see the future of Ada?</h3>

<p>Ada has no future unless more people get on board using it, this means stupid licence games won’t help. A lot of people
coming to Ada still think it’s licensed under GPL v3 only, which means your source has to be GPL v3! This is so wrong,
only AdaCore’s Community Edition is GPL v3 licensed in this way. If you want your freedom, use the FSF versions from
your OS distribution, or MingW if you’re on Windows, or the GNAT from BREW if you’re on Mac OS X.</p>

<p>Take a hint from what happened to Eiffel, if you want a language to grow, it cannot be closed or pay walled.</p>

<p>Ada is still the only properly designed programming language out there. It’s still got things other languages still
don’t have or are implementing badly in the runtime or templates, cough C++!</p>

<p>If more people don’t use the language, there will be nobody to take over at the ARG when the inevitable happens. Which
means that the language won’t evolve.</p>

<p>Take a look at all the social media sites which have an Ada forum, they apparently list hundreds or thousands of people,
yet there’s only really about 5-10 people who ever post. There’s a lot of people, apparently, who could be helping make
a decent community, but they’re not. I’ve heard the argument of that they’re under NDA’s, security clearances, etc.,
but that doesn’t stop you from helping out. Having Ada as only a security language isn’t a good idea, it’s capable of so
much more, it is a general purpose language, after all!</p>

<h3 id="we-all-know-ada-202x-is-around-the-corner-what-would-you-like-to-find-in-the-new-release-of-ada">We all know Ada 202X is around the corner. What would you like to find in the new release of Ada?</h3>

<p>I already know what’s in the specification, it’s an open process, sort of,
<a href="http://www.ada-auth.org/ai-files/grab_bag/2020-Amendments.html">Ada 2020 Amendment Proposals As of February 11, 2019</a>
and <a href="http://www.ada-auth.org/standards/ada2x.html">Ada 202x Language Reference Manual</a> - the best new part is the
parallel blocks.</p>

<p>I’ve had thoughts of using these parallel blocks for GPU offloading, there’s no reason why we cannot compile Ada to
SPIR-V for example:</p>

<div class="language-ada highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">procedure</span> <span class="nf">Do_Something</span> <span class="k">with</span>
  <span class="n">GPU</span> <span class="o">=&gt;</span> <span class="n">SPIR_V</span><span class="p">;</span>
</code></pre></div></div>

<p>On the whole, the new parts are not enough, they’re only really handling bits of issues people have had with the
language, like having a user defined <code class="language-plaintext highlighter-rouge">'Image</code> attribute so you can define one for your new type and output an image
which makes sense. Or making certain packages more Unicode friendly.</p>

<p>I would like to see a redesign of the language or a new language which takes the good bits and discards the bad bits.
Something that is more rounded, orthogonal and more modern, i.e. Unicode String types done properly, there’s nothing
stopping a language supporting extra string types for Latin1, just not 16 and 32 bit versions, use Unicode for that.</p>

<p>Not using <code class="language-plaintext highlighter-rouge">'Image</code> for debugging only, this is currently the only form allowed by the designers of the language, you’re
supposed to use the generic packages inside <code class="language-plaintext highlighter-rouge">Text_IO</code> if you want more formatting capabilities. Really, they should’ve
added more parameters to <code class="language-plaintext highlighter-rouge">'Image</code> to make it better, along with custom image attributes, that would be perfect. Think
about all the different text formats in use now, we could easily convert to JSON, TOML, YAML, whatever?</p>

<p>I’m currently interested in pointer-less programming, I had a look through Niklaus Wirth’s Modula specification and
they have no pointers there, admittedly this is a language for tiny CPU’s like a Z80, which is fine, but that doesn’t
mean it cannot be done, see Java, but make it better. I like the idea of nullable types which can be null, but the
language does the tests for you or at least makes it easier, see <a href="http://www.zonnon.ethz.ch/">Zonnon</a>’s nullable types
and <code class="language-plaintext highlighter-rouge">?</code> operator.</p>

<p>Working with image data is done all the time, yet you’re forced to do it with a single dimension array; this is also
where zero-based array indices really shine, BTW. If you can slice one of those arrays, why not have multi-dimensional
array slices? It can be handled by the compiler easily and mapped to calls to <code class="language-plaintext highlighter-rouge">memcpy()</code> if that’s how you do it.
Say you want to copy a 2D portion of one larger image into it’s own image, having some sort of
<code class="language-plaintext highlighter-rouge">My_Image (x1 .. x2, y1 .. y2)</code> operation makes so much sense.</p>

<p>Concurrency at a lower level than Ada’s tasks, there’s no reason why you cannot build higher level task like objects,
in terms of the lower level concurrency primitives. Any language which boasts concurrency built in now, has to do it
better than the rest, so there’s that to cope with also.</p>

<p>One of the complaints against Ada currently is the amount of generics you have to implement to get anything done, a
new language has to have this in mind.</p>

<p>We’re not getting away from C or C++ any time soon, so any new language has to support variadic functions, even if it’s
just for importing from those languages and restricted so it cannot be used in the new <strong>sane</strong> language. I’m pretty
sure, variadic functions were invented because the C designers didn’t think of allowing overloaded functions, which is
the correct way to handle this.</p>

<p>I would even toy with the idea of removing semi-colons, thus possibly attracting Python programmers to the new language.</p>

<p>I would replace <code class="language-plaintext highlighter-rouge">begin</code> with <code class="language-plaintext highlighter-rouge">do</code>, I think this would help disassociate this new language from Pascal. For some reason,
people hate the <code class="language-plaintext highlighter-rouge">begin..end</code>, but in Pascal, it’s everywhere, in Ada, it’s not, it’s only statement blocks which have
them.</p>

<hr />
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Endian-ness is the only weak part of the representation clause system in Ada. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[This is series of interviews with software developers interested in Ada programming language. The goal is to promote the community members and the language itself. Today we will talk with Luke A. Guest.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/ada.jpg" /><media:content medium="image" url="https://tomekw.com/assets/images/ada.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Custom Ghost theme</title><link href="https://tomekw.com/custom-ghost-theme/" rel="alternate" type="text/html" title="Custom Ghost theme" /><published>2018-06-25T00:00:00+00:00</published><updated>2018-06-25T00:00:00+00:00</updated><id>https://tomekw.com/custom-ghost-theme</id><content type="html" xml:base="https://tomekw.com/custom-ghost-theme/"><![CDATA[<p>Few days ago I have migrated my homepage and blog from Medium to Ghost(Pro). The problem with open source software is
that it is easy to tweak and play with. I was not happy with the default theme Casper, so I have decided to create a
new one!</p>

<p>Thanks to the wonderful Ghost themes documentation and Bootstrap framework, I was able to deploy the first
production-ready version after few hours!</p>

<p>On purpose, it does not support 100% of the Casper theme features. It is clean, simple, and gets the job done.
:%I wanted an ascetic, easy on the eyes theme with just the pure essentials:</p>

<ol>
  <li>posts</li>
  <li>(Disqus) comments</li>
  <li>syntax highlighting</li>
  <li>proper metadata and structured data for Twitter Cards</li>
  <li>RSS</li>
</ol>

<p>Currently, there are some hardcoded bits in the code, like Github and LinkedIn links. Also it makes some assumptions
regarding the publication logo and icon - they have to be set to <code class="language-plaintext highlighter-rouge">60 x 60</code> rounded image to look good.</p>

<p>I forgot to mention I have called it <strong>bubu</strong> and I am happy to make it available to anyone interested! Either email me
(<code class="language-plaintext highlighter-rouge">theme at this domain</code>), or follow me on Twitter (<a href="https://twitter.com/_tomekw">@_tomekw</a>) and PM me, and we will
figure something out!</p>]]></content><author><name>{&quot;twitter&quot;=&gt;&quot;_tomekw&quot;}</name></author><summary type="html"><![CDATA[Few days ago I have migrated my homepage and blog from Medium to Ghost(Pro). The problem with open source software is that it is easy to tweak and play with. I was not happy with the default theme Casper, so I have decided to create a new one!]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://tomekw.com/assets/images/2018-06-25-custom-ghost-theme-logo.png" /><media:content medium="image" url="https://tomekw.com/assets/images/2018-06-25-custom-ghost-theme-logo.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>