• 0 posts
  • 19 comments
Joined 1 year ago
Cake day: July 10th, 2025
  • If you are looking to learn a lower level language that c# and arent interested in rust I really recomend Zig. It feels a lot like c but with modern convenieces and with the footguns removed. It is still in development though do breaking changes happen in the stdlib on version changes.

  • And those people who think LLMs will replace software engineers any time in the near future are wrong. But it can still be the case that LLMs are democratizing coding ability to those who otherwise wouldnt have it while at the same software engineering as a discipline isnt going anywhere.

    Its not just basic scripting either, often when people start coding in earnest their programs are just a huge pile of statements connected together with if statements and mutating global variables. and LLM can help show best practices like encapsulating logic into functions and isolating side effects.

  • I think you are vastly overestimating the level that statement is pitched at. The overwhelming majority of people dont even know how a for loop works. However they can ask an LLM to write a script to change this list of files with inconsistent numbering conventions and put them in a consistent order. That’s the level of spreading out the ability to program that we are dealing with.

  • I’m not an expert on licences by any means, but my understanding was that LGPL explicitly allows you to link it to other binaries without needing to licence them with the same licence. Does rust really only support static linking and not dynamic?

    Per the Gnu wiki:

    Does the LGPL have different requirements for statically vs dynamically linked modules with a covered work? (#LGPLStaticVsDynamic)

    For the purpose of complying with the LGPL (any extant version: v2, v2.1 or v3):

       (1) If you statically link against an LGPLed library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.  
    
       (2) If you dynamically link against an LGPLed library already present on the user's computer, you need not convey the library's source. On the other hand, if you yourself convey the executable LGPLed library along with your application, whether linked with statically or dynamically, you must also convey the library's sources, in one of the ways for which the LGPL provides.  
    

    So as long as you also provide your application with an LGPL library shaped hole you can release a static-linked binary with LGPL components.

  • No you spouted some stuff about “trust me I’ve seen it” (almost certainly relating to using single floats) then an irrelevant tangent about how ten doesnt divde cleanly into three and how thats a problem for floats, when you have exactly the same problem with fixed point/integer division.

    Do you have an actual example of where double precission floats would cause an issue? Preferably an example that could be run to demonstrate it.

  • I fail to see a difference there, 10.0/3 = 3.33333333333 which you round down to 3.33 (or whatever fraction of a cent you are using) as you say for all accounts then have to deal with the leftovers, if you are using a fixed decimal as the article sugests you get the same issue, if you are using integer fractions of a cent, say milicents you get 1000000/3 = 333333 which gives you the exact same rounding error.

    This isnt a problem with the representation of numbers its trying to split a quantity into unequal parts using division. (And it should be noted the double is giving the most accurate representation of 10/3 dollars here, and so would be most accurate if this operation was in the middle of a series of calcuations rather than about to be immediately moving money).

    As I said before, doubles probably arent the best way to handle money if you are dealing with high volumes of or complex transactions, but they are not the waiting disaster that single floats are and using a double representation then converting to whole cents when you need to actually move real money (like a sale) is fine.

  • You are underestimating how precice doubles are. Summing up one million doubles randomly selected from 0 to one trillion only gives a cumulative rounding error of ~60, that coud be one million transactions with 0-one billion dollars with 0.1 cent resolution and ending up off by a total of 6 cents. Actually it would be better than that as you could scale it to something like thousands or millions of dollars to keep you number ranger closer to 1.

    Sure if you are doing very high volumes you probably dont want to do it, but for a lot of simple cases doubles are completely fine.

    Edit: yeah using the same million random numbers but dividing them all by 1000 before summing (so working in kilodollars rather than dollars) gave perfect accuracy, no rounding errors at all after one million 1e-3 to 1e9 double additions.

  • Single floats sure, but doubles give plenty of accuracy unless you absolutely need zero error.

    For example geting 1000 random 12 digit ints, multiplying them by 1e9 as floats, doing pairwise differences between them and summing the answers and dividing by 1e9 to get back to the ints gives a cumulative error of 1 in 10^16. assuming your original value was in dollars thats roughly 0.001cent in a billion dollar total error. That’s going deliberately out of the way to make transactions as perverse as possible.

  • Russia has an “official” central bank interest rate of 20% with parts of the real economy seizing up due to the country’s resources being funneled into creating vehicles that last for a few months before being blown up in their invasion.

    Large countries have a lot of levers they can pull to keep their economies going when they really need to, but they are damaging in the long run and get more damaging the longer they rely on them. Russia doesnt have some magical property of being extra resilient based on slavic tolerance of suffering.