11
votes
What programming/technical projects have you been working on?
This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?
I made a tileable blueprintin factorio that can craft any entity an assembly machine or a chemical plant can make
I'm intrigued, do you have a link?
I found a way to improve it, so I'll send it once that's done!
This week on repeatTest, I’ve been working on making table generation and parsing more flexible. I’d like to be able to define rows as unions of JavaScript objects with different properties, so long as the properties used as unique keys are the same in each variant.
For one of my contracts, I set up a containerized embedded development platform. It was a lot of work, but the end result has been super satisfying.
It has code auto formatting, doxygen generation, and code coverage instrumentation. The code uses the Arduino framework and a lot of Arduino libraries (using Arduino was not my call), so I am wrapping each of those with an abstract interface. The application components are built on top of these interfaces so that they can be unit tested using mock driver implementations. This makes it easy to do off-target functional testing and to simulate failures originating in the drivers or hardware interfaces. Although we will also have to to do HIL integration tests.
The build system (cmake) builds libraries for each component twice, once using an embedded toolchain and once using vanilla gcc. The embedded libraries get linked with the main to make the embedded binary, and the Linux libraries get linked against unit tests written with Google Test and using mocks of the aforementioned interfaces.
Everything runs in a docker container which can be used standalone or as a vscode dev container. The latter is nice because the intellisense can see all the embedded libraries and use the toolchain in the container. It also means a pretty nice Linux working environment even on my Windows machine.
There's a task file inside the docker image that automates all the common tasks, and another to invoke them from outside the docker container for standalone operation.
I would like to add some static analysis, but started by just turning all the gcc warnings on (really all of them, not -Wall) and have them converted to errors.
I have not had time to look into it yet, but I would like to look into building and running the test binaries either on target or on an Arm simulator so that I'm as close as possible to the target architecture.
Been really tough to motivate myself on personal projects outside work. Work is good, and interesting, but all that mental effort makes it difficult to focus after hours.
I don't really talk about work much here, maybe I could. I mainly work in image processing; the last couple months have been dominated by three projects. Two of them deal with 2D/3D registration on X-Ray images, that is, given a 2D X-ray image, try to identify the 3D position and orientation of certain bones of interest. On one of these projects, the last couple weeks have been very uninteresting work dealing with our client's inconsistently structured datasets. I'm updating our system to ingest data from their new acquisition pipeline. For the other project we've been going through some rounds of user feedback and making adjustments to the workflow. No real algorithm work (for now), although we have some ideas for improvements in the future once we get this release out. Iteration times waiting for feedback can be slow, and I find UX work a bit tedious.
The third project is, to me, the most interesting. The modality - multispectral images - is new to me since joining that team. I've been learning a ton from colleagues and reading literature on the subject - it's fascinating! But a lot of mental effort.
One of the after-hours projects I had been working on was a Vulkan renderer written in Zig (last update on that here), both to learn more about Vulkan and to learn more about Zig. But, with all the graphics code in the registration projects from work, I really don't have the patience to deal with Vulkan at the end of the day.
The other after-hours project I was working on, a bit easier to get motivation, is a tiny Python static site generator for a personal blog (last update on that here). I did make progress on this since then - rather than using tikz for figures, I created an extension that allowed me to tag
```
code blocks as executable python scripts that generated figures with matplotlib. It would automatically dump those to SVG and embed them in the page, correctly interacting with the stylesheet. It works pretty well!However I stopped working on that project for the fundamental reason that justified monospace text really doesn't work on mobile - and most people reading would be on mobile. It is not too hard to write monospace text that flows for multiple character widths - I did some integer arithmetic to work out ideal line widths. The problem is that in order to support mobile reading, you end up with these little sections of 2-3 words that need to be some exact number of characters long. There's only so many ways to rephrase 2-3 words to hit exactly 13 characters; for any moderately sized piece of text you end up with impossible sections.
So I had reverted back to proportional text, but that character-counting poetry was a lot of what motivated the project for me. As an alternate motivator - I really want an outlet for writing Zig. So I'm taking a stab at reimplementing my tiny static site generator in Zig. From what I gather*, there are no compliant markdown rendering libraries already available for Zig, so I've started writing my own as a first step. Parsers have nothing to do with my day job, so it's been easier to get invested in it. In isolation, it's a relatively small projects. Just a straightforward input-output transformer. I think it's a good hobby-level outlet to write some Zig code without thinking too hard about managing long-lived resources.
* EDIT: After writing all this I was curious - surely this can't be true?? And I think it may not be. After a bit more thorough research, it looks like there is an implementation in the zig repo used for documentation, although I don't see if it claims compliance with any spec. I also found koino which is a Zig port of a Rust port of Github's fork of the Commonmark reference implementation.
I'm just implementing a recursive descent parser in two phases. First, parse the block structure of the document. This is straightforward on a line-by-line basis. Each block then has runs of inline text which are each processed independently in the second phase. I wrote a little script to scrape the examples from the CommonMark spec and generate Zig test cases from them; so I'm testing against that to try to be compliant. My intent, ultimately, is to support Obsidian Flavored Markdown so I could render documents directly from my Obsidian vault, but that's a long way off.