WLOG - blog something different

tags: ai arduino bass games godot i2c linux plan9 random web werc zig
Sometimes you just have to
link | random | Sun Jan 28 09:47:42 CET 2023 No.31

Continuing the previously discussed topic, of daring to be stupid for the sake of learning, sometimes you just have to do something for the sake of doing something.

So why not a fictional calendar with 17 months, with names based on subatomic particles? Why? Why not? And while we’re at it, let’s try out some of the current generation of generating tools.

Quantum Chronos 2024 cover preview

Some interesting takeaways from this adventure, besides the calendar being useless for tracking anything useful, are as such. The number of months with 21 and 22 days switches depending on whether it’s a leap year or not (lazy day redistribution). And the image generation model used returned a spherical motive with a center and an outer ring always when the description contained a subatomic particle in one form or another.

Any way, here is the whole thing for anyone with too much time: Quantum Chronos 2024


Dare to be stupid
link | random | Sat Jan 27 10:14:32 CET 2024 No.30

The process of learning hurts. Physically! Just like working out. Anyone who says otherwise is lying! Just remember your math (or history) days in high school.

And just like working out, the experience gets easier with practice and even pleasurable with motivation. That lesson you have to figure out for yourself.

The path is one of feeling embarrassed. As in, I am embarrassed at how long it took me to run a process as another user under plan9. Let me explain.

I experimented with ramfs (to try and save on SD card life and maybe speed up some things) and everything that comes along with it (namespaces, permissions, sharing data between processes, …). Sensor data in “gizmos” is collected by the system owner, but the web server is run as an unprivileged user none. I could not read data from the web server. So, as necessity is the mother of invention, I managed to run the web server as a normal user set up for all things web. A year to figure how to do this since first failed attempts in the beginning and leaving everything on default. Probably because of an input error in the terminal. Now, with the developed rc history the iteration was less painful and produced success.

This allowed testing and setting up a new chain of scripts that read, save and process data in a shared memory. The result was about a half-second faster graph generation on the “gizmos” pages, since data was read from RAM instead of an SD card. For about 10 KB worth of text, not bad.

BUT, as I have found, that would increase the whole generation time by about five seconds, since now, the process had to be spawned as another user with a full namespace.

Back to beginning to figure out the proper way to define workspaces and not just quick fixing it by needlessly running an exposed process with a privileged user. It turns out, once you have a proper syntax-free command, the plan9 system is brilliant about these things. Once you know how to run commands in the same way or in the same configured environment as the system does for you, debugging is a cinch.

Of course, as with all interesting things, why would there be an example?! Yes, you can read the documentation, but all theory is slow to practical progress. Sometimes you just need to see the order of parameters for things to click.

So, for anyone finding this, an example of spawning a process with an unprivileged user with a specific namespace where you can then run and debug with printouts:

auth/as -d -n /bin/service/tcp80.namespace none #command or without for rc

Back to basics
link | random | Sun Jan 14 16:49:08 CET 2024 No.29

Do you ever get that feeling, reading other people’s blogs or publications, that everything you do or write has to be new and different and contribute something new?

Let’s call this, for better or worse, content. If it’s not new, is it even valuable? To write or to read? Whose time is being wasted? Is it being wasted? Somehow, along the way to something, it was forgotten what practice is.

Sometimes you just have to get back to the basics to start up. You don’t begin a jam session by playing the latest hits, but by doing scales. You don’t play a game of wally ball by changing the local champions, but by stretching. And you don’t come back to civilization from an analog getaway by writing new algorithms, but by googling for basic HTML definitions!

It’s true that, as consumers, we care not for the process in between. Finished updates are the shiny drug. But as a techie, I miss progress updates, experiments and fails. Even a negative result is a result.

If nothing else, to feed the “dead internet” of bots, an update just for you:

  • updated the (so called) Raspberry Pi 1 server to the new 9front release - (some things didn’t compile straight from the source, should really join a 9front community to debate these kinds of things)
  • updated the tm1650fs, sgp30fs and bme680fs drivers to use the new I2C code in 9front - (this one was actually really painless; go to 9front contributors)
  • updated the web page to pass the new Google Chrome Lighthouse checks with flying colors again - (no lie, had to google basic CSS to make it happy)
  • updated the Second Chance Brotato mod - (legit forgot how to use Steam services or do Godot scripting)

Now bravely off to bigger and better things in this new year.


A month of introspection
link | random | Thu Dec 28 18:18:25 CET 2023 No.28

A journey of retrospective to acquire some perspective. And an opportunity for a lot of “specti-o” words.

How to achieve a perspective change? Distance! Be it mental or physical, in time or space. Most of the time, intertwined between all possible modes.

Something about staring into the abyss and the abyss staring back

When you change your perspective to see the universe differently, the universe looks differently at you in return.


I just think this is neat
link | plan9, random, zig | Mon Now 13 22:51:48 CET 2023 No.27

Nothing profound here. But sometimes the internet collective can still be surprising.

Apparently, you can already cross-compile Zig (at least the basic stuff) for plan9.

Zig program cross compiled for plan9

Now this is fun!

Also, a note to self more than anything: while zig itself is simple and quick to take in, the built-in build system takes a bit to get used to, but it’s slowly starting to make sense. Especially since discovering you can use it to compile C/C++ code too.

File size, data size, and memory size of c, zig using build.zig and rust on avr


Learning all the wrong lessons
link | random, zig | Wed Now 01 23:08:29 CET 2023 No.26

The time when some thought should be given to something other than just random projects is approaching. For whom does the sysbell rings?

So why not sharpen the brain with a simple exercise? A “cold open” so to speak. A quick “hello” run through the current popular (and STRONGLY recommended) system programming languages. See what we remember and how easy the easiest example is, and then do the easiest example the “hard” way (communing with the system directly).

Throw together some code, and to avoid making the grave mistake of having an opinion on programming languages on the net, print out some metrics:

File size, data size, and memory size of c, clang, zig, rust, go and odin on x84_64

In the context of my bias toward embedded and/or system development, an interesting pattern emerges. Zig and Odin produce the least amount of code.

This is not an exhaustive or balanced test by any means. But let’s explore this further. How about a popular microcontroller (it can’t get more popular than Arduino on avr, right)?

File size, data size, and memory size of c, zig and rust on avr

In the case of toggling a value in a register (and thus blinking the Arduino Nano onboard LED), Zig and C are neck and neck. Using the avr-gcc version of the compiler and included libraries or manually writing the needed parts from scratch in Zig took about the same effort (as in no time at all). Interestingly, by using Zig one could also compile C code directly (though linking and packing are still better done with avr-gcc for now).

Some more exploring needs to be done on this.