

Then just install it? I don’t see what’s the issue here.


Then just install it? I don’t see what’s the issue here.


I don’t care about 10KB or even 100KB of disk space per installed program if it saves humanity the collective millions of hours wasted on .dll/.so issues.
If your program needs libcirnfucb to run, it should be in the same directory as your program, and you are responsible for putting it there for me. No other program in my computer needs libcirnfucb, there’s no efficiency gains and now I have to go to some random website from the 90s and find where they put the damn download link and now I have to learn all about how libcirnfucb manages their versions and if I am in the correct webpage, because the project is abandonware that was formed 10 years ago and now it is in another 90s looking website that has a name completely unrelated to libcirnfucb.


In my case, I don’t usually encounter cases where I can’t just ?. But when I do, just make an error enum (kinda like thiserror) that encapsulates the possible errors + possibly adds more.
On the call site, just convert to string if I don’t care about specifics (anyhow-style).
I don’t find this much painful.
Concise: not much on the declaration side, since you have to create an entire enum for each function in worst-case scenario. But on code side, it’s just .map_err(MyError)?.
Type-safe: can’t beat errors as enum values wrapped in Result.
Composable: i don’t think you can beat rust enums in composability.
I don’t use anyhow/thiserror, so I’m not sure. But I believe thiserror fixes the conciseness issue for this.


Every day I have to open a VM as I turn on the computer. I could go find and open Virtual box, then select the VM and open it. Why would I do that when I can open the terminal and run a script that does that in a single action. Then I have to SSH into that machine that always has the same IP. Why should I have to type the IP every time?
Scripts are good when used correctly. I don’t need to know what vboxmanage to run to do whatever I want, I just needed to search it once and remove it from my brain.
Kinda unrelated but:
I don’t think you should know how to do everything from the git CLI. For 99% of use cases, the IDE already knows how to do what you want to do, with a simple button. For the rest, just search for the git command when you need it.


I don’t think an aesthetics opinion counts as a technical hill to die on.


Thank you. Didn’t know of any non-IP network stack. Got something new to research while commuting.


In my team we manage 2 software components. 1 of them (A) has 2 devs, the other (B) approximately 5.
Every time a feature needs to be added, B complains that it’s going to take forever, while A is done in a fraction of the time.
The difference? B is a clusterfuck of a codebase that they have no time to refactor because they run low on time to implement the features.
I work in A, but I’m not going to steal the credit, when I entered the company, A already had a much cleaner codebase. It’s not that me and my partner are 10x better than the ones working in B, they just have uglier code to deal with.
I can’t comprehend why management doesn’t see the reason A needs half the devs to do the job faster.


“installing a library” should not exist as a concept. A library is either so essential that the OS needs it (and therefore it is already installed), or is not essential enough that each program can have its own copy of the library.
“But I want all my 3 programs that use this random library to be updated at the same time in case a security flaw is found in it!” Is no excuse for the millions of hours wasted looking for missing dependencies or dependencies not available for your system. If that library does have a security vulnerability your package manager should just find your 3 programs that use it and update their copy of the library.


“not having mandatory parenthesis in if statements is hazardous, so I prefer to write C instead of rust, because I really care about safety” < that’s how you sound.


Rust allows you to choose whatever method you want.
There are only 2 error handling methods that you cannot do:
And that is because both of them are bad because they allow you to do the second one, when .unwrap is just there and better.
If your concept of “not ugly” is “I just want to see the happy path” then you either write bad code that is “not ugly” or write good code that is “ugly”. Because there is no language that allows you to handle errors while not having error handling code near where the errors are produced.


Most of the times you can just let ... else (which is basically a custom ? if you need if let ... else it’s because you actually need 2 branching code paths. In any other language you also do if ... else when you have 2 different code branches. I don’t see why this is a rust-specific issue.


I’d say it’s much more influential the names of the identifiers of the standard library.
A language with function keyword that names it’s stdlib functions strstr and strtok will inspire way worse naming than on that has fn keyword with stdlib functions str::contains and str::split.
We could search for a random crate on crates.io and see what identifiers people actually use, or we could spread misinformation on Lemmy.


You used macro_rules, which is not common at all. Most rust files don’t contain any macro definition.
This code doesn’t even compile. There is a random function definition, and then there are loose statements not inside any code block.
The loop is also annotated, which is not common at all, and when loops are annotated it’s a blessing for readability. Additionally, the loop (+annotation) is indented for some reason.
And the loop doesn’t contain any codeblock. Just an opening bracket.
Also, the function definition contains a lifetime annotation. While they are not uncommon, I wouldn’t say the average rust function contains them. Of course their frequency changes a lot depending on context, but in my experience most functions I write/read don’t have lifetime annotations at all.
Yes, what you wrote somewhat resembles rust. But it is in no way average rust code.


Not to be confused with glibc. Where the g does actually stand for gnu.
But they can’t say “I’m going to rewrite this in that other language” because that’s the thing they hate about rust, so if they said that it would be too obvious that they’re full of shit.
Any body could just go to down detector. And of course effectively check the status of cloud flare based on if downdetector shows this page themselves.
This can also be a side product for code blocks being expressions instead of statements.
In rust for example they are, so it’s not rare to see functions like:
fn add_one(x: i32) -> i32 {
x+1
}
This lets you do amazing things like:
let x = if y < 0.0 {
0.0
} else {
y
}
which is the same as
x = y < 0.0 ? 0.0 : y
But is much better for more complex logic. So you can forget about chaining 3-4 ternary operations in a single line.
I’ve got all that. I just needed to convert a string of characters into a list of glyph IDs.
For context, I’m doing a code editor.
I don’t use harfbuzz for shaping or whatever, since I planned on rendering single lines of mono spaced text. I can do everything except string->glyphs conversion.
Just trying to implement basic features such as ligatures is incredibly hard, since there’s almost no documentation. Therefore you can’t make assumptions that are necessary to take shortcuts and make optimizations. I don’t know if harfbuzz uses a source of documentation that I haven’t been able to find, or maybe they are just way smarter than me, or if fonts are made in a way that they work with harfbuzz instead of the other way around.
As someone trying to have as little dependencies as possible, it is a struggle. But at the same time, harfbuzz saved me soo much time.
EDIT: I don’t do my own glyph rasterization, but that’s because I haven’t gotten to it yet, so I do use a library. I don’t know if it’s going to be harder than string->glyphs, but I doubt so.
I cannot comprehend what the fuck harfbuzz does.
I tried to implement my own because “I don’t need all the features, I’m gonna render self-to-right western text with very few font features”. But holly fuck, the font format documentation is barely non-existent. And when I tried my naive solution it was like 10000x (or more) slower than harfbuzz.
Not by the user. By the OS.