12 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?

17 comments

  1. [2]
    acdw
    Link
    I'm working on (another) static site generator, this one in common lisp and ingesting mime messages

    I'm working on (another) static site generator, this one in common lisp and ingesting mime messages

    4 votes
    1. adutchman
      Link Parent
      I'm intrigued. Why Lisp and why and how MIME?

      I'm intrigued. Why Lisp and why and how MIME?

      3 votes
  2. skybrian
    (edited )
    Link
    On repeatTest, I’ve been working on internal cleanups with the goal of making shrinking faster for large generated values. The idea is that it should work like a build system; if a dependency...

    On repeatTest, I’ve been working on internal cleanups with the goal of making shrinking faster for large generated values. The idea is that it should work like a build system; if a dependency hasn’t changed, a cached value can be reused instead of rebuilding it each time.

    There is now a Gen<T> class that holds a value and the information needed to regenerate it, with a mutate() method that returns a copy after applying an edit. I also rewrote the shrinkers to be cleaner and cleaned up a hack in repeatTest that depended on the internals of generated values.

    JavaScript doesn’t really have immutable values, but it has Object.freeze() and Object.isFrozen() for a shallow freeze of an object’s properties. I decided to use that to decide whether an object can be cached or needs to be regenerated each time. You can defeat this pretty easily by having a frozen property that points to a mutable value, but I’m going to consider that an escape hatch.

    No release this week.

    4 votes
  3. MeatGrandpa
    Link
    I'm working on a Magic the Gathering tracker app. My friends and I play every week, and we currently use Lifetap, and it's just all around the best, but I find myself wanting some extra bits...

    I'm working on a Magic the Gathering tracker app.

    My friends and I play every week, and we currently use Lifetap, and it's just all around the best, but I find myself wanting some extra bits thrown in there. I'm using React Native, which is relatively new to me, so I'm also learning a good bit at the same time.

    3 votes
  4. [3]
    Wulfsta
    Link
    After sitting down for a few hours and going over the microcontroller manual, then confirming with another developer, I realized that the ATSAME70 (Duet 6HC) runs slowly in Klipper because every...

    After sitting down for a few hours and going over the microcontroller manual, then confirming with another developer, I realized that the ATSAME70 (Duet 6HC) runs slowly in Klipper because every instruction is fetched from flash memory, over a bus that is running at half the frequency of the processor. That is, the chip runs at 300MHz, but is really running at a maximum of 150MHz due to the bus (even RAM access happens over this bus), and probably much slower because we have to wait a certain number of cycles to read from flash. I started tinkering with enabling caches, but realized that Klipper is small enough to fit entirely in the Instruction Tightly Coupled Memory (ITCM) on this chip with room to spare. My current plan is to try loading Klipper into flash with virtual memory addresses that point to the ITCM, then using the Direct Memory Access (DMA) controller on the chip to copy the entirety of Klipper into the ITCM before enabling the ITCM. I have to use the DMA hardware because there is a seamless remapping that happens from the ITCM addresses to the beginning of flash memory when the ITCM is disabled, but DMA can write to those addresses without getting remapped. I’m trying to minimize modifications to the linker script as much as possible, to make it easier to merge upstream. After this I will try to enable the Data Cache in the processor, because all of the data should simply fit directly into it, and then everything will be able to run at 300MHz.

    3 votes
    1. [2]
      skybrian
      Link Parent
      This reminds me of how it works when coding on the Raspberry Pi Pico. There's a macro you can use to annotate hot functions that you want to be in RAM, and the build system somehow arranges for it...

      This reminds me of how it works when coding on the Raspberry Pi Pico. There's a macro you can use to annotate hot functions that you want to be in RAM, and the build system somehow arranges for it to be loaded automatically on boot.

      Klipper seems to be 3D printing firmware. What do you want to do with it?

      1 vote
      1. Wulfsta
        Link Parent
        Well, Klipper currently runs my printer, and I (with a decent amount of debugging help from another developer) added the Duet 1LC support to it already - I wanted to try Klipper out rather than...

        Well, Klipper currently runs my printer, and I (with a decent amount of debugging help from another developer) added the Duet 1LC support to it already - I wanted to try Klipper out rather than RepRapFirmware due to some issues I was having with RRF. I just got annoyed that I can’t run higher microsteps on the 6HC and started looking into it.

        And you are not far off - there is a GCC annotation that is also used for hot path functions in Klipper (I think, since the linker mentions RAM functions) that I believe you are talking about. This is a little heavier, since it is not so hardware agnostic as that.

        1 vote
  5. Tuaam
    Link
    Working on a 2D Raycaster similar to Wolfenstien or TES Arena. I have used this tutorial to get started with a rudimentary engine which renders textures within a tile-like fashion. The goal is to...

    Working on a 2D Raycaster similar to Wolfenstien or TES Arena. I have used this tutorial to get started with a rudimentary engine which renders textures within a tile-like fashion. The goal is to make a roguelike game which is a mix between an older dungeon-crawler and something like nethack, you can freely move around and collect items but also face difficult enemies.

    So far I've gotten down random generation and some basic features like a minimap, a 'fog' system which works similar to lighting, and am currently refactoring the code to be more usable. I also have a system where you can break blocks which are near to you - alot of stuff is easily doable if you just understand the engine enough.

    Of course, I am writing this in a mix of C/C++ and it's on Linux Mint so it's mostly targeted towards that sort of stuff. I would share the github repo but I don't quite feel comfortable sharing it on an online platform. This has been a new experience for me as I haven't written C++ in a while, but it's nice to get to it.

    3 votes
  6. [3]
    hobblyhoy
    Link
    I made a new portfolio site that I pushed live today. I've never even seen it on a real mobile device or any screens bigger than my laptop so I'm sure there will be some layout updates needed....

    I made a new portfolio site that I pushed live today. I've never even seen it on a real mobile device or any screens bigger than my laptop so I'm sure there will be some layout updates needed. Feedback/criticism is welcome.

    https://gitcheckoutnathan.com/

    3 votes
    1. [2]
      first-must-burn
      Link Parent
      Preface: since this is your portfolio, these comments are meant to be constructive criticism to help you put your best foot forward. Also, many of these are design/ux elements, rather than the...
      • Exemplary

      Preface: since this is your portfolio, these comments are meant to be constructive criticism to help you put your best foot forward. Also, many of these are design/ux elements, rather than the purely technical elements, but I think people will have trouble separating the two and/or would expect you to have some awareness of them.

      Desktop comments

      • The tile effect is cool, but on my 1920x1200 (so not a crazy resolution), the tiles take up about half the width.. I think it might be more interesting as a left region three or four tiles wide.
      • If I resize the window after the animation, the tiles eat the text.
      • The mouseover widget in the project section is "nifty" but feels like bad UX. 1) it obscures the text to no purpose, and 2) there's no visual clue that mouse over is expected and 3) the source/hosted links are not visible at all until the user mouses over, so if they never get there, they won't ever know those options are available.
      • I like the color scheme overall, but the contrast between the red and purple and light and dark purple are too low. Even if you are not aiming at accessible structure (from the source, it looks like not), this is the lowest bar for accessibility. In the tool I linked, you can play with the lightness of the tones to get a color pair close to your theme colors that meets the accessibility requirements.

      Mobile comments

      Even though you noted you had not addressed this yet, here are some thoughts. I don't think anyone is putting anything serious online without considering the mobile experience, so this is probably important when you get to it.

      • In both desktop Chrome and Firefox, you can use ctrl-shift-m or a button in the developer tools to create a mobile view to check your responsive layouts. I try to use Chrome as little as possible, but their developer tools are little better. For example, you won't see the mouseover highlight in the sections when scrolling on mobile (no mouse). That is the experience the chrome sim shows you because it simulates taps, but Firefox does highlight the sections under the mouse, so it is less faithful.
      • The images in the project section don't show up at all on mobile, which is disappointing because I think they add a lot to the desktop presentation.
      • Even though the tile menu just scrolls the page (so it is not truly required for navigation), I feel like you should have some wayfinding at the top.
      • Personally, I find the effect of scrolling text over the fixed background with the slight pattern to be a little hard on the eyes. On my phone, I couldn't even tell that it was the hexagons, it just looked like a wavy pattern. I think the flat background of the desktop is a better choice for mobile as well.
      • To tie the hexagon theme in to the mobile experience, it might be interesting to pull the hexagons in as a more visible background around the section headings, or maybe a single hexagon centered on the first letter of the section titles?
      • There's a lot of extra dead space between the sections, I think you need a lg:mt-24 mt-12 or something like that (assuming that is Tailwinds).
      4 votes
      1. hobblyhoy
        Link Parent
        I appreciate the feedback I'll review these in detail later, thanks!

        I appreciate the feedback I'll review these in detail later, thanks!

        1 vote
  7. [5]
    gianni
    Link
    I’ve wanted to play around with building a desktop app as it’s different from what I usually do. So I built a GTK4 app with Zig to convert ULIDs to UUIDs. At work our app uses ULIDs throughout the...

    I’ve wanted to play around with building a desktop app as it’s different from what I usually do. So I built a GTK4 app with Zig to convert ULIDs to UUIDs. At work our app uses ULIDs throughout the system but they’re converted to UUIDs at the database layer. So this app helps me translate IDs when debugging issues.

    Source: github.com/gf3/tackle

    2 votes
    1. [4]
      first-must-burn
      Link Parent
      I did not know about ULIDs. That is interesting. I read the whole spec. I have lots of questions (not necessarily directed at you) about making submillisecond ULIDs. The carry strategy is...

      I did not know about ULIDs. That is interesting. I read the whole spec. I have lots of questions (not necessarily directed at you) about making submillisecond ULIDs. The carry strategy is interesting, but you'll only get that if all your ULIDs come from a single sources right? Also, if you get unlucky with a high random value, you might not get very many before it errors out. I have a safety background, so Intend to think in terms of worst case, but probably there are advantages for the common case.

      Also, thanks for posting the source link. It's always interesting to poke around in other peoples code setups. How do you like the devcontainers? I briefly messed with this a few years back, but found it unreliable for the application I was using. Doubtless it has gotten better since then.

      I typically just have a docker file with a task file that launches a dev environment with the source tree minutes in it. Example in this post.. Do you think there are more advantages to the dev container? Maybe integration with vscode?

      1 vote
      1. [3]
        gianni
        Link Parent
        I think if the timing and randomness requirements of ULID are too narrow you may want to reach for UUIDv7 which uses a 50-nanosecond resolution. You could always encode your UUID to "look like" a...

        I think if the timing and randomness requirements of ULID are too narrow you may want to reach for UUIDv7 which uses a 50-nanosecond resolution. You could always encode your UUID to "look like" a ULID (i.e. base32 encode) as they're both just 128 bit integers.

        We chose ULID because of it's time-sortability and compact representation. We actually implemented what I called prefixed-ULIDs which is just a ULID with a 5 character resource prefix (e.g. prod_01J8P0PYEP7843TSEY5ABTN6C4 or vndr_01J8P0QSSCD3Z04TS4KGBAGV9C). This allows us to easily associate an ID with a table/collection when we get bug reports or support requests. The prefix is stripped and the ULID is converted to a UUID at the database layer, so the translation is seamless.

        As for devcontainers, once you're familiar with them I've found I can't work without them! I've always had issues with dev environments over multiple projects—especially developing new products while maintaining legacy systems. Additionally running a team, there have always been issues and inconsistencies between developer machines for whatever reasons that cause weird bugs or outages for individual team members. Devcontainers fix these issues allowing team members or contributors to work in the same precisely-specified and reproducable environment.

        Reading through your previous comment, your Dockerfile setup is very similar to the devcontainer process. The devcontainer spec just formalizes this process and provides common lifecycle and event hooks (which allow deep integration into tools like VSCode as you mentioned). You might be interested in the devcontainer cli which would allow you to maintain most of your current workflow but also take advantage of any additional features.

        Similar to devcontainers, I also use toolbox for non-project based environments that require additional packages or tooling. I think this is similar to your process just without the Dockerfile. The host integration of toolbox would allow you to install your editor (e.g. VSCode or Sublime Text) inside the toolbox that also includes all of your project dependencies.

        Out of curiosity, what type of things do you mostly find yourself developing?

        1. [2]
          first-must-burn
          Link Parent
          I'll have to give the devcontainers another try. In particular, it might make it easier for other people to come along behind and use the environment. Oh, I have a wide variety of things, thanks...

          I'll have to give the devcontainers another try. In particular, it might make it easier for other people to come along behind and use the environment.

          Out of curiosity, what type of things do you mostly find yourself developing?

          Oh, I have a wide variety of things, thanks for asking:

          • a while back I was working at a startup where I did a lot of tool building, mostly Python, Go, C++, but I also got into the Kubernetes stuff as we moved our tools into the SaaS arena.
          • when I was at the startup, I did a full-stack Kubernetes app as a personal project as a way to work through the modern javascript/SPA paradigm and touching all the pieces.
          • I have another personal project, a monitoring tool I'm working on in Go. First use case is to periodically send emails and verify that they were received, so you can do an end-to-end validation of your email server, but I'll probably expand it with DNS checks and other things.
          • work project: using Atlas for deploying a website on Cloudflare's worker/pages infrastructure that is mostly static generated, but has a few server-side endpoints for form processing. Cloudflare's free tier is pretty generous, which is great because it's for a non-profit, so cost control is important.
          • work project: software for a startup in gaming space, a mix of C++ and C# for PC, as well as embedded C++ for the hardware side

          The startup was fun, especially the early days, because there was so much variety. I've been trying to break into contract work since leaving the startup, but with only moderate success. I have a few gigs (as noted) but they are pretty small. I'm more of a jack-of-all-trades, so useful if you need to do a lot of different things, but a lot of places seem to be looking for someone who's spent ten years using their particular framework/toolset.

          1 vote
          1. gianni
            Link Parent
            That’s very cool, thank you for sharing. An eclectic mix of technology!

            That’s very cool, thank you for sharing. An eclectic mix of technology!

            1 vote
  8. xk3
    (edited )
    Link
    My small Rust project a couple weeks ago gave me more confidence to start contributing to Rust projects. One of the things that has been annoying me recently is that Alt+,, which I use to...

    My small Rust project a couple weeks ago gave me more confidence to start contributing to Rust projects.

    One of the things that has been annoying me recently is that Alt+,, which I use to duplicate command-line arguments, does not behave the same behavior as Alt+.:

    bind --preset \e. history-token-search-backward
    bind \e, backward-kill-bigword yank yank
    

    So I turned my frustration into a PR: https://github.com/fish-shell/fish-shell/pull/10738