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

25 comments

  1. thismachine
    Link
    I just released aiopath, which is a reimplementation of Python's pathlib, but is compatible with asyncio and the async/await syntax.

    I just released aiopath, which is a reimplementation of Python's pathlib, but is compatible with asyncio and the async/await syntax.

    7 votes
  2. [4]
    JRandomHacker
    Link
    I've been doing some tinkering with a super-flexible video game dialogue engine - the kind of thing that would drive a BioWare RPG where you have dialogue being chosen based on current party...

    I've been doing some tinkering with a super-flexible video game dialogue engine - the kind of thing that would drive a BioWare RPG where you have dialogue being chosen based on current party members, choices made earlier, etc.

    As a supporting feature for this project, I've been trying to define/parse a text-based format for the dialogue, and it's getting tricky. I want to be able to do things like "this response triggers if you have a party member with stat xyz greater than some threshold". I feel like I'm crossing a line where I'm writing a "parser" and not a "deserializer", and I'm having to adjust accordingly.

    6 votes
    1. [2]
      gpl
      Link Parent
      I know next to nothing about this, but this got me wondering if it will be possible or even common in the future to use things like GPT-3 to dynamically generate dialogue based on contextual...

      I know next to nothing about this, but this got me wondering if it will be possible or even common in the future to use things like GPT-3 to dynamically generate dialogue based on contextual keywords generated from the situation, kind of like what you’re saying. As good as GPT-3 is I doubt it’s there yet, but curious nonetheless.

      3 votes
      1. JRandomHacker
        Link Parent
        I think there might be some experimentation in this area, and even more-general "procedural narrative" stuff. Super interesting to see where it goes, if anywhere.

        I think there might be some experimentation in this area, and even more-general "procedural narrative" stuff. Super interesting to see where it goes, if anywhere.

        4 votes
    2. hungariantoast
      Link Parent
      You may have already seen it, but just in case you haven't, you should check out Ink, which seems similar to what you are building: ink - inkle's narrative scripting language One of inkle's...

      You may have already seen it, but just in case you haven't, you should check out Ink, which seems similar to what you are building:

      One of inkle's developers also gave a GDC talk a few years ago about the language, though I have not watched it yet:

      3 votes
  3. [6]
    gpl
    Link
    Finishing up this quarter of grad school which means I'll finally have time to work on some research projects. I took a look at the main dark matter simulation code I've written (which I primarily...

    Finishing up this quarter of grad school which means I'll finally have time to work on some research projects. I took a look at the main dark matter simulation code I've written (which I primarily wrote 1.5ish years ago) and ... it is needlessly over-complicated. I think I am going to take a chunk of time to rewrite the darn thing in a simpler fashion that will make it easier to do the convergence tests and other things I need in order to be confident in its outputs. It's currently written in C++, but it really doesn't make use of anything that is unique to C++ and not C other than vectors, so I'm considering rewriting it in C and just doing memory management manually. But that might be an extra hassle I don't really need.

    5 votes
    1. [3]
      Apos
      Link Parent
      That sounds really cool! You are able to physically simulate dark matter? I can't even imagine how that works.

      That sounds really cool! You are able to physically simulate dark matter? I can't even imagine how that works.

      3 votes
      1. [2]
        gpl
        Link Parent
        It's essentially just a really really large n-body simulation. We don't know exactly what dark matter is, but we know some stuff about how it must work - it doesn't interact with other matter...

        It's essentially just a really really large n-body simulation. We don't know exactly what dark matter is, but we know some stuff about how it must work - it doesn't interact with other matter except via gravity, it doesn't self-interact, and we know the relative abundances of dark matter vs normal matter. So we can set up huge n-body simulations to track how the large scale dynamics of dark matter must evolve, and through this we can essentially simulate how all the large scale structure in the universe seems to have formed (by large scale I mean cluster and super-clusters of galaxies). From this we can then try and deduce some interesting statistics, like how clustered galaxies should be. We can then point our telescopes out there and see how clustered they actually are, which gives us a check on how good our models are. This is just one example of how these things are used.

        5 votes
        1. Apos
          Link Parent
          That makes sense!

          That makes sense!

          2 votes
    2. [2]
      joplin
      Link Parent
      I'll be particularly interested to hear about this part: For 2 reasons: As I age I have less and less patience for manually managing my program's memory. Don't get me wrong, I still hate most...

      I'll be particularly interested to hear about this part:

      It's currently written in C++, but it really doesn't make use of anything that is unique to C++ and not C other than vectors, so I'm considering rewriting it in C and just doing memory management manually.

      For 2 reasons:

      1. As I age I have less and less patience for manually managing my program's memory. Don't get me wrong, I still hate most forms of garbage collection, but using C++'s mechanisms for object lifetime management is great, and I wish I had them in other languages. Things like being able to make an object on the stack and have it clean up after itself on exit, regardless of how the exit happens is so nice. And while the syntax of shared_ptr and related classes is clunky, when they work, it's very nice.

      2. One of the most annoying things I find about graphics code that I find on the web is using a flat array of bare floats for structured data. You don't have 12 floats per polygon. You have 3 vertices, which are a unit, and treating them as a unit in your code makes it much easier to read, modify, and maintain your code! It doesn't have any affect on performance as they're still laid out the same in memory, but it makes the code accessing the elements so much nicer! (And don't get me wrong, you can do that in C with struct, too. That's not specific to C++.)

      Let us know what you find if you do make the switch.

      1 vote
      1. gpl
        Link Parent
        I'll definitely provide updates if I go that way. I can't decide right now if that's just creating more work for myself than I need, or if it would ultimately provide more control and more...

        I'll definitely provide updates if I go that way. I can't decide right now if that's just creating more work for myself than I need, or if it would ultimately provide more control and more opportunities for optimization. When each run produces a few terabytes of data stuff like this can be important, but how important is an open question.

        2 votes
  4. joplin
    Link
    I did some more work on implementing some polyhedral projections of the globe. I ended up implementing tetrahedral, cubic, octahedral, dodecahedral, and icosahedral. I'm considering adding support...

    I did some more work on implementing some polyhedral projections of the globe. I ended up implementing tetrahedral, cubic, octahedral, dodecahedral, and icosahedral. I'm considering adding support to rotate the mapping to get the continents to line up with the faces better. I'm also considering adding code to subdivide the result and more closely approximate a sphere. But I may give up and move on to 2D azimuthal projections. We'll see.

    5 votes
  5. [7]
    acdw
    Link
    I've been re-re-re-configuring my emacs :P

    I've been re-re-re-configuring my emacs :P

    5 votes
    1. [2]
      Apos
      Link Parent
      Nice! I do the same (not emacs) with all my tools.

      Nice! I do the same (not emacs) with all my tools.

      3 votes
      1. acdw
        Link Parent
        It's the most fun you can have ;P

        It's the most fun you can have ;P

        2 votes
    2. [4]
      snowcrash
      Link Parent
      On the topic of Emacs, I gotta plug Doom Emacs, an emacs "distribution" - https://github.com/hlissner/doom-emacs Having everything configured out of the box is great. I previously used Spacemacs,...

      On the topic of Emacs, I gotta plug Doom Emacs, an emacs "distribution" - https://github.com/hlissner/doom-emacs

      Having everything configured out of the box is great. I previously used Spacemacs, but Doom Emacs seems to have supplanted it and be better maintained. B

      I've recently been on an ergonomic bent. Ergnomic split keyboard, keyboard-only workflow using (Doom Emacs). But, Evil mode and using the space as the Emacs leader key are mandatory ergonomic requirements for me, and Doom Emacs provides these out of the box. Spacemacs ticks these boxes too, but Doom Emacs is just so fast and the community is heading that way. Porting over just took me a couple mins.

      If you're new to Emacs, check it out! Probably less useful to people who have their custom configs they've evolved over decades.

      3 votes
      1. [3]
        acdw
        Link Parent
        I've tried Doom before, and I like it fine ... but I really like rolling my own config :) It also provides endless hours of tweaking fun! My config is currently here. I have stolen some stuff from...

        I've tried Doom before, and I like it fine ... but I really like rolling my own config :) It also provides endless hours of tweaking fun! My config is currently here. I have stolen some stuff from Doom though :)

        I'm thinking about using god-mode, actually, in lieu of evil-mode.

        2 votes
        1. [2]
          snowcrash
          Link Parent
          god-mode seems cool, I remember looking into it years ago when I was playing with vanilla emacs, but I never stuck with it. Personally, the reason why I increasingly gravitate to evil / vim, is...

          god-mode seems cool, I remember looking into it years ago when I was playing with vanilla emacs, but I never stuck with it.

          Personally, the reason why I increasingly gravitate to evil / vim, is because it's the lingua franca of editors. If your editor has a plugin, it will have a vim plugin, and usually high quality. That universality is nice. Hell, YouTube basically uses the vim / hjkl keys. That's another plus for Doom (and Spacemacs) in my books, they integrate vim-bindings across the board. I remember feeing frustrated after implementing evil-mode, then realizing I'd also need things like evil-org-mode.

          What draws you to god-mode? Also, what do you use for your "C" key, do you re-map to space or use ctrl? With space, the value of god-mode seems less, but I 100% see it for ctrl.

          1 vote
          1. acdw
            Link Parent
            I've been thinking about god-mode b/c I've gotten used to the Emacs keybinds, and god is just a veneer over those to make it so I have to press control/alt less. "C", you mean Control? It's...

            I've been thinking about god-mode b/c I've gotten used to the Emacs keybinds, and god is just a veneer over those to make it so I have to press control/alt less. "C", you mean Control? It's "automatically" pushed in by god-mode, so e.g., xs will save (C-x C-s). A space will clear the modifier, so x 0 will close the current window (C-x 0 -- tho the README suggests mapping C-x C-0 to close window so that you can type x0).

            2 votes
  6. [4]
    overtowed
    (edited )
    Link
    I've been learning Fediverse/ActivityPub protocol stuff and made alternative docs for the Activity Streams 2.0 vocabulary. (here's the official ones) I like the vocabulary's design, my main...

    I've been learning Fediverse/ActivityPub protocol stuff and made alternative docs for the Activity Streams 2.0 vocabulary. (here's the official ones) I like the vocabulary's design, my main criticism being that it's too open ended, which for my exploring is great. Next is generating JSON schemas for the terms - it's partially implemented on a branch. From there you can do a whole lot. I couldn't find existing projects with good data.

    4 votes
    1. krg
      Link Parent
      Whoa! I really like the design of this page.

      Whoa! I really like the design of this page.

      3 votes
    2. [2]
      csos95
      Link Parent
      That's a lot nicer for navigating and jumping around to different parts quickly than the official standard. If I ever decide to take another shot at doing something with ActivityPub I think it'll...

      That's a lot nicer for navigating and jumping around to different parts quickly than the official standard.
      If I ever decide to take another shot at doing something with ActivityPub I think it'll come in handy.

      I like the vocabulary's design, my main criticism being that it's too open ended, which for my exploring is great.

      I tried implementing some ActivityPub stuff about two years ago and eventually gave up on doing it partially because of how open ended it was.
      It felt to me like for each property there were so many different possible values that I'd either have to go through many different cases to get a property value and actually do something with it or just arbitrarily decide to not support certain things.
      For example, many of the properties have a type range of Object and Link and can therefore, at least from my understanding of the documentation, be nested arbitrarily deep.
      The docs say that servers should limit how deep to recurse when resolving objects, but doesn't give a recommendation of what to set the limit to.
      I can understand why they wouldn't want to say "objects should never be nested more than one deep", but it seemed like a pretty important detail that I couldn't find discussed anywhere.
      This and a few other made me feel like I could easily end up writing something that technically follows the standard, but doesn't actually work with other ActivityPub services.

      Have you made anything that interacts with other ActivityPub services and if so, did you have issues with stuff like this or have most of the interactions been pretty straight forward for you?

      2 votes
      1. overtowed
        (edited )
        Link Parent
        My experience has been similar to yours and I have some of the same questions. The basic principle is that you "don't break on unexpected data", but that says nothing about useful presentation of...

        My experience has been similar to yours and I have some of the same questions. The basic principle is that you "don't break on unexpected data", but that says nothing about useful presentation of data or functioning interactions. I'm still new to the space but as an implementer I see a few options:

        1. prioritize getting something that works that's spec-ish
        2. interpret the spec as best you can and fill in the gaps in its spirit
        3. do what Mastodon does

        It seems a lot of implementers do #3. But Mastodon is a microblogging platform inspired by Twitter, just one of many possible forms it could take, too small a box for where I'm starting, and it makes some choices that don't fit my needs.

        Given my primary goal of shipping something this leaves me doing #1. Interop is more of an eventual goal than something you get for free day 1. (until the ecosystem matures!) Getting a common set of data structures, with a rich base Object, tied together with JSON-LD (webscale), and some common system language semantics, is a huge win, regardless of how much we might veer off-spec or extend it from here. I'd recommend understanding the basic design of the Activity Streams vocabulary to anyone building an app: the federation/protocol/ActivityPub stuff is a different part of the spec, and more domain specific, while the vocabulary is widely applicable.

        I think this all reflects how hard the problem is. Like you said the Activity Streams vocab can be used to construct arbitrarily complex nested objects, whatever "sentences" we want to say, so yeah, I think the spec authors know this and they're just saying "good luck, in the future we'll know more, go implement!". So uh have you tried throwing AI at it?

        2 votes
  7. lonk
    Link
    Added commenting to https://linklonk.com Done so far: tree-structure, Markdown formatting, sorting by user ratings, post anonymously or with your name. Next step will be to change the sorting to...

    Added commenting to https://linklonk.com

    Done so far: tree-structure, Markdown formatting, sorting by user ratings, post anonymously or with your name.

    Next step will be to change the sorting to be based on how much you trust people who upvoted each comment. This is the trust based system that is used to rank the top level items (and discussed in https://tildes.net/~tech/u7f/linklonk_a_link_aggregator_with_a_trust_system) but now applied to comment. I hope to finish it in a week.

    More details in this post: https://linklonk.com/item/7034545119553585152

    Give it a try. Register with invitation code "tildes" to create a temporary account (no email address necessary).

    Would love to know what Tildes commenting features you like the most so I could prioritize it for LinkLonk :) Personally, I like the "new" comment indicators in the list of posts and in the thread view (the orange highlighting).

    2 votes
  8. csos95
    Link
    I've been working on a simple cms to run my blog on. It's something that's been done to death, but I wanted to do a project that I'd actually finish and use. While browsing through articles on Red...

    I've been working on a simple cms to run my blog on.
    It's something that's been done to death, but I wanted to do a project that I'd actually finish and use.

    While browsing through articles on Red Blob Games, I came across one that mentioned it used Haxe for the demos on the page.
    I looked into it and while I'm not a huge fan of Java/C# feel of the syntax, I do like a few key things about it:

    Coming from Rust, the first three are things I've come to love and miss in languages that don't have them and the fourth is the selling point for why I wanted to learn it.
    The many different language outputs means that any programs I write in it should run pretty much anywhere as long as I don't rely heavily on platform specific stuff.
    I'm going to start working through Make a Lisp (something I've been meaning to do for a while) this weekend to learn Haxe.

    Before that though, I think I will try to get some more work done on the cms so I can get the basic blog up and try writing some posts as I go through mal with interactive examples.

    1 vote