2,091 karma · joined March 10, 2021
The ones provided by the compilers are simply the libc ones.
LLVM will even go as far as detect attempts to rewrite memcpy and replace them with a call to the libc one!
Moreover the 26% is with mimalloc, with musl's allocator it's 144%, so there are likely other parts that are slower (likely the memcpy implementation)
This has always been the case. The RAM effects only changed at which point the O(n) stops being faster than the O(log n) solution.
Part of the issue is that this was never low-level stuff. When you're selecting between the two you're making a semantic choice, and that's not something a compiler can do for you.
Also, why do you need a proxy for the number of people when you can just count them? In Europe a service charge is relatively common and it's a per-person fixed charge.
This is not entirely correct (or at least it's worded a bit weirdly).
If you know that A goes in a certain place you can still try a word using A more than once. It's only once you know that A does not appear twice (because you tried a word containing A twice, and the second A way gray!) then you can no longer use A twice.
In your case you tried MAMMA which contained 2 As and the second one gave you the information that there's no second A.
FYI in some places flat taxes are technically unconstitutional
To be fair:
- 3% is on the higher end of the fees amounts. In the EU they are now capped at 0.3% for example
- part of the interchange fee goes to the issuing bank, which is usually local
The Fil-C side could change the data behind the pointer, which will not reflect on the Rust side due to the copy. Even if you manage to copy back the changes, Fil-C could also persist those pointers in e.g. global memory: at that point you no longer know when it's safe to copy back (or forward) any change.
The only way I can see this work if you cannot pass any Rust-land pointers into Fil-C, but at that point you could also compile the C code to WASM and use the WASM FFI (which has similar restrictions)
People are remarkably resilient in general. But if chinese workers manage to survive a 996 does that make it good?
That's not how it generally works in most businesses.
Likewise "harness" can be used to mean "to collect and control something so that it can be used effectively".
It _is_ imprecision. Even if you cannot represent 0.3 exactly, you can consider the closest representable number, and that is different than the sum of the closest numbers to 0.1 and 0.2 because doing all of this introduced imprecision.
As always this could be avoided with some extra complexity, but that require lot of work and testing that hasn't been done.
So for now this is useful only in crates that have a lot of unused functions, so even if one function is codegenned multiple times you still save time overall.
Rustc already does something like this. The issues are:
- when you have to rehash everything to check that they indeed didn't change from the previous compilation. For big projects this takes _a lot_ of time.
- when small changes do indeed change the hash of a lot of seemingly unrelated code, which is more common than you might think.
From what I see in Haskell files are the unit of compilation, and that's what allows incremental compilation to be file based (because it's really unit-of-compilation based)
I can see you can have circular dependencies between files with the `{-# SOURCE #-}` pragma, but I don't see documentation about how that affects incremental compilation.
A couple of issues I see with doing this in Rust are:
- in Rust the unit of compilaion is a crate, which can contain many fils/modules with circular imports, which is much more coarser than what can be done in Haskell.
- in Rust downstream crates can depend on function bodies upstream for running compile time functions; as such the crate/module interface is not enough to gate recompilation, but at the same time including all function bodies will also not give the wanted benefits. This is solvable but likely requires more work than what was done in Haskell.
In general you cannot take a language approach and blanket applying it to another one without considering their different quirks, which is likely why your proposal didn't get much attention. Or am I missing something that would make it easier to apply Haskell approach here?
I've been on a couple of them (without the bullshit) and people did indeed open up and bonded, but I should note that the conditions for this were positive in the first place (i.e. we weren't trying to invert some negative situation).
I don't see a point in running Rust code in Fil-C. Due to the way Fil-C works it won't be enough to check the `unsafe` statements, so you'll pay the performance tax on safe code too (onto which you already paid the borrow checker tax!)
I'll take the bait then. Here's rust official documentation stating that it doesn't prevent race conditions: https://doc.rust-lang.org/nomicon/races.html
Rust does not prevent race conditions. You're getting confused with data races.
However GC's solution to data races (make every load/store act as very relaxed atomic instructions) makes race conditions much easier to write.