That's what makes us humans different from computers. We don't ask how high, we just do it. Now, if it were a C pointer it would jump anywhere from 0 to 2^32-1. That's why C is more suited for artificial intelligence than it might initially seem. Thanks for coming to my tedx talk
Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function.
20 Comments
xlash123@sh.itjust.works · 129 pts · 2y
Lol, it took me a while to realize it's the compiler essentially saying "how high".
tempest@lemmy.ca · 72 pts · 2y
I do enjoy the rust compiler error messages. They are nicely formatted
Shameless@lemmy.world · 22 pts · 2y
I'm trying to learn rust and so far this has definitely made it so much more accessible.
Not to mention their super useful "rustlings" training which has these nice little challenges to get you used to language and syntax
embed_me@programming.dev · 46 pts · 2y
That's what makes us humans different from computers. We don't ask how high, we just do it. Now, if it were a C pointer it would jump anywhere from 0 to 2^32-1. That's why C is more suited for artificial intelligence than it might initially seem. Thanks for coming to my tedx talk
crispy_kilt@feddit.de · 6 pts · 2y
Pointers are ackshully 48 bits on amd64 (which is most PCs and servers)
embed_me@programming.dev · 5 pts · 2y
I was mostly joking about a stray pointer of type uint32_t*
So the size of the pointer itself doesn't matter
___qwertz___@feddit.de · 5 pts · 2y
Well ackshully newer CPUs support 5-level-paging which uses 56 bits.
bamfic@lemmy.world · 37 pts · 2y
i dislike rust, but have to give them credit for helpful error messages. not quite racket level but impressive
crispy_kilt@feddit.de · 6 pts · 2y
What made you dislike it?
bamfic@lemmy.world · 3 pts · 2y
the syntax.
Gork@lemm.ee · 32 pts · 2y
WRONG, PRIVATE!
Now drop and give me int(ceil(19.9))!
trxxruraxvr@lemmy.world · 11 pts · 2y
Height should be a float
ParanoiaComplex@lemmy.world · 10 pts · 2y
I don't know Rust but jump typically moves the program counter, where the height represents the number of instructions to move
trxxruraxvr@lemmy.world · 14 pts · 2y
Afaik rust doesn't have functions like that as they lead to unsafe code that's impossible to check variable lifetimes for. I think OP created the jump function.
RustyNova@lemmy.world · 14 pts · 2y
They created it. The compiler says the jump function is in src/main.rs
Klaymore@sh.itjust.works · 6 pts · 2y
It's height in centimeters
trxxruraxvr@lemmy.world · 1 pts · 2y
fossphi@lemm.ee · 4 pts · 2y
Chad quantised rust
crispy_kilt@feddit.de · 2 pts · 2y
Never use floats.
SatouKazuma@programming.dev · 1 pts · 2y
But then wouldn't it be
fly(height: f64)instead ofjump(height: i32)?Darkassassin07@lemmy.ca · 3 pts · 2y
Huh, usually they ask 'jump where?'
imnnotfalll222gamer@lemmy.world · 1 pts · 1y