aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2023-09-12-mcl.md
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2023-09-12 08:13:14 +0100
committerMartin Ashby <martin@ashbysoft.com>2023-09-12 08:14:03 +0100
commit865a3d31a305a46e671f9c66fd9480dd1b5239c8 (patch)
tree39bb0f41cbaddb373804fa4a87d7da344bcc3573 /content/posts/2023-09-12-mcl.md
parent64ed30ea5fd62b07970151192977cf5c823eecad (diff)
downloadmfashby.net-865a3d31a305a46e671f9c66fd9480dd1b5239c8.tar.gz
mfashby.net-865a3d31a305a46e671f9c66fd9480dd1b5239c8.tar.bz2
mfashby.net-865a3d31a305a46e671f9c66fd9480dd1b5239c8.tar.xz
mfashby.net-865a3d31a305a46e671f9c66fd9480dd1b5239c8.zip
Post on minecraft launcher
Diffstat (limited to 'content/posts/2023-09-12-mcl.md')
-rw-r--r--content/posts/2023-09-12-mcl.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/posts/2023-09-12-mcl.md b/content/posts/2023-09-12-mcl.md
new file mode 100644
index 0000000..7172d59
--- /dev/null
+++ b/content/posts/2023-09-12-mcl.md
@@ -0,0 +1,17 @@
+---
+title: "Mcl (minecraft launcher)"
+date: 2023-09-12T07:03:15+01:00
+draft: false
+---
+
+I wrote a [minecraft launcher](https://code.mfashby.net/mcl/about/) in [zig](ziglang.org/) as a learning exercise.
+
+I got a lot of practice writing zig code and I learned a few things about it.
+
+- The [GeneralPurposeAllocator](https://ziglang.org/documentation/master/std/#A;std:heap.GeneralPurposeAllocator) is really useful for finding memory leaks, as is the std.testing.allocator for use in tests.
+- The standard library HTTP client is really cool, but unfortunately fails on a lot of websites because it lacks TLSv1.2 support.
+- Calling into C code is really easy. I used [libCURL](https://curl.se/libcurl/) instead of the zig stdlib and it was easy to write a wrapper around it.
+- The standard library JSON parsing is good, but error messages are not verbose enough to help you and by default they don't indicate _where_ in the tree the problem is. This can be added but it's not obvious how to do it (spoiler: set the .diagnostics element on a std.json.Scanner). For types which the standard library can't cope with, there is an escape hatch: implement jsonParse method for that type.
+- The builtin module has useful constants for checking the current operating system and CPU architecture, which I used for hacking in linux-aarch64 support.
+
+Finally however, I learned that minecraft on the pinebook pro sucks :( It's just not got enough power to run the game well. \ No newline at end of file