RSSAmplifier

Blog

AlternativeBit

Recent posts

alternativebit.frRSS feed ↗23 posts

Latest posts

Nar-klepto: Guix and Nix Offline Cache

TL;DR: introducing nar-klepto , the context that led to its inception, and some fun experiments we did last week with it. 4 years ago, I moved out of Bayonne to a rural area. My quality of life almost instantly skyrocketed; however, I quickly felt a bit frustrated that I could only discuss computer-related things via online video meetings. After the 2024 FOSDEM, I realized that if there’s no…

Nsncd, Anniversary Updates

Last year, flokli and I worked towards re-using TwoSigma’s Nsncd as the main NixOS Nscd daemon. What is that even about? Well, Nscd is a Glibc daemon that was originally meant to cache the host/user resolution requests. It’s mostly obsolete by now, but on NixOS and Guix, we abuse this daemon to get a stable ABI to load the host NSS modules from a potentially different glibc version. If…

The Nix, OpenGL and Ubuntu Integration Nightmare

In this article, we’re about to dive into the uncharted OpenGL on Linux waters. After briefly explaining how the OpenGL calls are routed from your application to the GPU, we’ll look at the NixOS special case. We’ll then explore how we can run the OpenGL programs built by Nix on a foreign distribution, such as Ubuntu or Fedora. Finally, we’ll introduce NixGLHost a new approach to solve…

Nix Substitution: the Way Forward

Abstract Nix and Guix have the unfortunate reputation to require a lot of bandwidth to distribute software. This reputation is sadly grounded. It seems like explicitly pointing to your dependencies comes with an overhead cost in terms of download size. Or does it? Currently, both Guix and Nix can substitute pre-built store paths from a binary cache using the Nix Archive (NAR) format. After…

Ex-Hack: a Haskell Example-based Documentation

Abstract Ex-Hack is an example-based documentation automatically generated using the packages posted on Stackage. There’s a live demo here . We’ve just released the alpha version; you can have a look to the code here . We are actively looking for new contributors . After briefly introducing the project’s incentives and explaining how this software works, we discuss the current…

Ultimate Writer: an Open Digital Typewriter

TL;DR: A digital typewriter based on a Raspberry Pi and an E-Ink screen. The code/build instructions are available on GitHub . I am easily distracted. This is both a blessing and a curse. On one hand, I can deal with a large amount of boredom without driving crazy: remaining artifact from my school years and necessary skill to survive in our meeting-based modern corporate environment. On the other…

Loading a Cabal module in the GHC API

If you plan to build some Haskell tooling or any kind of static code analyzer, chances are you’ll need to use the GHC API at some point. While loading a simple module into GHC’s API is quite trivial and well documented, loading complex modules (modules having some c dependencies, some specific options in the .cabal file, etc.) will require you to find the appropriate dynamic flags .…

Silver Searcher: Useful Regexes for a Haskell Code-Base

TL;DR I use 4 Perl Regex patterns most of the time when it comes to search some Haskell code: Functions: '\b<args>\b[ \t\n]+::' Types: '(data|newtype|type)(\ +)\b<args>\b' TypeClasses: 'class(\ +)(.*)(=>)*(\ *)\b<args>\b' Constructors: '\|[\t\ ]+\b<args>\b' I am looking for a better way to search for a type constructor, email me at picnoir at this domain if you have any better idea. Ag Exploring…

Please, Keep your Blog Light

TL;DR: keeping your blog lightweight is important, I show you how to design a blog fitting in less than 10kB. You&rsquo;re already convinced weight really matters when it comes to web pages? You can skip the introduction and directly see how you can reduce your blog&rsquo;s weight through a practical example . Why Does Size Matters? I grew up in a French isolated village during the early…

Bracket: a Tale of Partially Applied Functions

TL;DR In this post, we describe how we can use partially applied functions as a design building block though the study of a practical example: the bracket function. I&rsquo;ll use the Haskell programming language to illustrate this post. Just keep in mind this could be applied to almost any language. It all Begins with Code Reuse HSpec is a BDD-style unit-test framework for Haskell. In that kind…

Writing a Twitch Overlay using Haskell

I have been watching Jessica&rsquo;s Mak streams lately. She is an indie game developper, but most of all, she has a kick ass overlay that shows what she is typing in real time. I wanted the same one, I made it using Haskell, Gloss and Chipmunk via the Hipmunk binding. Long story short, it ended up looking like this. The source code is available in this git repository . Gloss, display library…

