• 2 Posts
  • 17 Comments
Joined 1 year ago
cake
Cake day: August 10th, 2023

help-circle
  • Here are some I found and used in my own code:

    • itertools
    • regex
    • anyhow and thiserror (error handling)
    • indoc (indented/formatted multi line string literals)
    • strum (various derive macros for enums)
    • petgraph (for working with general graphs)
    • winnow is a great (and fast) parser combinator library.
    • bpaf, clap and xflags are three different command line argument parser libraries. Which one to use depends on the needs of the project and if you need to match the behaviour of an existing non-rust program (as I needed to in one case)

  • Saying “it’s a graph of commits” makes no sense to a layperson.

    Sure, but git is aimed at programmers. Who should have learned graph theory in university. It was past of the very first course I had as an undergraduate many years ago.

    Git is definitely hard though for almost all the reasons in the article, perhaps other reasons too. But not understanding what a DAG is shouldn’t be one of them, for the intended target audience.


    1. Not for me. It is clearly not trying to be a systems programming language. And that is why I’m interested in Rust. I work in hard realtime (day job) and do embedded as a hobby.
      That rust is also useful higher up the stack is just a nice bonus to me which means I can keep using it when writing automation things that are too complex for a simple shell script (it has largely replaced python for this purpose for me now).

    2. Rust gained momentum because it filled a niche that was unoccupied (systems capable but safe and high level). Oxide seems to be aiming for an area already occupied by Rust from one side and things like Go from the other side. That rarely works out.



  • Vorpal@programming.devtoProgramming@programming.devLet's talk about Zig
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    1 year ago

    I really don’t see what niche it is trying to fill that isn’t already occupied.

    Rust is as successful as it is because it found a previously unoccupied niche: safe systems programming without garbage collector and with high level abstractions that (mostly) optimise away.

    I don’t think “better C” is a big enough niche to be of interest to enough people for it to gain a critical mass. I certainly have very little interest in it myself.







  • Oh, this seems to be specific to the SQL framework you use after looking into it. I thought it was a general rust question about function parameters, sorry. Unfortunately I’m not familiar with that sql framework (or any other, I’m an embedded developer, not a web dev).

    Hope you find someone who knows diesel, and sorry again I couldn’t help you.



  • The drama sucks, agreed. But crates.io is lightyears behind in design, search and features.

    For example: Lib.rs has the first thing I want to know (when was the last release, is this still developed?) right at the top. For crates.io that is hidden near the bottom, especially on mobile.

    Also: Lib.rs has search that actually works and finds relevant things, I cannot say that for crates.io.

    I would love for crates.io to take (some) inspiration from lib.rs.

    Finally: I share the lib.rs author’s opinion on cryptocurrency, though I don’t agree with his extreme measures. (If it was me I would put a note in neutral tone that crypto is problematic for the environment on the relevant categories and crates, with some links to more into, then leave it at that.) So using lib.rs despite the drama doesn’t bother me that much.






  • Be sure to treat state and configuration separately. It doesn’t matter on Windows as far as I know (they go in the same location), but on Linux those are supposed to go in different places.

    Many programs get this wrong, and it is quite annoying as I track my config files in git. I don’t want a diff just because the list of recently opened files changed! Or even worse: the program stores the last window size and position in the config file… (looking at you KDE!)

    Here are some libraries I found to help with this in a cross platform way:

    I haven’t tried either, haven’t written such a program yet.

    As for how to store data, there are indeed many options, depending on your needs:

    • Plain text based formats (toml, yaml, JSON, ini, …) can be good for configs and basic state. As a bonus it let’s the user easily manage the file in version control if they are so inclined.
    • Databases (SQLite mostly)
    • Custom formats (binary files in a directory structure is often used for browser caches for example) .

    Without knowing more it is hard to give specific advise.