2,917 karma · joined April 21, 2019
In C++ you can write:
template <typename Animal>
void roar(Animal animal) { ... }
and call it like this: roar(airplane); // How do Airplanes roar?
You can try to fix that with an "Animal" concept, but it turns out that if someone adds a roar method to a Vehicle, you can still: roar(truck); // Trucks can roar... but roar expected Animal
In Rust, these things just cannot happen. If you write: fn roar(animal: impl Animal);
then trying to call it with anything that's not an animal will fail to compile.That's a good thing, but maybe somebody did wanted to call roar with a truck, and now you have to invest time into more precisely thinking which types should roar actually take, which types constraints make sense defining, how you categorize types, etc.
In Rust thinking about these things costs time. In C++ it also costs time, usually more than Rust, because you have to go way out of your way to prevent mistakes like the above. In Go you don't have to think about these issues at all because the language does not allow you to do most of this (except for interfaces, but that's another story).
No it cannot. That's anti-trust.
To be clear, the problem here is not that Apps can only be installed via the App Store on Apple devices. That is ok, and not very different form having, e.g., and "Installer" package format in your OS.
The problem here is how Apple is using its App Store to gain an unfair advantage.
Comparing Rust with C here is hard. As others have mentioned, with C, you typically only use libraries that are installed in your system. Rust does not have a global system cache for libraries, and I don't think there is any package manager installing pre-compiled Rust libraries, so at least for the initial compiles, Rust needs to do much more work than C, for Rust dependencies at least. If your Rust project only depends on C libraries, then there is no work to be done of course.
For incremental compiles with C, it is hit or miss. If your C project is properly "modularized" (split into a lot of small enough TUs), then when you change a TU, C only needs to recompile that one TU. In our benchmarks, Rust is faster for that situation, and speculating, this is because the Rust compiler only recompiles the parts of a TU that actually changed.
In practice, however, Rust is much slower than C, because people do not write small Rust TUs, but absurdly huge ones, at least, by C standards. A Rust TU (crate) usually is mapped 1:1 to a C library, which often contains dozens or hundreds of TUs. Just the cost of testing what changed in a Rust crate is often larger than the cost of blindly recompiling the C TU that has a newer timestamp.
If people would split Rust code like they do with C, then this wouldn't happen. But Rust people are too optimistic in that one day the compiler will be able to somehow auto-magically split a crate into multiple TUs as good or even better than what people do for C manually. And do that determination + the incremental compile faster than what takes a C compiler to blindly recompile a tiny amount of code.
I'm not sure they are for sale either (probably for the right price), since they sell these "as a service", which pays better. I also don't think these are on sale for "small" customers.
Which challenges are not showing up there ? There are packages, and they are usable to build other packages.
Debian, Ubuntu, Fedora, Arch, ... all do this.
Also, charitable donations, which includes working for charities for free, as well as voluntary work, are tax deductible for the "tax entity", which if you are married you can choose to be your marriage.
So depending on what your partner does, and likes to do, if you are in a very high paying job, it might make more economic sense for your partner to "work for free" donating their work to a charity.
This essentially would mean that you get 100% of your income, free of taxes.
Example A: your salary 200k, your partner salary 50k. Combined taxes: 250k * 0.45 = 112k. Earnings: 250 - taxes = 138k.
Example B: your salary 200k, your partner exercises a 50k job for a charity for free. Taxes: 200*0.45/2 - 50k = -10k = 0k. Earnings 200k > 138k.
I'm not suggesting that your partner shouldn't work, only mentioning that if you are moving to Germany for a high-paying job, that is just one part of the equation. IANAL, nor a tax advisor, so I'd recommend you explore the options and evaluate the package "as a whole".
For a lot of people, being able to work for a charity for free for a couple of years can be much more rewarding than a 8-5 office job at a FAANG.
If your base system uses Firefox or ripgrep, Rust is already there.
My software that can afford a garbage collector typically doesn't need a high level of safety either. If it fails, I restarted, and if it gets compromised, so be it.
> D's GC isn't a Java or JavaScript or Go GC, it doesn't have overhead-inducing write barriers.
I wouldn't use D for any application. If my application requires high-performance and/or correctness, I'd use Rust or C++.
D buys you memory safety with a garbage collector, but it doesn't buy you thread safety, so from the safety POV, it is not enough. It also isn't free. If you disable it, you can't use most libraries. And if you enable it, you pay for a big runtime. Also the performance that D does buy you comes with the cost of being a language at the same level of complexity of C++.
Rust gets you much better safety than D, no run-time by default and all libraries support this, better meta-programming than D, etc. all at a lower complexity cost than D.
Sure D is better at prototyping than Rust, but Python and many other languages are much better at prototyping than D. If I need to write a prototype, I'll use python. And if I need to make my prototype fast, I'll just write that part in Rust and call it from python. Gives me the best of both worlds.
Picking D would mean picking something that's not bad but not great at anything either.
Do they? Nobody buying this stock thinks Hertz is going to recover.
They think "I'm bored and buying this worthless stock is risky and fun".
That is valuable to some people, and hence why the stock price is up.
Hertz selling more shares to try to save the company is pretty dumb, because that is not what it share holders want.
Hertz new share holders want to see the company and stock burn as much people as possible in the most spectacular way possible. That's what Hertz has become.
These gamblers are irrational. They might double down, or manage to find new gamblers, or sell before this even happens. Nobody knows what will happen, and it doesn't really matter.
The codecs that NVEnc supports are just a few bunch, there is no real-time audio, no nothing.
All of this is implemented in CUDA, using normal CUDA implementations of audio and video codecs, and running on normal GPUs using normal GPU cores. In real time. Supporting thousands of audio and video channels concurrently.
Also, even for NVEnc and NVDec themselves, in some of the GPUs they do not use any specialized hardware and use normal GPU cores instead (e.g. see the older GM20x GPUs).
There are some cloud providers that offer this as a service, allowing you to have the end-points of, e.g., video calls to use different audio and video codecs.
This is quite useful, e.g., when some people join the call only using audio via a cell phone in a different country using a different audio standard (or a land line, etc.). Or when somebody joins the video call from laptop tethering from a phone on a train. Or for switching video codecs depending on whether somebody is sharing their desktop or using a webcam to record their face.
The client can picks the codecs that are the best fit for the current situation (content, bandwidth, latency, etc.) and a could server transcodes the video from everyone else in the meeting to their clients format.
musl works just fine for that
Computer Organization and Design, RISC-V edition, goes into these. R-types have opcode = 0b0110011, SB (branch) types have opcode = 0b1100011, etc.
The lower bits also have extra meanings (16 bit, 48 bit, etc. instruction).
This allows hardware to just branch on these bits in sub-groups. The hardware pipeline for 16 bit is different than that of 48 bit, and the 48-bit is probably even optional.
Compilers are programmed by humans. You are claiming that somehow compilers have learned to produce better assembly than the humans that programmed them.
I am a compiler writer, and know many compiler writers. I have yet to find one that would stand by your claim. When I look at the output of LLVM or GCC, I am ashamed.
I wish I had more time to make LLVM much better, but actually, 99% of my time is spent in fixing bugs filled by users that are neither compiler writers nor assembly programmers, and they too realized how bad the machine code emitted by these tools is.
So sure, a compiler emits better assembly than a human that hasn't learn assembly programming. It also emits better assembly than all humans that do not know how to program.
But no, it does not produce _by far_ better assembly than any programmer that actually cares about machine code enough to just take a look at it and check it.
That's true, and I know you are not claiming this, but MISRA C is neither memory nor thread safe, which is what we are talking about here.
Writing MISRA C code with data-races is trivial, and no "linter" for it finds those.
Not giving any concrete examples is just proving my point.
Which C variations are both thread and memory safe? Which Ada variations are both thread and memory safe ?
AFAIK, such variations do not exists, and people claiming that they do on the internet and then failing to provide a simple link when requested multiple times by others to do so just seems to confirm that.
Which other languages close to C, without a run-time, and without a garbage collector, give you proven memory and thread safety?
Not C, not C++, not D, not Nim, not Go, not Swift, not Ada, ...
* this article acknowledes that while open-source hardware requires an open-source ISA, this requirement is not sufficient
* this article mentions open-source hardware that implements the open-source RISC-V ISA, and the type of applications and research that this hardware is used for (e.g. eliminating Spectre-like timing attacks). It also mentions how such research is pretty much impossible to publish for non-open-source hardware using non-open-source ISAs.
There are literally tens of thousands of bugs in the GCC and LLVM/Clang bug trackers about that.
I don't remember the last time I read some compiler-generated asm and thought "wow, that's great code".
Or try to program a micro-controler "hello world" that actuates an LED ?
Most Rust code is quite portable, targeting ARM, x86, MIPS, PPC, WASM, Sparc, s390x, riscv, ... That means, that for many snippets of inline assembly, you might encounter ~8 of them, one for each architecture, all using different syntaxes.
Intel syntax is quite similar to that of other popular architectures `op dst, args...`.
Adding another second syntax for x86 just doesn't add that much value IMO, and adds quite a bit of cost: now everybody dealing with x86 assembly needs to learn 2 syntaxes... and everybody dealing with portable code now needs to be at least able to read 2 syntaxes for x86... Without talking about the cost of implementing a second syntax in the compiler, etc.
If you prefer AT&T, you can always write a proc macro that translates it to Intel, and use that in your projects.
If I ever need to deal with such code, I'd just expand the macro to read the actual Intel syntax, modify that, and either fork the project, or submit a patch with a fix using Intel syntax.
So better syntaxes are possible, as long as they can be built on top of the proposed inline-assembly feature.
They can, however, just be implemented as normal Rust libraries, and do not need to be part of the compiler.
So how does the compiler know that these are clobbered then ?