Home

Welcome to my blog!

Here I’m going to write about programming, science, maths and especially computer science.

Below you find the 10 recent of my blog posts. If you want to read older posts, please take a look at the archive.

Exceptions are exceptionally painful

Posted on 22. July 2015 by uwap
Tags: Concepts Exceptions Haskell

In todays post I want to show you my experience about exception handling. As in previous posts I want to focus on Haskell though this might apply for other languages too. With this post I want to open a discussion on exceptions so I want to hear your opinion about it.

Errors v.s. Exceptions

First of all I want to talk about the differences between errors and exceptions to make my point clear. The distinction between those is not always clear but for simplicity I want to give an explicit definition focused on an entry in the Haskell-Wiki [1].

If we think about the word exception it has a similar meaning to “a special case”. This is exactly the definition I want to use here. There is some exceptional case of input that our program has to handle.

An error may be something totally unexpected as defect hardware or simply logic errors in the code, basically everything that isn’t an exception.

This blog post is about the exceptions, not the errors.

Read more…

LED Animations I: Functions for composability - Co-Algebraic modelling

Posted on 22. June 2015 by uwap
Tags: Composability Concepts F-Algebras Haskell

As I moved into my current flat there was one thing I wanted to do:
I wanted my lights to be LEDs that can change their colors and intensity all individual so I can program Animations for it.

Today I want to present a dynamic way of creating and composing animations. As a lot of projects I’ve seen have webinterfaces where you can select a hard-coded animation/mode I wanted to have a webinterface that goes beyond that. A webinterface in which you could create your own animations!

Imagine an animation called ‘sinBrightness’ that takes a color and renders the color over all pixels given a certain brightness. This brightness modifies over time by a sine.

Now instead imagine sinBrightness only modifying the brightness of every pixel. You end up with much higher composability.

Read more…

LED Animations II: Monads

Posted on 1. July 2015 by uwap
Tags: Concepts Haskell Monads

Last week I did a blog post about LED Animations and how functions get us composability. Though last time we had some open problems that our concept couldn’t solve.

  • We can’t create random frames since the type of AnimationStep is Frame -> Frame
  • We can’t create animations like a sinus brightness fade because once everything is black we don’t have the information about the previous color.

As a conclusion to the last post we need to make animations monadic. For simplicity we will use IO as our only monad.

First let’s change some defintions. To not further confuse Animation and AnimationStep, we will say that Animation is a function, so basically what AnimationStep was in the last post. We don’t need to store animations as lists anymore. Why? I will explain it later.

Since we want to make animations monadic, let’s go!

1
type Animation = Frame -> IO Frame

Sadly this means we can’t compose our animations by (.) anymore. Though, there is a compose function that will even work on this type.

Read more…

Hello (World) = Introduce $ this blog

Posted on 8. April 2015 by uwap
Tags:

Welcome to my new blog.

Firstly, let me introduce myself and talk about my intentions and ideas of this blog and what to expect.

I’m uwap. I’m 18 years old and a computer science student from Germany. I’ve been programming for almost 6 years now. One thing that bothered me about programming all the time was that either a language, its specifications, its libraries or its documentations were bad. One of my intentions in writing this blog is to introduce interesting languages that are uncommonly used for one. My other intentions are sharing some of my thoughts about ideas and concepts and to introduce interesting libraries, tools and frameworks beside unusual programming languages.

Read more…

Looking for Older Posts?
Check out the Archive Page
Site proudly generated by Hakyll