Ramblings RSS Feed

Type-safe printf in Idris

Dec 20, 2017

Recently I have been learning Idris: a functional language similar to Haskell with dependent types added to the mix. Writing a type-safe printf formatter function turns out to be a great exercise of how a language with dependent types can be utilized. I will show how writing our own printf implementation can be type-safe at compile and runtime.

Read more…

My Learning Experience

Jul 1, 2017

Unlike my other ramblings, this one will be more personal and less technical. I will describe my adventure learning as a kid up until now. In advance, I do not want to claim what is told here is applicable to others. I also realize that I am better off than many others and want to avoid making particular conclusions. I just want to share a portion of my life.

Read more…

Avoid Passing the Delegator

Jul 21, 2016

When developing APIs, we strive to eliminate interdependencies between software components. Sometimes doing so completely is unachievable so one pattern we use is the delegation pattern to limit how much components can know about each other. This pattern consists of the delegator which is typically a reusable library component, and a delegate which is typically a custom controller1.

  1. Cocoa Core Competencies - Delegation and the Cocoa Frameworks

Read more…

Detecting the Debugger on OS X

Jan 30, 2016

How can your program detect if it’s being attached to a debugger? One approach is detecting if a mach exception handler is configured. Another more well known approach is detecting the usage of ptrace. I will discuss the merits and disadvantages of both of these.

Read more…