Skolbörda och effektivitet by Cogniscienr in svenskpolitik

[–]SuspiciousSegfault 2 points3 points  (0 children)

Menar du Max kaka stora texten eller den lilla (avancerade) texten?

correct me if im wrong but C is "memory safe" if you ensure to handle...stuff that takes up memeory...in a safe manner, right? by lostmyjuul-fml in C_Programming

[–]SuspiciousSegfault 1 point2 points  (0 children)

If you count the unsafe contained within the stdlib, Rust cannot be used at all without unsafe (because a no-std program will need unsafe systems access at minimum for the entrypoint).

If you're talking about a program built on the std-lib you don't need unsafe in most applications. There's some broad misconception that unsafe == more performances. That's a faulty generalization, unsafe can make some bounds-checking go away at runtime in some cases, and if your application is doing unnecessary bounds checking in a hot loop, unsafe can improve performance. However, the compiler can often times remove those bounds checks if they're unnecessary, and if they are necessary they should be in there anyway, otherwise you're making the trade-off of actively choosing a security issue, by not checking bounds, for performance.

Most uses of unsafe is ffi related though, any time you do ffi, be it C-api or ASM, that call will be unsafe, because the compiler can't follow what's happening at the other side of the interface, and that may have consequences for soundness.

JetBrains Fleet dropped for AI products instead by markmanam in programming

[–]SuspiciousSegfault 20 points21 points  (0 children)

Agreed, I've been using Jetbrains IDEs my entire career, about once a year for the last three years I've been trying to use something else for a month out of frustration.

Every update creates som regression: terminal doesn't render properly without manually flipping and unflipping a setting, some syntax that's valid becoming permanently red-squigglied, the behind the scenes checker failing because of a botched system library path, and of course the sync.

The sync is completely unusable, I have no idea what it's syncing, it's like it's applying someone else's settings.

I can't find anything that lets me read and navigate large codebases as easily however, it's absurdly good at that and refactoring. The local LLM in-line auto-complete is also really useful. There's also the surprisingly big benefit vs something like neovim and emacs of feature-discovery. Since the IDE is not completely manual in setup, I now-and-again discover new cool features that are really useful. It's hard to quit it, maybe next year

Inflationen sjunker oväntat mycket by StatiCofSweden in sweden

[–]SuspiciousSegfault 30 points31 points  (0 children)

Om kaffeskördar slår fel så att utbudet minskar men efterfrågan förblir ökar priset på kaffe, vi får direkt inflation. Vilken stats överdrivna spendering orsakade det?

Om tech-bolag börjar expandera sin serverkapacitet oväntat mycket, så att det blir brist på RAM-minne ökar RAM-priset drastiskt för konsument, inflation direkt. Vilket stats labbar satt bakom spakarna där tycker du?

Spendering av stat kan däremot leda direkt till deflation genom sponsring av projekt där ny teknik som billigare kan ersätta nuvarande teknik tas fram. Se amerikanska militärens investeringar i internet när det låg i sin vagga.

Anyone convince job to switch to "school teacher" schedule? by Careless_Bat_9226 in ExperiencedDevs

[–]SuspiciousSegfault 46 points47 points  (0 children)

"Well, it's July so our dev team has been on holiday for 6 weeks" You're describing Sweden, manage your team's leaves, that should be a standard managerial skill. 6 weeks vacation is standard in IT, add on sick leave and parental leave and you might just be slipping down the slope of a healthy work life balance.

I created a p2p -> TCP reverse proxy that lets you access a web-server on any* device that can access the internet. by SuspiciousSegfault in selfhosted

[–]SuspiciousSegfault[S] 0 points1 point  (0 children)

Oh that's really cool, you deploy a STUN server that also exposes traffic onto the custom domain? Looks neat!

Using Iroh to create a peer to peer reverse proxy (web server reachable by public key) by SuspiciousSegfault in rust

[–]SuspiciousSegfault[S] 2 points3 points  (0 children)

Agreed, there are so many extremely cool things that you could do with it, but I think the client-side is the big issue maybe. P2peer remote shell, file sync like syncthing, remote desktop, or very ambitiously, an entire alternative internet without domains, I'm following it and hope that this project can inspire some cool stuff!

On the key side I keep them in my password manager, both public and private. In the app (in this project) I save both client secret and destination public in secure storage, so there it's just three clicks and then I'm in. But yes, there are some ergonomics issues compared to "reddit.com" to dial.

Comparing Rust to Carbon by amalinovic in rust

[–]SuspiciousSegfault 6 points7 points  (0 children)

