all repos — h3rald @ 61c4b55eb10855e08959e4598b2df5876f1ea44e

The sources of https://h3rald.com

Fixes.
h3rald h3rald@h3rald.com
Thu, 19 Dec 2024 14:12:08 +0100
commit

61c4b55eb10855e08959e4598b2df5876f1ea44e

parent

00c40975bf417dddd934e663ab879cd5fca3f6f2

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M contents/articles/december-adventure-2024.mdcontents/articles/december-adventure-2024.md

@@ -374,7 +374,7 @@

### Day #16 -I decided that I don't want to mamage a single .c file anymore, so it is finally time to split it. But! I still really like the idea that someone may find itt easier to embed if it's a single file (I know I do for things like SQLite!), so I created my own simple amalgamation script in Bash to concatenate all the files and preserve the original filenames and line numbers. For simplicity's sake I am using a single header file though (no need for more modular builds right now). Here goes: +I decided that I don't want to manage a single .c file anymore, so it is finally time to split it. But! I still really like the idea that someone may find itt easier to embed if it's a single file (I know I do for things like SQLite!), so I created my own simple amalgamation script in Bash to concatenate all the files and preserve the original filenames and line numbers. For simplicity's sake I am using a single header file though (no need for more modular builds right now). Here goes: ```bash #!/bin/bash

@@ -665,3 +665,5 @@ 42 #each

``` The funny thing is that now the resulting bytecode is actually _two bytes longer_, but that's because I am only using one symbol twice, and it's only made up of two letters. _Normally_, there would be savings as far as bytecode size goes! + +That was satisfying. I was so happy about all this byte-wrangling that I also implemented a seamless way to support reading and writing binary files using the existing `read`, `write`, and `append` symbols.