Got nerd sniped by an interview question and did a wildly unsafe but memory efficient solution: play.rust-lang.org?version=stab...
Can anyone spot something I missed making `remove_popped` unsound?
#rust
Posts by Erik Funder
Yes - I’ll now go check
See you there!
Screenshot of a Rust code snippet: fn main() { for n in 1..=15 { let mut out = 0; Fib(&mut out, n); println!("Fibonacci for n={n}: {out}"); } }
committing #rustlang drop crimes
yes, `Fib` is a struct here, not a function call
Playground: play.rust-lang.org?version=stab...
I am confused 😅 talking about functional programming here?
I am looking forward to the recording of this 😊 - 1am CET is sadly not going to work for catching it live 😌
I’m not sure it’s supposed to do that 😂😅
No, but really, I’m impressed, confused and curious about how different terminal emulators are going to handle it 🤔
Moved to Czechia recently, guess I should try it 😁
Uff 😮💨 faraway wishes for better days ahead 😔
I have never heard this before, but good analogy and good reading. Thanks 😊
Amazon doesn’t really operate where I am, but am trying to avoid buying morally questionable stuff e.g. IKEA furniture and fast fashion
That should ideally get _better_ with more MIR optimizations and cranelift backend, but yeah..
Thanks for pointing me in the direction, it’s a nice Thursday night activity scrolling through their posts 😊
😂
Poor turtles, they just want the ✨spicy water✨ 😂
😮 you beat the gambling addiction
What might I be looking at?
I couldn’t agree more - I find Gos ethos quite perplexing, but this somehow matches my intuition about it 😅
I would love to pay a few dollars for reading this, but I’m not gonna start a subscription I’ll have to cancel 😮💨
Thank you, I hate it 😅
Is it a MacOS or Zed thing that Zed just correctly picked up on me using ‘mv’ to rename the project folder behind its back?
(Yes, this is a bad regex joke)
Oh boy I appreciate quick editor startup - thanks @zed.dev
Yes, thanks, have played with Haskell before, but probably not enough. The rest I don’t think I’ve written at all - this is perfect 😊
And cargo only strips release binaries - ‘cargo build —release’ and there’ll be a binary in the target/release directory
Oh, it’s cargo which does binary stripping automatically - if you run strip on the binary it goes from 3.7MiB to .35MiB. If you want it smaller (enough for small micro controllers) you’ll have to drop the standard library - but that’s suddenly a lot more painful
While it is, it is tiny, the problem used to be the standard library being statically linked, but I remember they began stripping the binary automatically, so I’m unsure why you are still seeing big binaries - I’ll be back once I’ve reproduced 😁
Which makes you a great Rustacean to follow 😌
I will definitely look into that, thanks ❤️