Lenses in Rust and My Solution
Lenses in Rust and My Solution
Rusting stove and oven at Eureka Mine in Death Valley National Park.
Go Home Mago, you're drunk:
#PHP #Programming #Mago #Rust #SoftwareDevelopment #Coding #Code #WebDevelopment #WebDev #OpenSource #Laravel #FOSS #OSS
- The ease of defining new data structures that are very robust
- Ownership/Borrowing almost forces you to transform data from one form into another when programming your algorithm (first point is a prerequisite for this)
- perfect mix of procedural and functional style
...and probably so much more...
I love #Rust! ๐ฅฐ
I know #Mago Analyzer is good, but sometimes it goes really overboard with the intent of pursuing #Rust-level of strutiny on a more lenient language.
- PHPStan:
You forgot to add this PHPDoc to this method.
- Mago:
YOU STRAIGHT TRIPPIN', MOTHERFUCKER! SEE THIS "MIXED" BULLSHIT? LINE 248 IN FUCKING RED, YOU BLIND-ASS TROGLODITE? IT AIN'T NO INT, IT AIN'T NO STRING! U TRYNA GET REPLACED BY CLAUDE? DID YOU LEARN PROGRAMMING ON FUCKING WINDOWS ME?
Fun fact: if you have a big list of IP address ranges (like, say, a GeoIP database), and you need to perform lookups in #Rust, you can, using a build script, turn it into Rust match patterns!
Then you can include!() that Rust snippet into your program.
This will turn it into a compile-time lookup table, which should be extremely fast at run time because the program will not spend any time loading or parsing a database.
But of course you have to recompile to update the databaseโฆ
Building ezli.me, a link shortener in Rust
https://rustunit.com/blog/2026/04-17-ezlime-link-shortener-in-rust/
I have to say, #Mago for #PHP is great, but its analyzer is sometimes too dumb strict.
#Code #Coding #SoftwareDevelopment #Programming #WebDevelopment #WebDev #Rust