• 6 Posts
  • 421 Comments
Joined 1 year ago
cake
Cake day: June 20th, 2023

help-circle
  • solrize@lemmy.worldtoProgramming@programming.devSafe C++
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    17 hours ago

    Dependent types only make sense in the context of static typing, i.e. compile time. In a dependently typed language, if you have a term with type {1,2,3,4,5,6,7} and the program typechecks at compile time, you are guaranteed that there is no execution path through which that term takes on a value outside that set. You may need to supply a complicated proof to help the compiler.

    In Ada you can define an integer type of range 1…7 and it is no big deal. There is no static guarantee like dependent types would give you. Instead, the runtime throws an exception if an out-of-range number gets sent there. It’s simply a matter of the compiler generating extra code to do these checks.

    There is a separate Ada-related tool called SPARK that can let you statically guarantee that the value stays in range. The verification method doesn’t involve dependent types and you’d use the tool somewhat differently, but the end result is similar.


  • In Ada? No dependent types, you just declare how to handle overflow, like declaring int16 vs int32 or similar. Dependent types means something entirely different and they are checked at compile time. SPARK uses something more like Hoare logic. Regular Ada uses runtime checks.


  • Nobody intentionally creates vulnerabilities, but more complicated software is more error prone and therefore more likely to be vulnerable. Fast release cycles also get in the way of good testing. The most complicated piece of software on most phones is the web browser, and its complexity is imposed by the web and its advertisements, rather than by what the user wants or needs.

    IOS and Android face pretty much the same issues on the OS developer and phone manufacturer sides. Therefore, the IOS and Android worlds could both clean up their acts in about the same way if the incentives were right. That they don’t do so might be a bad situation that we have to cope with, but we shouldn’t pretend that it is a good situation.

    I wonder what apps require IOS 16 in some meaningful way. I know there is a situation with Android apps requiring OS upgrades unnecessarily.

    Why do companies like McDonalds want you to run an app anyway, instead of e.g. using a web page? There are a few sites or products where I currently give up the equivalent of a french-fry discount rather than run their stupid app. It’s just a minor annoyance so far, but it doesn’t make sense to me. Do those apps usuallly keep running the background so they can track you, or what?


  • Those security vulnerabililties are because of buggy old software, and updating the software in the old devices does as good a job of fixing the vulnerabilities as selling you a new device does. A significant e-waste tax on every new device, accompanied by credits for keeping old devices working, might help with that. Anyway, if it’s an app (rather than OS) vulnerability and you can’t fix it with an update because the new version of the app requires a new OS, that’s mostly likely an app that you don’t need to use. I’m getting by ok with F-droid apps instead of Play Store apps, for example.

    Best still would be to debug the software before shipping it, so it wouldn’t have those vulnerabilities in the first place. There are various forces that get in the way of that, but a significant one is that web development is now driven by delivering more advertising rather than useful information to the user.





  • In Ada, the overflow behaviour is determined by the type signature. You can also sometimes use SPARK to statically guarantee the absence of overflow in a program. In Rust, as I understand it, you can control the overflow behaviour of a particular arithmetic operation by wrapping a function or macro call around it, but that is ugly and too easy to omit.

    For ordinary integers, an arithmetic overflow is similar to an OOB array reference and should be trapped, though you might sometimes choose to disable the trap for better performance, similar to how you might disable an array subscript OOB check. Wraparound for ordinary integers is simply incorrect. You might want it for modular arithmetic and that is fine, but in Ada you get that by specifying it in the type declaration. Also in Ada, you can specify the min and max bounds, or the modulus in the case of modular arithmetic. For example, you could have a “day of week as integer” ranging from 1 to 7, that traps on overflow.

    GNAT imho made an error of judgment by disabling the overflow check by default, but at least you can turn it back on.

    The RISC-V architecture designers made a harder to fix error by making everything wraparound, with no flags or traps to catch unintentional overflow, so you have to generate extra code for every arithmetic op.



  • I think if your photos are on any kind of public website, AI idiots will scrape them regardless of the provider. So at minimum you have to password protect them. That said, I’d feel ok using this:

    https://www.hetzner.com/storage/storage-share/

    It basically runs NextCloud. You’d configure it so that only logged-in users can view the pictures, and give accounts to your friends and family. I don’t think Hetzner is likely to train AI with it, though you could check through their privacy policy. Part of the issue with eg. Google Drive is that everyone wants stuff for free, so Google recovers some of its costs by advertising, AI training, etc. Hetzner charges enough to actually make a profit, while still being IMHO affordable at the level we’re discussing. That means they don’t have to do crap with advertising etc. I have 5TB in their Storage Box product and am happy with it.

    If you want to be more hardcore, you could set up a dedicated server with an encrypted HDD, but now you have to deal with the hassles of self hosting, including backups. It still wouldn’t be end to end encryption, which would require your users to run some kind of special client, or maybe use some awful javascript client.



  • It would help if you gave some numbers. How much data, within a factor of 1000 say? A few megabytes? A few gigabytes? A few terabytes? A few petabytes? The approach you need will change depending on the level. What is your budget?

    What bothers you about cloud storage? Are any of the photos edgy?

    Anyway it sounds to me like you would be fine with a decent web hosting plan and a basic photo gallery app.




  • Chess has always been overwhelmingly male. In the old days there were separate men’s tournaments and women’s tournaments. That changed in the 1980s when Susan Polgar was by far the strongest female player in Hungary. She didn’t have any serious opposition in women’s tournaments there, and wasn’t allowed to enter men’s tournaments, so she started a big fight. The result was that men’s tournaments were abolished and they are now “open” tournaments that anyone can play in, though they are still overwhelmingly male. Women’s events exist basically so that female players don’t have to endure the gauntlet of a socially inept nerd sausage fest in order to play chess.

    For a while there was also something called “centaur” tournaments, where a centaur was a human player assisted by a computer. The idea was that the computer could outcalculate humans, but humans still had better strategic judgment, so a human-computer team could outperform either member individually. After a while though, computers became strong enough that human interference just made them play worse. The current strongest chess tournament in the world is called TCEC (Top Chess Engine Championship, tcec-chess.com) and it is always running, 24/7/365 unless something happens. Some really incredible games have come out of it.



  • Ding Liren is the current human “open” world champion, but there is also a women’s world championship, currently held by Ju Wenjun. Plus there is a world junior championship, world rapid championship, world blitz, etc. Magnus is probably still the world’s best human player, but he decided to drop out of the WC cycle because he got tired of winning it so often, basically.

    The strongest chessplaying entities in the world are entirely machines, which have surpassed humans by enormous and uncrossable margins. The top engine for the past few years has been whatever the latest version of Stockfish is. The top human players spend enormous amounts of time studying machine analysis of various openings and game positions.


  • You’re broadcasting to family who will likely be using gmail, so what difference does it make? Google will get all the emails either way. Anyway, logical argumentation is completely useless in a personal situation like that.

    If you want the address to be stable in the long term, you should probably use your own domain name instead of gmail or proton, if you’re not already doing that. After that, it’s possible to switch the hosting without changing the email address.



  • solrize@lemmy.worldtomemes@lemmy.worldYarr
    link
    fedilink
    arrow-up
    86
    ·
    7 days ago

    I looked him up and he is English. Weren’t English sailors called Limeys because of the lime juice in their rations, specifically for scurvy prevention? He should have signed up with the Admiralty instead of the pirates.