Wireguard-Haskell: Getting Started

Why Starting this Project? After finishing DobadoBots, I was looking for a Haskell project in which I could be confronted with some performance and parallelism problems. Wireguard seemed to be the perfect project for that. At the time, no userspace implementation was available, the specification seemed to be simple enough for being implemented by a single person in a couple of months. Furthermore,…

DobadoBots: Project Wrap Up

Yet another post about DobadoBots: my programming video-game. Right, let&rsquo;s face it: it is done for two months now, this blog post is long overdue! The video-game is now completely playable, I reached the MVP stage. Here&rsquo;s a short video presenting the final result. Let&rsquo;s debrief this project. Getting Familiar with Haskell The main goal was to get some practical experience with…

DobadoBots: Writing a Text Editor

Yup, yet another post on my programming videogame: Dobadobots. Today, we are going to dig into the editor&rsquo;s implementation. Motivations I wanted the game to be as enjoyable as possible, I wanted a quick write/feedback loop. Using an external editor would have killed this fast feedback loop, it was just not an option. I first thought about integrating a pre-existing editor in it. An option…

DobadoBots: Implementing the Parser

Lately, I have been working on a video-game called DobadoBots . This game is about programming a robot&rsquo;s artificial intelligence to solve mazes. The robot is materialized by a white triangle. The goal is to reach the objective (orange square) while avoiding several obstacles. Instead of using a standard embeddable script language such as LUA, I went the custom way and wrote my own language.…

DobadoBots: Specifying the Language

Lately, I have been working on a video-game called DobadoBots . This game is about programming a robot&rsquo;s articial intelligence to solve mazes. The robot is materialized by a white triangle. The goal is to reach the objective (orange square) while avoiding several obstacles. Instead of using a standard embeddable script language such as LUA, I went the custom way and wrote my own language.…

One Year of FOSS

One Year of FOSS Hello internet friends, long time no see. After doing a total revamp of this weblog, I think it is finally time to explain what&rsquo;s happening in my life. Two months ago, I decided to quit my job. I was tired of Paris&rsquo;s pollution. I was tired of Paris&rsquo;s shitty public transportation. I was not really happy doing my job. I had one year of runway. Long story short, I…

Real World Haskell Chapter 9 Solutions

Exercise P.221 Is the order in which we call bracket and handle important? Yup, it is pretty important: the code executed during the in-between statement of bracket still can raise an exception. We do not want our application to crash in case of an error while opening the file, therefore, we still need the handle statement. We could put the handle statement inside of the bracket statement, but…

Real World Haskell Chapter 8 Solutions

Hello, it&rsquo;s been a long time. Despite having done some progress on the resolution of the exercises of this book, I haven&rsquo;t blogged about my solutions, which is a shame. The solutions are available in this git repository though. Let&rsquo;s start again for the end of chapter 8. Exercises P.205 Here, we need to implement a case insensitive version of the glob checker. Despite having…

Real World Haskell Chapter 4 Solutions

Okay, in this chapter, we will apparently learn more about common techniques in FP, can&rsquo;t wait! Exercises page 84 Let&rsquo;s rewrite safe versions of partial list functions The first two functions are very straightforward: a bit of pattern matching, some identification of edge cases and we&rsquo;re done. safeHead :: [ a ] -> Maybe a safeHead [] = Nothing safeHead ( x : xs ) = Just x…

Open recipe database: how to gather, cure and store data

I recently started to think about creating an open recipe database. The major consideration coming with this project is how to gather, cure and store recipes. Gathering data Let&rsquo;s start with something obvious: we cannot rely on users to create recipes from scratch. This is a very time consuming task, so the first approach would be to find a way to fully automate that. As I mentioned in the…

Some thoughts about building an open recipe database

Lately, I have been thinking about creating an open recipe database. It is just not possible to find any good quality recipes database. Often, the website indexing recipes does not expose its data using any kind of API. When it does - and very few does - the recipes are stored in a data format close to unrestricted plain text. Advanced queries Most recipes websites are offering very primitives…

How to configure TLS Let&#39;s Encrypt Certificates with Nginx

Let&rsquo;s encrypt beta is public since yesterday. I already use their certificates for several domains. The main problem I actually face is certificates renewal. I want to be able to renew automatically my certificates without turning off Nginx. Let&rsquo;s encrypt official client can be used in a automatic way. Unfortunately, this feature is poorly documented… In order to automate this process,…