nous

joined 1 year ago
[–] nous 26 points 10 hours ago

When I change devices or hit file size limits, I’ll compress and send things to my NAS.

Whaaatt!?!!? That sounds like you don't use git? You should use git. It is a requirement for basically any job and there is no reason to not use it on every project. Then you can keep your projects on a server somewhere, on your NAS if you want else something like github/gitlab/bitbucket etc. That way it does not really matter about your local projects, only what is on the remote and with decent backups of that you don't need to constantly archive things from your local machine.

[–] nous 75 points 2 days ago

Did you read the article at all?

“Putting all new code aside, fortunately, neither this document nor the U.S. government is calling for an immediate migration from C/C++ to Rust — as but one example,” he said. “CISA’s Secure by Design document recognizes that software maintainers simply cannot migrate their code bases en masse like that.”

Companies have until January 1, 2026, to create memory safety roadmaps.

All they are asking for by that date is a roadmap for dealing with memory safety issues, not rewrite everything.

[–] nous 12 points 3 days ago

Sounds like you just need to keep the data on your server and use samba or NFS and a network mount on the other devices.

[–] nous 3 points 4 days ago* (last edited 4 days ago)

“What should I make?”, or “What do I need to make?”.

These are very open ended questions which make it hard to narrow things down to one project and generally I don't find them a good question to ask. Instead of looking for something to make for the sake of needing to make something try to find a problem you have that you can solve by making something. All the best projects are solving some problem some one has had and it is a much narrower question to ask. You can narrow it down further by looking at each of your hobbies/interests/things you need to do one by one.

If you want to be more systematic about it go through each area of interest and write down every issue or problem you can think of. Big or small, easy to hard to solve (with or without a programmable solution) - anything and everything. Just get them down on bit of paper or document. You can expand on it over time as well when you think of something or encounter an issue for the first time. Then once you have a few things you can consider them in more detail. Think about how you might solve things, and slowly filter things out to one that most interest/bug you and that you could solve with a program in some way.

That should give you specific things to think about and ponder over which can be very helpful for leading to an actual project idea.

And honestly these days I have far more project idea that I could start then I have time to start. But they all start with a problem I encounter. I tend to need to think through an idea I have for a bit then write it down and shelve it for the future so it does not distract me from the current things I have on the go. Or if something is more important/interesting than a current project it can replace something else I have on the go (which you need to be careful of that you don't keep jumping to new things and never finishing things you have already started).

[–] nous 3 points 6 days ago (1 children)

What? You can easily escape from it if there are better alternatives you can use. Pointing at one language and saying it is not easy to code like it is another language is a pointless argument. You can do that about any two languages. They all differ for good reasons and as long as you can solve similar problems in both, even if in different ways then what does it matter that you cannot do it in the same way?

[–] nous 5 points 6 days ago* (last edited 5 days ago)

You could do a lot of things. Rust had a gc and it was removed so they have already explored this area and are very unlikely to do so again unless there is a big need for it that libraries cannot solve. Which I have not seen anyone that actually uses the language a lot see the need for.

Not like how async was talked about - that required a lot if discussion and tests in libraries before it was added to the language. GC does not have anywhere near as many people pushing for it, the only noise I see is people on the outside thinking it would be nice with no details on how it might work in the language.

[–] nous 6 points 6 days ago (2 children)

So someone that is not involved in rust at all and does not seem to like the language thinks it will get a GC at some point? That is not a very credible source for such a statement. Rust is very unlikely to see an official GC anytime soon if ever. There are zero signs it will ever get one. There was a lot of serious talk about it before 1.0 days - but never made it into the language. Similar to green threads which was a feature of the language pre 1.0 days but dropped before the 1.0 release. Rust really wants to have a no required runtime and leans heavy on the zero-cost abstractions for things. Which a GC would impose on the language.

[–] nous 4 points 6 days ago

There are quite a few places where a GC is just not acceptable. Anything that requires precise timing for one. This includes kernel development, a lot of embedded systems, gaming, high frequency trading and even latency critical web servers. Though you are right that a lot of places a GC is fine to have. But IMO rust adds more than just fast and safe code without a GC - lots of people come to the language for those but stay for the rest of the features it has to offer.

IMO a big one is the enum support it has and how they can hold values. This opens up a lot of patterns that are just nice to use and one of the biggest things I miss when using other languages. Built with that are Options and Results which are amazing for representing missing values and errors (which is nicer than coding with exceptions IMO). And generally they whole type system leads you towards thinking about the state things can be in and accounting for those states which tends to make it easier to write software with fewer issues in production.

[–] nous 4 points 6 days ago* (last edited 6 days ago) (3 children)

but imagine if you have to perform this operation for an unknown amount of runtime values

This is a poor argument. You dont write code like this in rust. If you can find a situation where it is an actual issue we can discuss things but to just say imagine this is a problem when it very likely is not a problem that can be solved in a better way at all let alone a common one is a very poor argument.

Typically when you want an escape from lifetimes that means you want shared ownership of data which you can do with an Arc. Cow and LazyLock can also help in situations - but to dismiss all these for some imagined problem is a waste of time. Comes up with a concrete example where it would help. Very likely you would find another way to solve the problem in any realistic situation you can come up with that I would suspect leads to a better overall design for a rust program.

I would say this is just a straw man argument - but you have not even created a straw man to begin with, just assume that one exists.

[–] nous 3 points 1 week ago (1 children)

For someone only on chapter 7, this is ok. I would not call it idiomatic but you have not gotten to the Error Handling in chapter 9 yet. I would probably hold on getting feedback on error handling until you have gotten to that point.

But the TLDR of it is rust has two forms of errors, unrecoverable errors in the form of panic and recoverable ones in the form of returning a Result. In this case you have opted for panicking which IMO is the wrong choice for something that is expected to fail - and http requests and parsing external data is expected to fail (even if only some of the time). Networks fail all the time, servers go down, send back wrong responses and many other things.

Do you really want to crash your program every time that happens? Probably not - at least not at this level. Instead you likely want to return an error from this function and let the caller deal with it instead as they will likely have more context as to what to do with it rather than in the leaf functions of where the error originates.


But all that is probably for once you have read through chapter 9. For now it is good to know that when you have the pattern

match foo {
    Ok(value) => value,
    Err(err) => panic!("it broke! {}", err),
}

You can generally replace that with a call to expect instead:

foo.expect("it broke")

Or just unwrap it if you dont need to add more context for what ever reason.

[–] nous 4 points 1 week ago (2 children)

It doesn’t technically have drivers at all or go missing. All supporting kernel modules for hardware are always present at the configuration level.

This isn't true? The Linux kernel has a lot of drivers in the kernel source tree. But not all of them. Notably NVIDIA drivers have not been included before. And even for the included drivers they may or may not be compiled into the kernel. They can and generally are compiled with the kernel but as separate libraries that are loaded at runtime. These days few drivers are compiled in and most are dynamically loaded depending on what hardware is present on the system. Distros can opt to split these drives up into different packages that you may or may not have installed - which is common for less common hardware.

Though with the way most distros ship drivers they don't tend to spontaneously stop working. Well, with the exception of Arch Linux which deletes the old kernel and modules during an upgrade which means the current running kernel cannot find its drivers and stops dynamically loading them - which often results in hotplug devices like USB to stop working if you try to plug them in again after the drivers get unloaded (and need a reboot to fix as that boots into the latest kernel that has its drivers present).

[–] nous 5 points 1 week ago

Or refactored at a later date.

view more: next ›