

* Swedish developer of the year
Don’t get me wrong, he does great work, but your post should mention it somewhere.
* Swedish developer of the year
Don’t get me wrong, he does great work, but your post should mention it somewhere.
Rust doesn’t allow type inference in function signatures, c++ does with auto. IIRC, they recommended against using it, because of -you guessed it- compile time.
But you’re also missing one use of the impl keyword: fn func() -> impl Trait.
[…] So dropping the
impl
in [return position] might not be completely impossible like the other uses ofimpl
.
But the impl markes that it is a trait to the programmers.
Take the following functions:
func1()->A{...}
func2()->A{...}
Does the following snippet compile?
let mut thing = func1();
thing = func2();
Under the current rules we know it will. But if A could be a trait, the functions could return different types. We currently mark that with the impl
.
Why? What value does -> () provide? Why not elide that?
What value is provided by keeping it?
What value does cluttering up your code with -> ()
provide?
Why a syntactic special-case for exactly that type and not any other random type?
Because the unit type is special, just like the never !
type. ()
also has the special importance of being the return value of an empty statement and some other stuff.
languages w/o [semicolons] feel awkward since you’re generally limited to one statement per line
Then fixing that might make sense. :-)
It’s fixed with semicolons ;-)
I’m sorry I don’t know all the arcane incantations of your court system of the top of my head.
If the spec contains default values why not make a constructor with all the missing fields or implement Default
when all fields are covered?
Also lol:
#[test]
fn test_config_load() {
todo!();
}
What would the defense say? “That wasn’t him, just someone who looks similar.”
They already claim that by pleading innocent at the start.
A computer/microcontroller can read physical cards just as well and if the specs of the hardware are well known enough for someone to write vhdl/verilog, they can also write c/rust.
If someone offered you a molecularly identical beer, would you complain that it’s not the original.
If the outcome is the exact same, who cares?
This is like golden audio cables but for retro gamers.
Why use a FPGA? For the price of the chip (113€) you could get an entire SBC that has more storage, voltage regulation and protection, 3.3V or 5V IO and linux.
You could save 0.64 bit per char more if you actually treated you output as a binary number (using 6 bits per char) and didn’t go through the intermediary string (implicitly using base 100 at 6.64 bits per char).
This would also make your life easier by allowing bit manipulation to slice/move parts and reducing work for the processor because base 100 means integer divisions, and base 64 means bit shifts. If you want to go down the road of a “complicated” base use base 38 and get similar drawbacks as now, except only 5.25 bits per char.
Unless you only copy and compare you have to decode it, or implement more complicated logic for everything from searching to concatenation (which is normally just memcopy).
The standard xkcd on making another thing:
https://xkcd.com/927
On frameworks specifically, I recommend the song:
We’re gonna build a framework,
cause we wanna use one,
but don’t wanna choose one
We’re gonna build a framework
We didn’t like the others,
So we’ll write another
I never understood why they don’t add just a little syntactic sugar. You don’t need much to take it from a mess of brackets to something comprehensible.
It was in the original design, but not the first implementation. By the time someone got around to it, people where used to S-expressions.
I can’t comment whether learning C first improves your rust, but it certainly makes you appreciate what the rust compiler does.
Also learning rust improved my C.
Even if it gets put in s landfill without burning, it will rott and the carbon reaches the atmosphere as CO2 or methane (much worse).
We have bacteria break it down to create biogas, wich we burn for energy, and sludge wich we burn and put the ashes in landfills or back on the fields as fertilizer.
You can rest assured that all the carbon makes it to the atmosphere, one way or another.
Sound like coal butter, which existed in WW2 but was discontinued because of inefficiency.
And the most important question: how does it taste?
No the most important question is how much energy does it take?
[…] they take carbon dioxide from the air and hydrogen from water, […]
So direct air capture, instead of industrial waste CO2, good luck with that.
C++ already has much more of the required language constructs, which is why there is already an attempt to add borrow checking to C++ called circle. Until that standardizes, I wouldn’t expect it in C.
Don’t believe them, there is more great and some frustrating stuff afterwards.