-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
338 lines (329 loc) · 26.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html>
<head>
<title>Philippe Gaultier's blog</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="application/atom+xml" href="/blog/feed.xml" rel="self"/>
<link rel="shortcut icon" type="image/ico" href="/blog/favicon.ico">
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/default.min.css">
<script src="highlight.min.js"></script>
<!-- From https://github.com/odin-lang/odin-lang.org/blob/6f48c2cfb094a42dffd34143884fa958bd9c0ba2/themes/odin/layouts/partials/head.html#L71 -->
<script src="x86asm.min.js"></script>
<script>
window.onload = function() {
hljs.registerLanguage("odin", function(e) {
return {
aliases: ["odin", "odinlang", "odin-lang"],
keywords: {
keyword: "auto_cast bit_field bit_set break case cast context continue defer distinct do dynamic else enum fallthrough for foreign if import in map matrix not_in or_else or_return package proc return struct switch transmute type_of typeid union using when where",
literal: "true false nil",
built_in: "abs align_of cap clamp complex conj expand_to_tuple imag jmag kmag len max min offset_of quaternion real size_of soa_unzip soa_zip swizzle type_info_of type_of typeid_of"
},
illegal: "</",
contains: [e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE, {
className: "string",
variants: [e.QUOTE_STRING_MODE, {
begin: "'",
end: "[^\\\\]'"
}, {
begin: "`",
end: "`"
}]
}, {
className: "number",
variants: [{
begin: e.C_NUMBER_RE + "[ijk]",
relevance: 1
}, e.C_NUMBER_MODE]
}]
}
});
hljs.highlightAll();
document.querySelectorAll('code').forEach((el, _i) => {
if (0 == el.classList.length || el.classList.contains('language-sh') || el.classList.contains('language-shell') || el.classList.contains('language-bash')){
el.classList.add('code-no-line-numbers');
return;
}
var lines = el.innerHTML.trimEnd().split('\n');
var out = [];
lines.forEach(function(l, i){
out.push('<span class="line-number">' + (i+1).toString() + '</span> ' + l);
});
el.innerHTML = out.join('\n');
});
}
</script>
</head>
<body>
<div id="banner">
<div id="name">
<img id="me" src="me.jpeg">
<span>Philippe Gaultier</span>
</div>
<ul>
<li> <a href="/blog/body_of_work.html">Body of work</a> </li>
<li> <a href="/blog/articles-by-tag.html">Tags</a> </li>
<li> <a href="https://github.com/gaultier/resume/raw/master/Philippe_Gaultier_resume_en.pdf">Resume</a> </li>
<li> <a href="https://www.linkedin.com/in/philippegaultier/">LinkedIn</a> </li>
<li> <a href="https://github.com/gaultier">Github</a> </li>
<li> <a href="/blog/feed.xml">Atom feed</a> </li>
</ul>
</div>
<div class="body">
<div class="articles">
<h2 id="articles">Articles</h2>
<ul>
<li>
<div class="home-link">
<span class="date">2024-11-10</span>
<a href="/blog/way_too_many_ways_to_wait_for_a_child_process_with_a_timeout.html">Way too many ways to wait on a child process with a timeout</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#unix" class="tag">Unix</a> <a href="/blog/articles-by-tag.html#signals" class="tag">Signals</a> <a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#linux" class="tag">Linux</a> <a href="/blog/articles-by-tag.html#freebsd" class="tag">FreeBSD</a> <a href="/blog/articles-by-tag.html#illumos" class="tag">illumos</a> <a href="/blog/articles-by-tag.html#macos" class="tag">MacOS</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-11-06</span>
<a href="/blog/perhaps_rust_needs_defer.html">Perhaps Rust needs "defer"</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#rust" class="tag">Rust</a> <a href="/blog/articles-by-tag.html#c" class="tag">C</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-10-31</span>
<a href="/blog/tip_of_day_3.html">Tip of the day #3: Convert a CSV to a markdown or HTML table</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#markdown" class="tag">Markdown</a> <a href="/blog/articles-by-tag.html#csv" class="tag">Csv</a> <a href="/blog/articles-by-tag.html#awk" class="tag">Awk</a> <a href="/blog/articles-by-tag.html#tip-of-the-day" class="tag">Tip of the day</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-10-30</span>
<a href="/blog/lessons_learned_from_a_successful_rust_rewrite.html">Lessons learned from a successful Rust rewrite</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#rust" class="tag">Rust</a> <a href="/blog/articles-by-tag.html#cplusplus" class="tag">C++</a> <a href="/blog/articles-by-tag.html#rewrite" class="tag">Rewrite</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-10-29</span>
<a href="/blog/tip_of_the_day_2.html">Tip of the day #2: A safer arena allocator</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#allocator" class="tag">Allocator</a> <a href="/blog/articles-by-tag.html#safety" class="tag">Safety</a> <a href="/blog/articles-by-tag.html#tip-of-the-day" class="tag">Tip of the day</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-10-29</span>
<a href="/blog/tip_of_day_1.html">Tip of the day #1: Count lines of Rust code, ignoring tests</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#rust" class="tag">Rust</a> <a href="/blog/articles-by-tag.html#tip-of-the-day" class="tag">Tip of the day</a> <a href="/blog/articles-by-tag.html#awk" class="tag">Awk</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-09-19</span>
<a href="/blog/rust_c++_interop_trick.html">A small trick for simple Rust/C++ interop</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#rust" class="tag">Rust</a> <a href="/blog/articles-by-tag.html#cplusplus" class="tag">C++</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-09-10</span>
<a href="/blog/odin_and_musl.html">Odin and musl: Cross-compiling Odin programs for the Raspberry Pi Zero</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#odin" class="tag">Odin</a> <a href="/blog/articles-by-tag.html#musl" class="tag">Musl</a> <a href="/blog/articles-by-tag.html#arm" class="tag">ARM</a> <a href="/blog/articles-by-tag.html#cross-compilation" class="tag">Cross-compilation</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-06-20</span>
<a href="/blog/write_a_video_game_from_scratch_like_1987.html">Let's write a video game from scratch like it's 1987</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#x11" class="tag">X11</a> <a href="/blog/articles-by-tag.html#video-game" class="tag">Video game</a> <a href="/blog/articles-by-tag.html#odin" class="tag">Odin</a> <a href="/blog/articles-by-tag.html#optimization" class="tag">Optimization</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-05-03</span>
<a href="/blog/how_to_rewrite_a_cpp_codebase_successfully.html">How to rewrite a C++ codebase successfully</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#cplusplus" class="tag">C++</a> <a href="/blog/articles-by-tag.html#rust" class="tag">Rust</a> <a href="/blog/articles-by-tag.html#rewrite" class="tag">Rewrite</a> <a href="/blog/articles-by-tag.html#safety" class="tag">Safety</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-03-07</span>
<a href="/blog/a_small_trick_to_improve_technical_discussions_by_sharing_code.html">A small trick to improve technical discussions by sharing code</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#lua" class="tag">Lua</a> <a href="/blog/articles-by-tag.html#neovim" class="tag">Neovim</a> <a href="/blog/articles-by-tag.html#git" class="tag">Git</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-02-29</span>
<a href="/blog/you_inherited_a_legacy_cpp_codebase_now_what.html">You've just inherited a legacy C++ codebase, now what?</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#cplusplus" class="tag">C++</a> <a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#legacy" class="tag">Legacy</a> <a href="/blog/articles-by-tag.html#ci" class="tag">CI</a> <a href="/blog/articles-by-tag.html#git" class="tag">Git</a> <a href="/blog/articles-by-tag.html#rewrite" class="tag">Rewrite</a></div></li>
<li>
<div class="home-link">
<span class="date">2024-02-23</span>
<a href="/blog/image_size_reduction.html">Quick and easy PNG image size reduction</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#optimization" class="tag">Optimization</a> <a href="/blog/articles-by-tag.html#png" class="tag">PNG</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-12-15</span>
<a href="/blog/feed.html">This blog now has an Atom feed, and yours should probably too</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#feed" class="tag">Feed</a> <a href="/blog/articles-by-tag.html#atom" class="tag">Atom</a> <a href="/blog/articles-by-tag.html#uuid" class="tag">UUID</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-12-01</span>
<a href="/blog/gnuplot_lang.html">Solving a problem with Gnuplot, the programming language (not the plotting software!)</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#advent-of-code" class="tag">Advent of Code</a> <a href="/blog/articles-by-tag.html#gnuplot" class="tag">Gnuplot</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-11-23</span>
<a href="/blog/roll_your_own_memory_profiling.html">Roll your own memory profiling: it's actually not hard</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#allocator" class="tag">Allocator</a> <a href="/blog/articles-by-tag.html#profiling" class="tag">Profiling</a> <a href="/blog/articles-by-tag.html#pprof" class="tag">Pprof</a> <a href="/blog/articles-by-tag.html#linux" class="tag">Linux</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-10-12</span>
<a href="/blog/wayland_from_scratch.html">Learn Wayland by writing a GUI from scratch</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#wayland" class="tag">Wayland</a> <a href="/blog/articles-by-tag.html#gui" class="tag">GUI</a> <a href="/blog/articles-by-tag.html#x11" class="tag">X11</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-10-05</span>
<a href="/blog/advent_of_code_2018_5_revisited.html">Optimizing an Advent of Code solution in assembly</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#x86-64" class="tag">x86_64</a> <a href="/blog/articles-by-tag.html#advent-of-code" class="tag">Advent of Code</a> <a href="/blog/articles-by-tag.html#optimization" class="tag">Optimization</a> <a href="/blog/articles-by-tag.html#algorithm" class="tag">Algorithm</a> <a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#lisp" class="tag">Lisp</a> <a href="/blog/articles-by-tag.html#scheme" class="tag">Scheme</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-06-03</span>
<a href="/blog/kahns_algorithm.html">Cycle detection in graphs does not have to be hard: A lesser known, simple way with Kahn's algorithm</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#graph" class="tag">Graph</a> <a href="/blog/articles-by-tag.html#algorithm" class="tag">Algorithm</a> <a href="/blog/articles-by-tag.html#javascript" class="tag">JavaScript</a> <a href="/blog/articles-by-tag.html#sql" class="tag">SQL</a></div></li>
<li>
<div class="home-link">
<span class="date">2023-05-31</span>
<a href="/blog/x11_x64.html">Learn x86-64 assembly by writing a GUI from scratch</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#gui" class="tag">GUI</a> <a href="/blog/articles-by-tag.html#x86-64" class="tag">x86_64</a> <a href="/blog/articles-by-tag.html#x11" class="tag">X11</a> <a href="/blog/articles-by-tag.html#optimization" class="tag">Optimization</a></div></li>
<li>
<div class="home-link">
<span class="date">2020-09-21</span>
<a href="/blog/speed_up_your_ci.html">Adventures in CI land, or how to speed up your CI</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#ci" class="tag">CI</a> <a href="/blog/articles-by-tag.html#optimization" class="tag">Optimization</a></div></li>
<li>
<div class="home-link">
<span class="date">2020-09-07</span>
<a href="/blog/compile_ziglang_from_source_on_alpine_2020_9.html">How to compile LLVM, Clang, LLD, and Ziglang from source on Alpine Linux</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#llvm" class="tag">LLVM</a> <a href="/blog/articles-by-tag.html#zig" class="tag">Zig</a> <a href="/blog/articles-by-tag.html#alpine" class="tag">Alpine</a></div></li>
<li>
<div class="home-link">
<span class="date">2019-09-05</span>
<a href="/blog/advent_of_code_2018_5.html">Getting started with Scheme by solving an Advent of Code 2018 challenge</a>
</div>
<div class="tags">
<a href="/blog/articles-by-tag.html#lisp" class="tag">Lisp</a> <a href="/blog/articles-by-tag.html#scheme" class="tag">Scheme</a> <a href="/blog/articles-by-tag.html#c" class="tag">C</a> <a href="/blog/articles-by-tag.html#advent-of-code" class="tag">Advent of Code</a></div></li> </ul>
</div>
<h2 id="about-me">
<a class="title" href="#about-me">About me</a>
<a class="hash-anchor" href="#about-me" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a>
</h2>
<p>I am a French/German Senior Software Engineer from France living in Bavaria, Germany. By day, I work for a Fintech company, and by night I write some fun projects in C, Rust, Odin, Zig, and Assembly. I like to work on low-level systems.</p>
<p>In my free time, I run, lift weights, play music, learn languages, and garden.</p>
<p>Get in touch, send me an email (link on my Github profile)!</p>
<h2 id="this-blog">
<a class="title" href="#this-blog">This blog</a>
<a class="hash-anchor" href="#this-blog" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a>
</h2>
<p>This blog is <a href="https://github.com/gaultier/blog">open-source</a>! If you find a problem, please open a Github issue.</p>
<p>The content of this blog as well as the code snippets are under the <a href="https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)">BSD-3 License</a> which I also usually use for all my personal projects. It's basically free for every use but you have to mention me as the original author.</p>
<p>I very unregularly post about various technical topics, usually low-level, esoteric and probably not directly applicable to your run-of-the-mill business application.</p>
<p>This blog does not and will not employ any tracking or cookie of any sort. The only Javascript present is fully optional and only used to do code highlighting.</p>
<h2 id="i-am-grateful">
<a class="title" href="#i-am-grateful">I am grateful</a>
<a class="hash-anchor" href="#i-am-grateful" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a>
</h2>
<p>I often am frustrated with the state of the software industry; however there is software out there that I am deeply grateful for.</p>
<ul>
<li>Address Sanitizer/Thread Sanitizer. How many projects can revolutionize the way an established industry writes and thinks about native programming languages, and by so doing, impacts the development of new programming languages, such as Rust and Go? And how many projects are massively helpful for beginners and experts alike? Any respectable C or C++ programmer should test every new line of code under these sanitizers, numerous bugs will be caught and your understanding of the standard and undefined behaviour will be greatly improved. Finally, its benefits compound nicely with fuzzing and automated testing.</li>
<li>Swaywm. A simple and snappy tiling window manager. Using one of these has completely changed the way I interact with a computer.</li>
<li>C: The OG, simple (for some definition of simple), fast, ubiquitous. It will outlive us all.</li>
<li>Odin and Zig: Simple and fast. It makes you realize how many features in other programming languages you can live without; they are an exercise in minimalism.</li>
<li>Vim/Neovim. Another timeless, minimal, fast program that's great for code and prose alike and that respects your computer by requiring very minimal resources. This blog was entirely written inside Neovim!</li>
<li>ZFS. The last filesystem you'll need. Reliable and is built on the right concepts. It feels like Git for the filesystem.</li>
<li>Wine/Proton. What a technical feat, and a massive reverse engineering effort, to make Windows applications work on Linux without the application even noticing.</li>
<li>Rust. Because it catches all my mistakes at compile time and I wish all compilers would too. Although its complexity is a beast.</li>
<li>Zig the toolchain. Because straightforward cross-compiling should be what everyone does on a daily basis without having to setup Docker/VMs/a complicated CI.</li>
</ul>
<h2 id="portfolio">
<a class="title" href="#portfolio">Portfolio</a>
<a class="hash-anchor" href="#portfolio" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a>
</h2>
<p><em>In chronological order, which is also roughly the ascending order of technical difficulty:</em></p>
<p><a href="https://github.com/gaultier/Simulation_Stars_OpenGL">Prototype using the Oculus Rift</a>: This was my second internship and the first time I owned a project from start to finish. This was a blast and possibly the most fun I had in all my career. This is back in 2014 and the first version of the Oculus Rift was all the hype back then. The goal of the project in the astronomy/CERN lab I was at was to explore how to teach kids about the solar system and astronomy by having them put the Oculus Rift on and experiment it for themselves, flying through the stars. It was great! I got to learn about OpenGL, SDL and multiplying specific 4x4 matrices together to slightly move the camera for each eye so that the VR effect happens and your brain is tricked.
In terms of implementation this is pretty subpar C++ code in retrospect - I went all in on OOP and trying to use every C++ feature under the sun. But it worked, kind of, each star was a cube because I ran out of time.
Part of this project was also to add a VR mode to an existing 3D application written in C; that was quite a big codebase and I did indeed add this mode; however it never worked quite right, there was some constant stuttering which might have been due to loss of precision in floating point calculations.
Overall a ton of fun.</p>
<br/>
<p><a href="https://github.com/gaultier/lox-ocaml">lox-ocaml</a> is the first compiler and interpreter I wrote while following along the excellent <a href="http://craftinginterpreters.com/the-lox-language.html">Crafting Interpreters</a>. The first part of the book is a Java implementation which I wanted to avoid and thus went with OCaml which I anyway wanted to dig deep on. It fit because it remains a garbage collected language like Java and has support for imperative code if I needed to follow closely the official code. It went really well, I had a blast and OCaml is pretty nice; however I will never understand why it pushes the developer to use linked list and it is so hard to use dynamic arrays instead. The ecosystem and tooling is a bit split in half but overall it was a great experience.</p>
<br/>
<p><a href="https://github.com/gaultier/kotlin-rs">kotlin-rs</a> is a Kotlin compiler written in Rust and my first attempt at it. It is not finished but can still compile Kotlin functions, expressions and statements to JVM bytecode and run that.
This was my first compiler project on my own, I chose Kotlin because I was working with Kotlin at the time and was suffering from the excruciatingly slow official compiler at the time (it improved somewhat since). It allowed me to skip the language design part and focus on the implementation.
I think it still holds up to this day although I would definitely change how the AST is modeled and avoid having each node being a <code>Box<T></code> (see below on another take on the subject). One big topic I did not tackle was generating Stack Map Frames which are a JVM concept to verify bytecode in linear time before running it.</p>
<br/>
<p><a href="https://github.com/gaultier/microkt">microkt</a> is my second take on a Kotlin compiler, this time written in C and targeting x86_64 (no JVM). I think it is nice to have the luxury to revisit a past project in a different language and reevaluating past choices. I got about equally as far as the <code>kotlin-rs</code> in terms of language support and stopped while implementing the Garbage Collector which is an can of worms by itself. The reason I stopped is that I noticed I was being regularly stopped in my tracks by bugs in the generated x86_64 assembly code, notably due to 'move with zero extend' issues and register allocation. I thus decided to dig deep on this subject before returning to the compiler which I never did because I got two kids right after.
The implementation still holds, however I would definitely revist the assembly generation part as mentioned and use a structured representation instead of a textual one (no one wants to do string programming).</p>
<br/>
<p><a href="https://github.com/gaultier/c">My C monorepo</a> is a big mix a small and big programs all written in C. The most noteworthy are:</p>
<ul>
<li><code>torrent</code>: A bittorrent client. It works well but only handles one file and is probably a nest of security vulnerabilities now that I think of it</li>
<li><code>crash-reporter</code>: A crash reporter for macOS x86_64. It gives a full stacktrace at any point in the program. It does so by parsing the DWARF information embedded in the mach-o executable format.</li>
<li><code>clone-gitlab-api</code>: A small CLI that downloads all projects from a Gitlab instance. Especially useful since my employer at the time had all projects hosted on a private Gitlab instance and there was no search feature. So I figured that the easiest way is to fetch the list of all projects, clone them locally and use grep on them. I worked great! This is conceptually <code>curl</code> + <code>parallel</code> + <code>git clone/pull</code>. I additionally wrote an equivalent <a href="https://github.com/gaultier/gitlab-clone-all">Rust version</a>. I also later wrote <a href="https://github.com/gaultier/gitlab-events">something similar</a> to poll Gitlab for notifications to watch repository changes. Yeah Gitlab is/was pretty limited in functionality.</li>
</ul>
<br/>
<p><a href="https://github.com/gaultier/micro-kotlin">micro-kotlin</a>: The third (and last?) take on a Kotlin compiler, in C. It goes much further than the two previous attempts both in terms of language support and in terms of implementation:</p>
<ul>
<li>Expressions, statements, control flow, and functions (including recursion) are implemented</li>
<li>It implements Stack Map Frames contrary the <a href="https://github.com/gaultier/kotlin-rs">kotlin-rs</a> so the latest JVM versions work seamlessly with it and bytecode generated by the compiler is verified at load time by the JVM</li>
<li>It implements type constraints in the type checker to infer which function the user intended to call (and the rules in Kotlin for that are so very complex). That's one of the thorniest topics in Kotlin due to the language trying to have every programming language feature under the sun, namely: type inference, function overloading, default parameters, generics, implicit callers (<code>it</code> and such), variadic functions, object inheritance with method overriding, etc.</li>
<li>It explores the class path so that external libraries can be use including the Java and Kotlin standard libraries</li>
<li>Some Java/Kotlin interop is supported (mostly, calling Java functions from Kotlin)</li>
<li>It parses and understands .jmod, .class, .jar files, even with zlib compression</li>
<li>Out-of-order definitions of functions and variables are supported</li>
<li>Some support for function inlining is supported (inlining the body of a called function)</li>
<li>All allocations are done with an arena allocator and there is support for a memory dump with stacktraces</li>
<li>It's only 10k lines of code, it ony needs ~10 MiB of memory to compile real programs, and the final stripped executable for the compiler is ~180 Kib!</li>
</ul>
<p>I think my most noteworthy projects are compilers both because I tend to be attracted to that domain and also because small CLI tools are less interesting. Compilers for real programming languages are hard!</p>
<h2 id="resume">
<a class="title" href="#resume">Resume</a>
<a class="hash-anchor" href="#resume" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a>
</h2>
<p>You can find my resume <a href="https://gaultier.github.io/resume/resume">online</a>
or download it as <a href="https://github.com/gaultier/resume/raw/master/Philippe_Gaultier_resume_en.pdf">PDF</a>.</p>
<blockquote id="donate">
<p>If you enjoy what you're reading, you want to support me, and can afford it: <a href="https://paypal.me/philigaultier?country.x=DE&locale.x=en_US">Support me</a>. That allows me to write more cool articles!</p>
</blockquote>
<blockquote>
<p>
This blog is <a href="https://github.com/gaultier/blog">open-source</a>!
If you find a problem, please open a Github issue.
The content of this blog as well as the code snippets are under the <a href="https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)">BSD-3 License</a> which I also usually use for all my personal projects. It's basically free for every use but you have to mention me as the original author.
</p>
</blockquote>
</div>
</body>
</html>