Guillaume Chereau, Software Engineer

Welcome to my blog, where I talk mostly about programming.

The Circles of Hell of C Libraries Integration

There is spectrum on how easy it is to integrate a C (or C++ for that matter) library into a project. The issue is that the C ecosystem does not have a standard dependency manager, so each project big enough to require the use of external libraries needs to find a way to integrate them, and it is usually a significant source of problem just to get them to compile. Note that I am not even talking about how to use them....

2023 August 21

My Solution to the Newcomb Paradox

The Newcomb paradox is stated as a fictional situation where a player enters a room with two opaque boxes, A and B. A always contains a small amount of money (let say $100), and B contains either nothing, either a larger amount of money (let say $110) 1. The player gets to pick one or both boxes and leave the room with them. The catch is that before the player enters the room, an ‘all knowing’ entity prepared the boxes and filled the box B with money only if it predicted that the player will not pick the A box....

2023 July 28

Why I don't like C23 "auto" keyword

The next version of the C standard (C23) brings two new features that I am not enthusiastic about. One of them is the nullptr constant, the other one is the “new” auto keyword1. I will try to explain why I don’t like it. The new proposed auto keyword will work basically like in C++. You will for example be able to write: auto x = 10; auto ret = function(); Instead of:...

2023 June 17

Python Simulation of the Blue Eyes Island Puzzle

The blue eyes island is a tricky logic puzzle that has several variations. The one I was first told was: A group of people live in an island with no contact with the outside world. Eyes color is big taboo for them and they strictly follow this rule: if anybody figures out the color of their own eyes, they will commit suicide the following night. Everybody knows the eyes color of all the other islanders, but nobody knows their own eyes color....

2023 May 21

An Intuitive Explanation of Quantum Field Theory

This post will be my attempt to explain intuitively what is Quantum Field Theory. This idea came to me after reading two books: “QED: The Strange Theory of Light and Matter” by Richard Feynman, and “Quantum Field Theory in a Nutshell”, by A. Zee (that I only started). Both books use path integrals, but in a very different way: Feynman tells us that the particles can move anywhere they want in space and time, while Zee uses conventional ‘forward in time only’ paths but of a ‘mattress’ and not just one particle....

2023 April 16

C++ is not cross platform anymore

As of 2019, C and C++ are the only programming languages that are supported by virtually any platforms on the market. For example both iOS and android support compiling C and C++ directly as part of their official IDEs. This is one of the reason why I decided to write my voxel editor Goxel in C99: I wanted to be able to run it on Linux, Mac, Windows, iOS, and now I am working on a Android port as well....

2019 July 4

Lua vs Duktape for embedded scripting language

I recently started to see how to integrate a generic script language into my voxel editor Goxel. I want to use something light and easily embeddable into a C application. One obvious choice for this is to use Lua, but I also wanted to try Duktape, a lightweight JavaScript interpreter. In this post I’ll give some of my conclusions after trying both. 1. SIMPLICITY TO EMBED Both Lua and Duktape are relatively easy to embed into a C application....

2018 December 22

Creating application icons with inkscape

Yesterday I tried to improve the style of my voxel editor goxel. One thing I wanted to do in particual is have better looking icons in the UI. The current icons looked like that on my non retina screen: This is what I came up with: It’s interesting to work on art for computer screen because for such small size images, the pixels aliasing quality becomes primordial. For example in goxel on a non retina screen, the icons should all have a size of 22x22 pixels....

2018 April 18

Porting Goxel to iOS

I just made the first release of my voxel editor project goxel for iOS, and I wanted to write a bit about the process. It’s not the first time I work on a mobile port of C/C++ application, so the process was quite easy. The only new challenge this time is that I used swift on the platform code (instead of objective-C). The global structure of the code consists of a core written in C (or C++), and a small platform dependant layer on top of it to create the application context and handle the inputs....

2017 July 31

Generating the dodecahedron rotation group with python

I was wondering how to compute the rotations for all the faces of the regular dodecahedron (polyhedron with 12 faces). You can find many resources online about the symmetry group of the dodecahedron, but not much practical information about how you would use it in you code, this is specially annoying for non mathematicians like me who don’t want to go too far down the rabbit hole of group theory just to get my 12 rotations....

2017 June 19