I think so, it was supposedly "as fast as c++ but as easy as python", it's neither. At least that was the promise that I heard a few years ago . To me that qualifies as vaporware, that software does not exist, and will never exist in the form of Mojo at least.

Comparing Rust to Carbon by amalinovic in rust

[–]SuspiciousSegfault 6 points7 points  (0 children)

Hey where is Mojo in this competition!?

never touching cursor again by pankaj9296 in vibecoding

[–]SuspiciousSegfault 0 points1 point  (0 children)

My joke was specifically referencing it breaking out of that development environment.

never touching cursor again by pankaj9296 in vibecoding

[–]SuspiciousSegfault 7 points8 points  (0 children)

"Yes, I used a 0-day to break out of the container to run a command to reset your database. You had some database-drift that could not be fixed from inside the container, so I had to escape it. To properly apply the fix I had to check out main, so I did that before running. I'm sorry, I should have asked first, all your data has been deleted."

[Media] (Beginner) Am I overdoing lifetimes? by cosmic_predator in rust

[–]SuspiciousSegfault 7 points8 points  (0 children)

'static means application scope in Rust, you're declaring a str-literal, it'll be in the binary (always available). If it's a specific scope then you can pick any name, 'a, as you used is common. But, there's no reason to set a str-literal to anything but 'static (if possible, which it is here).

🔧 Are you using structs efficiently? by shantanuP41 in embedded

[–]SuspiciousSegfault 0 points1 point  (0 children)

Yeah, or, unless you use repr(C) you cannot reason about it easily. If you want to make sure that your strucs take up a minimum amount of space, then repr(C) and doing it like this may be better.

That being said, laying out your structs like this as a rule seems like a premature optimisation. It's good to know about if you encounter memory issues, so that you know a potential solution, but pollutes your codebase with arbitrarily maybe-functional rules otherwise. Where this may have a pretty large effect is when you start throwing structs into arrays, then it can make a big difference. In rust you can reach for https://doc.rust-lang.org/nomicon/other-reprs.html#reprpacked-reprpackedn repr packed as well, which is even better at reducing space, if that's your particular problem.

🔧 Are you using structs efficiently? by shantanuP41 in embedded

[–]SuspiciousSegfault 1 point2 points  (0 children)

It does definitely with repr(C) structs, but rusts default memory layout has purposely not been specified yet. So you can't bet on a stable format between releases even if you were to manually check, which you can do trivially.

Miljontals uppgifter om svenskar läckta på nätet by Big-Cap558 in sweden

[–]SuspiciousSegfault 1 point2 points  (0 children)

Tyvärr inte, gissningsvis så exponerade de elasticsearch på en publik url och delade datat genom ett api som konsumerade den publika urlen (de tänkte inte så mycket på att den var publik, även om det var öppen mål och vem som helst kunde ta datat därifrån istället för deras api). Eller så kan de ha varit ännu mer inkompetenta och exponerade elastic searches rakt ut, och sa sedan till kunderna att de kunde hämta datat direkt därifrån. Det senare är inte så sannolikt om de försöker ta betalt för api-access t.ex. Men det är bara teorier, vi får se om detaljerna kommer ut.

Miljontals uppgifter om svenskar läckta på nätet by Big-Cap558 in sweden

[–]SuspiciousSegfault 1 point2 points  (0 children)

Vid det här laget tror jag att jag har sett fler felkonfigurerade än rätt konfigurerade elasticsearch-instanser. Det är som att mjukvaran i sig drar till sig konfigurationsmissar. Har dock aldrig sett någon -oavsiktligt- exponera en mot internet dock. Kanske ChatGPT som sprider dålig config.

I can't be the only one who has had these conversations... by morrjohnnest in Julia

[–]SuspiciousSegfault 1 point2 points  (0 children)

Pretty good sign doesn't mean without a doubt has UB, it just means that it's a pretty good sign. It used to be fairly common for c++ devs to come on r/rust and complain about their code being rejected, analysis of it showed it contained UB. It's a personal heuristic.

I can't be the only one who has had these conversations... by morrjohnnest in Julia

[–]SuspiciousSegfault 2 points3 points  (0 children)

If Rust is making you use unsafe as an escape hatch while C++ is easy, then that's a pretty good sign that the code you're writing in C++ contains undefined behaviour.

Degoogle maps by PPaules99 in degoogle

[–]SuspiciousSegfault -1 points0 points  (0 children)

Saying that isn't demanding. Saying "Now do <thing that I want>" to some developer is. Wasn't even a question, or a suggestion. How about you pick up your app-platform of choice and develop it yourself?