<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>racket &amp;mdash; musicmatzes blog</title>
    <link>https://beyermatthias.de/tag:racket</link>
    <description></description>
    <pubDate>Wed, 06 May 2026 10:43:44 +0200</pubDate>
    <item>
      <title>The annoyance of programming language tutorials - or: Why learning rust feels amazing</title>
      <link>https://beyermatthias.de/the-annoyance-of-programming-language-tutorials-or-why-learning-rust-feels</link>
      <description>&lt;![CDATA[This article is about the annoyance of programming language tutorials. First, I&#xA;will argue why learning new programming languages always feels a bit like a pain&#xA;to me. And then I will tell you why learning Rust was different.&#xA;&#xA;!-- more --&#xA;&#xA;I know a few programming languages. I&#39;ve done things in C, Ruby, Java, Python,&#xA;PHP, C++, Bash, Lisp (Racket, actually), Haskell, LaTeX, Nix, Make, Lua and&#xA;JavaScript.&#xA;&#xA;small&#xA;    *: Only a bit, but still enough to say &#34;I&#39;ve done things in this language&#34;&#xA;/small&#xA;&#xA;When I started learning programming, I learned Java and shortly after that Ruby.&#xA;Both languages have their oddities, but besides their overall concept&#xA;(imperative programming and object orientated programming) they are both rather&#xA;easy to learn.&#xA;After that I learned C. Learning C was a new world for me back then, as I&#xA;only knew object orientation. I cannot remember which resources I&#39;ve been using&#xA;learning C, though I remember it was a pain. I had a good friend helping me,&#xA;which was awesome, though I struggled a lot with the new concept.&#xA;&#xA;After learning C, I did a fair amount of PHP. Learning PHP was simple (I&#xA;actually did it in one weekend and a few thousand lines), though it again was a&#xA;pain. It was a pain because of the tutorials and resources. And that&#39;s the point&#xA;I want to discuss here.&#xA;&#xA;All other programming languages I&#39;ve been learning so far were painful to learn.&#xA;Not because of their concepts (see Haskell, functional programming at all), but&#xA;because of the resources. Haskell is a really good example here. There is&#xA;exactly one resource I enjoyed while learning Haskell, and that&#39;s&#xA;&#34;Learn you a Haskell for great good&#34;.&#xA;And why? Because it takes your hand and shows you the new world. It is good&#xA;because the concept of functional programming is new for most people reading&#xA;this resource. Learning JavaScript, Bash, Lua or Python sucks because you&#xA;already know what an object is. You know what a function or method is and you&#xA;know that the basic syntax for arithmetic is the very same as in the languages&#xA;you&#39;ve been using by now. But all tutorials expect you start from zero - which&#xA;is fine if you&#39;re actually starting from zero, but most of the time you&#39;re not.&#xA;After learning Java and Ruby I understood what OOP is (actually not after&#xA;learning Java, but after learning Ruby, because Java isn&#39;t a fully object&#xA;oriented language in my opinion).&#xA;&#xA;So, learning Haskell was kinda amazing. Learn you a Haskell is a really great&#xA;book and if you want to learn Haskell, you really should read it. But what was&#xA;even a better experience was learning Rust.&#xA;&#xA;So why is that? It is because Rust is a new concept and the old concept&#xA;(imperative programming). Learning Rust is not like learning Python after&#xA;learning Ruby. It is like Learning Haskell after learning Racket. The concept&#xA;behind the language is kinda the same, though it is different in most details.&#xA;&#xA;Plus, the Rust tutorials and resources are freakin&#39; awesome. Let me repeat that.&#xA;The tutorials and documentation of the tools, libraries and everything, the&#xA;resources on how to do things, are awesome!&#xA;&#xA;Every documentation for each library looks exactly the same, which is a huge&#xA;advantage over other languages library documentations. cargo, the Rust&#xA;build-tool builds the documentation locally for you, if you want that. So&#xA;working offline after you fetched the dependencies or your project (also via&#xA;cargo) is no hassle. Building a new project with cargo is absolutely painless,&#xA;its literally just executing a command, editing a textfile and executing another&#xA;command (setting up the project, writing down dependencies and meta information&#xA;about the project and building the project, which fetches the dependencies).&#xA;&#xA;So really, if you want to learn a new programming language, check out Rust. I&#xA;haven&#39;t even talked about its language features, and I will not, as this is not&#xA;the goal of this article. This article is about resources and tutorials. And my&#xA;conclusion is:&#xA;&#xA;All programming language tutorials suck. Except the Rust language tutorial.&#xA;tags:  #programming #open source #bash #c #c++ #haskell #nix #racket #rust #shell&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>This article is about the annoyance of programming language tutorials. First, I
will argue why learning new programming languages always feels a bit like a pain
to me. And then I will tell you why learning Rust was different.</p>



<p>I know a few programming languages. I&#39;ve done things in C, Ruby, Java, Python<em>,
PHP, C++, Bash, Lisp</em> (Racket<em>, actually), Haskell</em>, LaTeX, Nix, Make, Lua* and
JavaScript*.</p>

<p><small>
    *: Only a bit, but still enough to say “I&#39;ve done things in this language”
</small></p>

<p>When I started learning programming, I learned Java and shortly after that Ruby.
Both languages have their oddities, but besides their overall concept
(imperative programming and object orientated programming) they are both rather
easy to learn.
After that I learned C. Learning C was a new world for me back then, as I
only knew object orientation. I cannot remember which resources I&#39;ve been using
learning C, though I remember it was a pain. I had a good friend helping me,
which was awesome, though I struggled a lot with the new concept.</p>

<p>After learning C, I did a fair amount of PHP. Learning PHP was simple (I
actually did it in one weekend and a few thousand lines), though it again was a
pain. It was a pain because of the tutorials and resources. And that&#39;s the point
I want to discuss here.</p>

<p>All other programming languages I&#39;ve been learning so far were painful to learn.
Not because of their concepts (see Haskell, functional programming at all), but
because of the resources. Haskell is a really good example here. There is
exactly <em>one</em> resource I enjoyed while learning Haskell, and that&#39;s
<a href="http://learnyouahaskell.com/">“Learn you a Haskell for great good”</a>.
And why? Because it <em>takes your hand and shows you the <strong>new</strong> world</em>. It is good
because the concept of functional programming is <em>new</em> for most people reading
this resource. Learning JavaScript, Bash, Lua or Python <em>sucks</em> because you
already know what an object is. You know what a function or method is and you
know that the basic syntax for arithmetic is the very same as in the languages
you&#39;ve been using by now. But all tutorials expect you start from zero – which
is fine if you&#39;re actually starting from zero, but most of the time you&#39;re not.
After learning Java and Ruby I understood what OOP is (actually not after
learning Java, but after learning Ruby, because Java isn&#39;t a fully object
oriented language in my opinion).</p>

<p>So, learning Haskell was kinda amazing. Learn you a Haskell is a really great
book and if you want to learn Haskell, you really should read it. But what was
even a better experience was learning Rust.</p>

<p>So why is that? It is because Rust is a new concept <em>and</em> the old concept
(imperative programming). Learning Rust is not like learning Python after
learning Ruby. It is like Learning Haskell after learning Racket. The concept
behind the language is <em>kinda</em> the same, though it is different in most details.</p>

<p>Plus, the Rust tutorials and resources are freakin&#39; awesome. Let me repeat that.
The tutorials and documentation of the tools, libraries and everything, the
resources on how to do things, are <em>awesome</em>!</p>

<p>Every documentation for each library looks exactly the same, which is a <em>huge</em>
advantage over other languages library documentations. <code>cargo</code>, the Rust
build-tool builds the documentation locally for you, if you want that. So
working offline after you fetched the dependencies or your project (also via
cargo) is no hassle. Building a new project with cargo is absolutely painless,
its literally just executing a command, editing a textfile and executing another
command (setting up the project, writing down dependencies and meta information
about the project and building the project, which fetches the dependencies).</p>

<p>So really, if you want to learn a new programming language, check out Rust. I
haven&#39;t even talked about its language features, and I will not, as this is not
the goal of this article. This article is about resources and tutorials. And my
conclusion is:</p>

<p>All programming language tutorials suck. Except the Rust language tutorial.
tags:  <a href="https://beyermatthias.de/tag:programming" class="hashtag"><span>#</span><span class="p-category">programming</span></a> <a href="https://beyermatthias.de/tag:open" class="hashtag"><span>#</span><span class="p-category">open</span></a> source <a href="https://beyermatthias.de/tag:bash" class="hashtag"><span>#</span><span class="p-category">bash</span></a> <a href="https://beyermatthias.de/tag:c" class="hashtag"><span>#</span><span class="p-category">c</span></a> <a href="https://beyermatthias.de/tag:c" class="hashtag"><span>#</span><span class="p-category">c</span></a>++ <a href="https://beyermatthias.de/tag:haskell" class="hashtag"><span>#</span><span class="p-category">haskell</span></a> <a href="https://beyermatthias.de/tag:nix" class="hashtag"><span>#</span><span class="p-category">nix</span></a> <a href="https://beyermatthias.de/tag:racket" class="hashtag"><span>#</span><span class="p-category">racket</span></a> <a href="https://beyermatthias.de/tag:rust" class="hashtag"><span>#</span><span class="p-category">rust</span></a> <a href="https://beyermatthias.de/tag:shell" class="hashtag"><span>#</span><span class="p-category">shell</span></a></p>
]]></content:encoded>
      <guid>https://beyermatthias.de/the-annoyance-of-programming-language-tutorials-or-why-learning-rust-feels</guid>
      <pubDate>Sun, 31 Jan 2016 16:37:43 +0100</pubDate>
    </item>
    <item>
      <title>My first bit production-racket</title>
      <link>https://beyermatthias.de/my-first-bit-production-racket</link>
      <description>&lt;![CDATA[I just wrote my very first bit of racket code which actually runs somewhere.&#xA;Want to find out what it is?&#xA;&#xA;!-- more --&#xA;&#xA;Well, it is a rather simple piece of code, and it helps me generating this&#xA;very blog. If you visit this blog frequently, you may have noticed that the&#xA;layout changed a bit. Chaning the layout was a thing I wanted to do for months&#xA;and the adaptions I just did are exactly what I wanted to do all the time:&#xA;Move the content in the center of the page, the lines are now shorter as the&#xA;div in which the content lives got reduced in its width.&#xA;&#xA;I also moved the tags and dates on the left of the articles, both on the index&#xA;page and on the article pages. I really like that style. It wasn&#39;t that easy&#xA;(for me as racket-newbie), because the blog engine I use&#xA;(frog) has no method to insert a&#xA;html-list of tags somewhere. So I coded it myself, right in the templates for&#xA;the article and index pages.&#xA;&#xA;Here&#39;s how I did that:&#xA;&#xA;First, I put everything into a subcontainer of the bootstrap layout. The&#xA;date and tags (lets call it metadata) lives in a two-column-container to the&#xA;left of the ten-column-container which holds the content&#xA;I wrote a bit of racket code to generate a html-bullet-list out of the&#xA;comma seperated list of tags frog gives me:&#xA;&#xA;@(string-join&#xA;  (map (lambda (str)&#xA;        (string-append &#34;li&#34; str &#34;/li&#34;))&#xA;       (string-split tags &#34;,&#34;)))&#xA;&#xA;What it does is simple: It splits the string in tags, which holds a&#xA;list of tag-links by the seperator, the comma. Then it maps a lambda over the&#xA;list of strings, which appends the string to &#34;li&#34; and &#34;/li&#34; to that.&#xA;Afterwards, the whole list gets joined together, so we have one big string&#xA;left.&#xA;&#xA;The template itself contains the ul and /ul tags around the list.&#xA;This way, I generate a nice bullet list for both the index pages and the&#xA;article pages.&#xA;&#xA;Unfortunately, the solution is not very DRY, as both templates&#xA;contain the same code. There is no possibility to pass custom code to frog,&#xA;yet. But I opened a feature request on github to include such an option&#xA;(providing a pull request would be much nicer, I know - but as you already&#xA;know, I&#39;m a racket newbie and I&#39;m not sure I can figure out such a thing&#xA;myself).&#xA;&#xA;tags:  #blog #racket #programming&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>I just wrote my very first bit of racket code which actually <em>runs</em> somewhere.
Want to find out what it is?</p>



<p>Well, it is a rather simple piece of code, and it helps me generating this
very blog. If you visit this blog frequently, you may have noticed that the
layout changed a bit. Chaning the layout was a thing I wanted to do for months
and the adaptions I just did are exactly what I wanted to do all the time:
Move the content in the center of the page, the lines are now shorter as the
div in which the content lives got reduced in its width.</p>

<p>I also moved the tags and dates on the left of the articles, both on the index
page and on the article pages. I really like that style. It wasn&#39;t that easy
(for me as racket-newbie), because the blog engine I use
(<a href="https://github.com/greghendershott/frog">frog</a>) has no method to insert a
html-list of tags somewhere. So I coded it myself, right in the templates for
the article and index pages.</p>

<p>Here&#39;s how I did that:</p>
<ol><li>First, I put everything into a subcontainer of the bootstrap layout. The
date and tags (lets call it metadata) lives in a two-column-container to the
left of the ten-column-container which holds the content</li>
<li>I wrote a bit of racket code to generate a html-bullet-list out of the
comma seperated list of tags frog gives me:</li></ol>

<pre><code class="language-racket">@(string-join
  (map (lambda (str)
        (string-append &#34;&lt;li&gt;&#34; str &#34;&lt;/li&gt;&#34;))
       (string-split tags &#34;,&#34;)))
</code></pre>

<p>What it does is simple: It splits the string in <code>tags</code>, which holds a
list of tag-links by the seperator, the comma. Then it maps a lambda over the
list of strings, which appends the string to <code>&#34;&lt;li&gt;&#34;</code> and <code>&#34;&lt;/li&gt;&#34;</code> to that.
Afterwards, the whole list gets joined together, so we have one big string
left.</p>

<p>The template itself contains the <code>&lt;ul&gt;</code> and <code>&lt;/ul&gt;</code> tags around the list.
This way, I generate a nice bullet list for both the index pages and the
article pages.</p>

<p>Unfortunately, the solution is not very DRY, as both templates
contain the same code. There is no possibility to pass custom code to frog,
yet. But I opened a feature request on github to include such an option
(providing a pull request would be much nicer, I know – but as you already
know, I&#39;m a racket newbie and I&#39;m not sure I can figure out such a thing
myself).</p>

<p>tags:  <a href="https://beyermatthias.de/tag:blog" class="hashtag"><span>#</span><span class="p-category">blog</span></a> <a href="https://beyermatthias.de/tag:racket" class="hashtag"><span>#</span><span class="p-category">racket</span></a> <a href="https://beyermatthias.de/tag:programming" class="hashtag"><span>#</span><span class="p-category">programming</span></a></p>
]]></content:encoded>
      <guid>https://beyermatthias.de/my-first-bit-production-racket</guid>
      <pubDate>Sat, 19 Sep 2015 16:37:42 +0200</pubDate>
    </item>
    <item>
      <title>Too much languages to choose from</title>
      <link>https://beyermatthias.de/too-much-languages-to-choose-from</link>
      <description>&lt;![CDATA[I have a problem. I want to write a small application. It should be a&#xA;commandline application, but maybe I want to extend it later with a GUI or&#xA;even a web interface. But I don&#39;t know what language to write it in.&#xA;&#xA;!-- more --&#xA;&#xA;This article could also be named &#34;Which is the right tool for the job?&#34;&#xA;&#xA;The idea is simple: I want to write a journal-application, where one can take&#xA;notes, tag them, query the journal for entries, optionally provide filters&#xA;before printing them to print only some of them and so on.&#xA;&#xA;I want to be able to encrypt them with gpg and I want to write posts to the&#xA;journal with vim. I want to be able to configure these steps, of course, so I&#xA;can use a certain key for encrypting the journal or maybe another editor (for&#xA;these emacs lovers out there).&#xA;&#xA;It should be designed to be extensible, so I can add a GUI or web interface&#xA;later on. Or maybe a tex output, so I can compile a PDF out of it or&#xA;something. Posts should be written in standard markdown, so this wouldn&#39;t be a&#xA;big deal.&#xA;&#xA;But I don&#39;t know what language to write it in. The languages which I can or&#xA;would choose from are:&#xA;&#xA;C&#xA;C++&#xA;Haskell&#xA;Rust&#xA;Java (not really...)&#xA;Scala (not really either, it&#39;s still JVM)&#xA;Ruby&#xA;Python (by extending jrnl)&#xA;Racket&#xA;Lua&#xA;Bash (I really don&#39;t want to write it in bash, but it&#39;s still a possibility)&#xA;&#xA;As you can see, the first four languages are compiled languages, then Java and&#xA;Scala are (lets call it) Semi-Compiled languages and the others are scripting&#xA;languages. All of these languages have certain advantages over others.&#xA;&#xA;The compiled languages&#xA;&#xA;... have the advantages that they are fast. Haskell and Rust also have the&#xA;advantages that if the compiler does not fail compiling the sources, the&#xA;program just works (tm).&#xA;&#xA;Also, learning C++, Haskell or Rust would be a really great experience and may&#xA;be beneficial later in a job or something.&#xA;&#xA;The semi-compiled languages are also (kind of) fast, but they are&#xA;JVM-languages, so I won&#39;t look into them here...&#xA;&#xA;The scripting languages&#xA;&#xA;Writing the application in a scripting language would have some other&#xA;advantages: They would be much more flexible and I&#39;d be faster writing the&#xA;application (compared to Rust or Haskell, which I would need to learn with the&#xA;application). I don&#39;t need to learn Ruby, I know a fair bit of Racket and I&#xA;guess I can get productive with Python or Lua really fast.&#xA;&#xA;Bash is another option and I&#39;m actually an bash script for an almost similar&#xA;job right now. I could simply extend this script, that would be an option, of&#xA;course.&#xA;&#xA;So which is the right tool for the job?&#xA;&#xA;Can you tell me? I don&#39;t know which tool is the right tool for the job. After&#xA;all, I don&#39;t think I should write such an application from scratch. So, for&#xA;me, there are two options left: Extending&#xA;jrnl, which is an Python script, or&#xA;extending diary (I do not even find a link for this anymore), which is a bash&#xA;script. Extending the bash script would be an easy job, I guess. But it&#xA;wouldn&#39;t be as flexible as the Python tool is already.&#xA;tags:  #bash #c #c++ #haskell #programming #racket #rust #shell #tools&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>I have a problem. I want to write a small application. It should be a
commandline application, but maybe I want to extend it later with a GUI or
even a web interface. But I don&#39;t know what language to write it in.</p>



<p>This article could also be named “Which is the right tool for the job?”</p>

<p>The idea is simple: I want to write a journal-application, where one can take
notes, tag them, query the journal for entries, optionally provide filters
before printing them to print only some of them and so on.</p>

<p>I want to be able to encrypt them with gpg and I want to write posts to the
journal with vim. I want to be able to configure these steps, of course, so I
can use a certain key for encrypting the journal or maybe another editor (for
these emacs lovers out there).</p>

<p>It should be designed to be extensible, so I can add a GUI or web interface
later on. Or maybe a tex output, so I can compile a PDF out of it or
something. Posts should be written in standard markdown, so this wouldn&#39;t be a
big deal.</p>

<p>But I don&#39;t know what language to write it in. The languages which I can or
would choose from are:</p>
<ul><li>C</li>
<li>C++</li>
<li>Haskell</li>
<li>Rust</li>
<li>Java (not really...)</li>
<li>Scala (not really either, it&#39;s still JVM)</li>
<li>Ruby</li>
<li>Python (by extending <a href="https://maebert.github.io/jrnl/">jrnl</a>)</li>
<li>Racket</li>
<li>Lua</li>
<li>Bash (I really don&#39;t want to write it in bash, but it&#39;s still a possibility)</li></ul>

<p>As you can see, the first four languages are compiled languages, then Java and
Scala are (lets call it) Semi-Compiled languages and the others are scripting
languages. All of these languages have certain advantages over others.</p>

<h1 id="the-compiled-languages" id="the-compiled-languages">The compiled languages</h1>

<p>... have the advantages that they are <em>fast</em>. Haskell and Rust also have the
advantages that if the compiler does not fail compiling the sources, the
program just works ™.</p>

<p>Also, learning C++, Haskell or Rust would be a really great experience and may
be beneficial later in a job or something.</p>

<p>The semi-compiled languages are also (kind of) fast, but they are
JVM-languages, so I won&#39;t look into them here...</p>

<h1 id="the-scripting-languages" id="the-scripting-languages">The scripting languages</h1>

<p>Writing the application in a scripting language would have some other
advantages: They would be much more flexible and I&#39;d be faster writing the
application (compared to Rust or Haskell, which I would need to learn with the
application). I don&#39;t need to learn Ruby, I know a fair bit of Racket and I
guess I can get productive with Python or Lua really fast.</p>

<p>Bash is another option and I&#39;m actually an bash script for an almost similar
job right now. I could simply extend this script, that would be an option, of
course.</p>

<h1 id="so-which-is-the-right-tool-for-the-job" id="so-which-is-the-right-tool-for-the-job">So which is the right tool for the job?</h1>

<p>Can you tell me? I don&#39;t know which tool is the right tool for the job. After
all, I don&#39;t think I should write such an application from scratch. So, for
me, there are two options left: Extending
<a href="https://maebert.github.io/jrnl">jrnl</a>, which is an Python script, or
extending diary (I do not even find a link for this anymore), which is a bash
script. Extending the bash script would be an easy job, I guess. But it
wouldn&#39;t be as flexible as the Python tool is already.
tags:  <a href="https://beyermatthias.de/tag:bash" class="hashtag"><span>#</span><span class="p-category">bash</span></a> <a href="https://beyermatthias.de/tag:c" class="hashtag"><span>#</span><span class="p-category">c</span></a> <a href="https://beyermatthias.de/tag:c" class="hashtag"><span>#</span><span class="p-category">c</span></a>++ <a href="https://beyermatthias.de/tag:haskell" class="hashtag"><span>#</span><span class="p-category">haskell</span></a> <a href="https://beyermatthias.de/tag:programming" class="hashtag"><span>#</span><span class="p-category">programming</span></a> <a href="https://beyermatthias.de/tag:racket" class="hashtag"><span>#</span><span class="p-category">racket</span></a> <a href="https://beyermatthias.de/tag:rust" class="hashtag"><span>#</span><span class="p-category">rust</span></a> <a href="https://beyermatthias.de/tag:shell" class="hashtag"><span>#</span><span class="p-category">shell</span></a> <a href="https://beyermatthias.de/tag:tools" class="hashtag"><span>#</span><span class="p-category">tools</span></a></p>
]]></content:encoded>
      <guid>https://beyermatthias.de/too-much-languages-to-choose-from</guid>
      <pubDate>Mon, 26 Jan 2015 16:37:29 +0100</pubDate>
    </item>
    <item>
      <title>My frustration on programming languages - reset and redo</title>
      <link>https://beyermatthias.de/my-frustration-on-programming-languages-reset-and-redo</link>
      <description>&lt;![CDATA[So I had a post about my frustrations on programming languages some time ago&#xA;(the actual date of the previous article on the topic is not right, because I&#xA;did some blog switching foo since). With this article I try to rethink the whole&#xA;problem. My conclusion will be different from the conclusion of the previous&#xA;article!&#xA;&#xA;!-- more --&#xA;&#xA;Haskell, Racket and the others&#xA;&#xA;So, I said in the last article that I want to have a look into the following&#xA;programming languages:&#xA;&#xA;Haskell&#xA;Go&#xA;D&#xA;Crystal&#xA;&#xA;And well, I learned a bit of Haskell and it is an awesome language from what I&#xA;can see so far. But then things changed, I started a semester project I&#39;m now&#xA;heavily involved in, which is in C. I also had several programming courses at&#xA;my university where the requirement was C++ and Java, so things got stuck&#xA;somewhere. I stopped learning Haskell. Sadly.&#xA;&#xA;But in the past few days and weeks, I got my head into a new programming&#xA;languages, as the careful reader of this blog already knows: Racket. Racket is&#xA;a Lisp dialect. I comes with an wonderful documentation, a rich feature set (a&#xA;nice REPL, a documentation tool, package manager which works really well and&#xA;tries to avoid the dependency hell), is fast and easy to both read and write&#xA;(at least from what I can tell by now). Racket is kind of my new love in&#xA;manner of programming languages. I started learning it by implementing&#xA;problenms from project euler and I want to write a&#xA;small IRC bot in it, as soon as I consider myself as advanced enough to&#xA;achieve this.&#xA;&#xA;So, Racket is a functional programming language, but also supports&#xA;non-functional programming paradigms. This basically means that you also can&#xA;write OOP-stylish and imperaitvely in Racket. You might say &#34;Yuck!&#34; now,&#xA;because it is not a pure functional language - but it is really good for me,&#xA;and I can get my feet wet with functional programming slowly! This matters&#xA;most for me!&#xA;&#xA;The other languages listed are less important for me. I don&#39;t want to learn&#xA;Go, D or even Crystal anymore. I think, functional programming languages are&#xA;my next (kind of) goal in life. A lot of people state that they became better&#xA;programmers after learning a functional language (Haskell in particular). And&#xA;because my overall goal is to become better at what I love doing, I consider&#xA;functional programming as one of my main goals in life now. That may sound&#xA;really vain or limited, but well, I also have other goals in life! They just&#xA;don&#39;t fit into this article, of course!&#xA;&#xA;So,... Haskell?&#xA;&#xA;My goal is still learning Haskell some time, and I will, as soon as I consider&#xA;myself a good Racket hacker! But for now, Racket has a better learning courve&#xA;for me. I read a lot about the functional programming languages out there,&#xA;mainly Lisp/Scheme like languages and Haskell. And a lot of people state that&#xA;Haskell is a bit more advanced because of its syntax, because you have to&#xA;consider operator prescendence and some other things, which you don&#39;t have to&#xA;care about in Lisps. So, I can start with a simple language, learning the&#xA;functional approach, and continue with something like Haskell afterwards.&#xA;&#xA;I saw a wonderful&#xA;explanation on youtube on Monads&#xA;just yesterday. I understand everything in this video, except the fourth&#xA;part, which actually covers Monads. This is also one of the points why I&#xA;don&#39;t start away with Haskell. I want to fully understand the concepts&#xA;first.&#xA;&#xA;It would be really great to have a course about functional programming at my&#xA;university, but unfortunately there is none. One Prof has a by-choice-event&#xA;students can subscribe to, but unfortunately not this or next semester. I hope&#xA;I will be able to attend the course in one year.&#xA;&#xA;If not, I hope I can do something with functional programming in my bachelors&#xA;thesis or in my masters degree, if I continue studying. Would be neat. If not,&#xA;there are maybe some non-university courses around.&#xA;&#xA;But is Racket fulfilling?&#xA;&#xA;Of course it is! You can actually do everything you can do in pure functional&#xA;programming languages! I just found out how to do function composition and&#xA;partial application of functions. It is not as simple as in Haskell, but it&#xA;works exactly the same way (don&#39;t consider my statements here too serious, I&#39;m&#xA;just learning and it feels like it is the same...).&#xA;&#xA;For example, we have this smart piece of Haskell code here:&#xA;&#xA;take5 = take 5&#xA;&#xA;take5 is now a function which is composed of passing 5 to the take&#xA;function. It takes now 5 values from a list and returns them as new list.&#xA;Wonderful and simple!&#xA;&#xA;But you can also do this in Racket. I don&#39;t know how to do this problem in&#xA;Racket, as the take function in Racket expects the list as first argument&#xA;and the number as second. So would need to switch arguments, and I actually&#xA;don&#39;t know how to do this in Racket.&#xA;&#xA;So lets do another example of partial application:&#xA;&#xA;(define (add1-to-list)&#xA;  (curry map add1 ))&#xA;(add1-to-list (list 1 2 3))&#xA;; -  &#39;(2 3 4)&#xA;&#xA;As you can see, I created a function which returns a function that maps the&#xA;add1 function on a list. Afterwards I applied this function to a list. So it&#xA;is the same as in Haskell, but with a bit more verbosity, of course.&#xA;&#xA;Side-note: I just found out (thanks to the Racket IRC channel) how to do&#xA;flipping of arguments:&#xA;&#xA;(define-syntax (flip stx)&#xA;  (syntax-case stx ()&#xA;                   [(_ f x ...) #`(f&#xA;                                   #,@(reverse (syntax-  list #&#39;(x ...))))]))&#xA;&#xA;That&#39;s the syntax rule, but it is very verbose. Using it is rather short:&#xA;&#xA;(flip / 12 4)&#xA;; -  1/3&#xA;&#xA;But not as nice as you can do it in Haskell. But anyways, that&#39;s hairsplitting&#xA;and I will end this here and now.&#xA;&#xA;Conclusion&#xA;&#xA;Racket is awesome.&#xA;Haskell is Awesome.&#xA;Functional programming is awesome.&#xA;Yeah!&#xA;&#xA;---&#xA;&#xA;So, to finallize this article now: I&#39;m learning functional programming! It is&#xA;awesome, concise and clean. It seems to be the best approch to abstract&#xA;complex problems and address the problem of complexity and abstraction (wanna&#xA;know more about this, watch the linked youtube video)! I&#39;d love suggestions&#xA;on tutorials, papers and other reading material to get better. Feel free to&#xA;send me everything you might consider as a good starting point to get my&#xA;feet even more wet.&#xA;&#xA;tags:  #programming #haskell #racket&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>So I had a post about my frustrations on programming languages some time ago
(the actual date of the previous article on the topic is not right, because I
did some blog switching foo since). With this article I try to rethink the whole
problem. My conclusion will be different from the conclusion of the previous
article!</p>



<h1 id="haskell-racket-and-the-others" id="haskell-racket-and-the-others">Haskell, Racket and the others</h1>

<p>So, I said in the last article that I want to have a look into the following
programming languages:</p>
<ul><li>Haskell</li>
<li>Go</li>
<li>D</li>
<li>Crystal</li></ul>

<p>And well, I learned a bit of Haskell and it is an awesome language from what I
can see so far. But then things changed, I started a semester project I&#39;m now
heavily involved in, which is in C. I also had several programming courses at
my university where the requirement was C++ and Java, so things got stuck
somewhere. I stopped learning Haskell. Sadly.</p>

<p>But in the past few days and weeks, I got my head into a new programming
languages, as the careful reader of this blog already knows: Racket. Racket is
a Lisp dialect. I comes with an wonderful documentation, a rich feature set (a
nice REPL, a documentation tool, package manager which works really well and
tries to avoid the dependency hell), is fast and easy to both read and write
(at least from what I can tell by now). Racket is kind of my new love in
manner of programming languages. I started learning it by implementing
problenms from <a href="http://projecteuler.net">project euler</a> and I want to write a
small IRC bot in it, as soon as I consider myself as advanced enough to
achieve this.</p>

<p>So, Racket is a functional programming language, but also supports
non-functional programming paradigms. This basically means that you also can
write OOP-stylish and imperaitvely in Racket. You might say “Yuck!” now,
because it is not a pure functional language – but it is really good for me,
and I can get my feet wet with functional programming <em>slowly</em>! This matters
most for me!</p>

<p>The other languages listed are less important for me. I don&#39;t want to learn
Go, D or even Crystal anymore. I think, functional programming languages are
my next (kind of) goal in life. A lot of people state that they became better
programmers after learning a functional language (Haskell in particular). And
because my overall goal is to become better at what I love doing, I consider
functional programming as one of my main goals in life now. That may sound
really vain or limited, but well, I also have other goals in life! They just
don&#39;t fit into this article, of course!</p>

<h1 id="so-haskell" id="so-haskell">So,... Haskell?</h1>

<p>My goal is still learning Haskell some time, and I will, as soon as I consider
myself a good Racket hacker! But for now, Racket has a better learning courve
for me. I read a lot about the functional programming languages out there,
mainly Lisp/Scheme like languages and Haskell. And a lot of people state that
Haskell is a bit more advanced because of its syntax, because you have to
consider operator prescendence and some other things, which you don&#39;t have to
care about in Lisps. So, I can start with a simple language, learning the
functional approach, and continue with something like Haskell afterwards.</p>

<p>I saw a wonderful
<a href="http://www.youtube.com/watch?v=ZhuHCtR3xq8">explanation on youtube on Monads</a>
just yesterday. I understand <em>everything</em> in this video, except the fourth
part, which actually covers Monads. This is also one of the points why I
don&#39;t start away with Haskell. I want to fully understand the concepts
<em>first</em>.</p>

<p>It would be really great to have a course about functional programming at my
university, but unfortunately there is none. One Prof has a by-choice-event
students can subscribe to, but unfortunately not this or next semester. I hope
I will be able to attend the course in one year.</p>

<p>If not, I hope I can do something with functional programming in my bachelors
thesis or in my masters degree, if I continue studying. Would be neat. If not,
there are maybe some non-university courses around.</p>

<h1 id="but-is-racket-fulfilling" id="but-is-racket-fulfilling">But is Racket fulfilling?</h1>

<p>Of course it is! You can actually do everything you can do in pure functional
programming languages! I just found out how to do function composition and
partial application of functions. It is not as simple as in Haskell, but it
works exactly the same way (don&#39;t consider my statements here too serious, I&#39;m
just learning and it feels like it is the same...).</p>

<p>For example, we have this smart piece of Haskell code here:</p>

<pre><code class="language-haskell">take5 = take 5
</code></pre>

<p><code>take5</code> is now a function which is composed of passing <code>5</code> to the <code>take</code>
function. It takes now 5 values from a list and returns them as new list.
Wonderful and simple!</p>

<p>But you can also do this in Racket. I don&#39;t know how to do <em>this</em> problem in
Racket, as the <code>take</code> function in Racket expects the list as first argument
and the number as second. So would need to switch arguments, and I actually
don&#39;t know how to do this in Racket.</p>

<p>So lets do another example of partial application:</p>

<pre><code class="language-racket">(define (add1-to-list)
  (curry map add1 ))
(add1-to-list (list 1 2 3))
; -&gt; &#39;(2 3 4)
</code></pre>

<p>As you can see, I created a function which returns a function that maps the
<code>add1</code> function on a list. Afterwards I applied this function to a list. So it
is the same as in Haskell, but with a bit more verbosity, of course.</p>

<p>Side-note: I just found out (thanks to the Racket IRC channel) how to do
flipping of arguments:</p>

<pre><code class="language-racket">(define-syntax (flip stx)
  (syntax-case stx ()
                   [(_ f x ...) #`(f
                                   #,@(reverse (syntax-&gt;list #&#39;(x ...))))]))
</code></pre>

<p>That&#39;s the syntax rule, but it is very verbose. Using it is rather short:</p>

<pre><code class="language-racket">(flip / 12 4)
; -&gt; 1/3
</code></pre>

<p>But not as nice as you can do it in Haskell. But anyways, that&#39;s hairsplitting
and I will end this here and now.</p>

<h1 id="conclusion" id="conclusion">Conclusion</h1>
<ul><li>Racket is awesome.</li>
<li>Haskell is Awesome.</li>
<li>Functional programming is awesome.</li>
<li>Yeah!</li></ul>

<hr>

<p>So, to finallize this article now: I&#39;m learning functional programming! It is
awesome, concise and clean. It seems to be the best approch to abstract
complex problems and address the problem of complexity and abstraction (wanna
know more about this, watch the linked youtube video)! I&#39;d love suggestions
on tutorials, papers and other reading material to get better. Feel free to
send me everything you might consider as a good starting point to get my
feet even more wet.</p>

<p>tags:  <a href="https://beyermatthias.de/tag:programming" class="hashtag"><span>#</span><span class="p-category">programming</span></a> <a href="https://beyermatthias.de/tag:haskell" class="hashtag"><span>#</span><span class="p-category">haskell</span></a> <a href="https://beyermatthias.de/tag:racket" class="hashtag"><span>#</span><span class="p-category">racket</span></a></p>
]]></content:encoded>
      <guid>https://beyermatthias.de/my-frustration-on-programming-languages-reset-and-redo</guid>
      <pubDate>Sat, 22 Nov 2014 17:37:28 +0100</pubDate>
    </item>
  </channel>
</rss>