Community vs Ecosystem

One of the most powerful and important things about Open Source software is that it brings people together to work on a common goal. This is especially true if the project is setup as a Bazaar instead of a Cathedral.

Usually the groups of people need a framework to communicate to work together in. Initially these were called “communities”, but this isn’t working out so well in some cases, so in this blog post I’ll talk about why an “ecosystem” is better.

Continue reading Community vs Ecosystem

Fun With Apple Multi-Arch Binaries

Apple macOS has for many years supported the ability to have binaries for multiple platforms in one executable. Upon execution the correct binary data is loaded into RAM. This has multiple names such as “Universal”, “fat binary” or “Multi-Architecture Binaries”. These were really useful when Apple was transition from PowerPC to Intel CPUs, a single binary would execute on both platforms. It could be useful in the future if, as many predict, Apple move from Intel to ARM CPUs.

In this post I’ll talk about the m4 script I wrote at HP to use this feature for combined 32bit and 64bit Intel binaries (back when that was relevant).

Continue reading Fun With Apple Multi-Arch Binaries

Event Loops and NCurses

Yesterday I wrote a blog post talking about Event Loops, this was a pre-cursor to discussing where I am using them in an application I’m currently developing which uses NCurses at its core.

Unfortunately the application is an R&D project and is not public yet (still very early in development), but it is written in C, has a TUI front end and handles many windows and network connections simultaneously so I am using libuv heavily underneath. For this post I’ll be discussing the integration between libuv and NCurses.

Continue reading Event Loops and NCurses

Event Loop Programming: A Different Way of Thinking

The concept of event loops is not new in programming, but I think it is still a really important technique to learn. They allow a program to send a request for something and carry on doing things rather than waiting on things to happen. It is a great way of multi-tasking in a single thread but there are some gotchas to be aware of.

In this blog post I’ll give a short intro to event loops and how to get the most out of them.

Continue reading Event Loop Programming: A Different Way of Thinking

Sanitizers, The Alternative To Valgrind

Valgrind is an incredibly powerful tool which helps find leaks, buffer overflows and many other things. Whilst being extremely powerful it can also be very slow. As an alternative there are little known tools that are available for Clang and GCC which can fulfil similar functions for your C / C++ applications but with much higher performance.

I’ve had several people ask me about the sanitizers recently and how to use them, so I’ll cover some basics here.

Continue reading Sanitizers, The Alternative To Valgrind

My Journey Learning The Go Programming Language

The key to learning anything new is finding a way to engage with the material. Some people learn by reading and some learn by doing. I typically fall into the latter half and I’ve typically been more successful in mentoring people who learn in a more hands-on way.

A recent Tweet I made led to a chat which somehow led to a famous Open Source developer getting me kickstarted into the world of developing in the Go Programming Language. This post tracks some of my journey for the last week (my first week of learning Go).

Continue reading My Journey Learning The Go Programming Language

POSIX File Handling and Undefined Behaviour

Whilst porting code between Linux and macOS I have come across two issues which make assumptions about how something works but in reality different implementations of libc handle them differently. In this post I’ll talk about recent issues I faced with fopen() and fclose() in codebases.

Continue reading POSIX File Handling and Undefined Behaviour

Nested Variadic Functions in C

You may be familiar with variadic functions in C, these are basically functions that allow a variable number of parameters, they are normally written like this:

void my_print_func(const char *format, ...)
{
    va_list args;
    va_start(args, format);
    vprintf(format, args);
    va_end(args);
}

Obviously you can do more with them and they are very useful, but if you want to have one function calling another things can get complicated. This post explores the problem and a couple of ways of solving it.

Continue reading Nested Variadic Functions in C

Unicode 7 in CentOS 7 TUI Code

I’m in the middle of developing a project in C which uses NCurses and Unicode 7+ characters. This has been working out great in macOS and Fedora 31 where I have been doing most of my testing. But in CentOS I have been having big problems getting the characters to render. This post goes into why and how to fix it.

Continue reading Unicode 7 in CentOS 7 TUI Code

Fixing an OpenSSL issue with Curl and Autotools

One project I created at MariaDB is libMariaS3 [source, documentation]. It is a lightweight simple LGPL licensed API to access Amazon S3 and compatible object storage implementations. We created it so that GPL v2.0 licensed projects could use S3 without the license incompatibility of Amazon’s Apache 2.0 licensed SDK.

MariaDB itself uses this for the new S3 storage engine coming in 10.5 and several other upcoming projects. I designed it to be easy to use for anyone outside of MariaDB just in case some other project would find it useful.

Continue reading Fixing an OpenSSL issue with Curl and Autotools