
seen from Belarus
seen from Australia
seen from Türkiye

seen from Germany

seen from United States
seen from United States

seen from United States
seen from Yemen

seen from United States

seen from United States
seen from United States

seen from Chile

seen from Malaysia

seen from Malaysia
seen from United States
seen from China
seen from United States
seen from Brazil

seen from United States
seen from United States
i've been trying out rust for a bit and omfg i see the vision
this is a lua parser im writing, to represent the ast edges (connections in the ast tree eg. a binary operator holds a reference to both the left and right sub-expressions) they're stored as integers which represent an index into these vectors. lowk i get it, but this is not the 'zero-cost abstraction' i was promised. wtf dym i cant just deref a pointer and have the data
Update to the SD card saga, hopefully not a final update but a big update nonetheless. TL;DR - i was writing Rust code using Embassy for an STM32 microcontroller (ARM) to interface an SD Card via the SPI protocol and had a lot of trouble along the way.
I finally sat down and refactored all of my messy code into some basic Command, Response, Channel structs and put some effort into working with the new SD card that i bough fresh off the shelf. It still had some issues that needed overcoming, but it was 1000x more pleasant to work with than the ancient 15 year old card i tried working with prior.
The solution is not yet perfect and it needs a lot of refactoring and design modifications but i managed to:
Mount the SD card on my linux using whatever filesystem was there by default (vFat i think or Fat32)
Create a file with simple contents to find (repeated "Hello World!" to make it larger than 1 block (512 bytes))
Find the byte offset of the file using "hexdump -C /dev/sda"
Divide the byte offset by the size of a block (512) to get the block offset
(I had to do all that because obviously my code does not have filesystem-parsing ability lol)
Unplug the card from my linux and plug it into my stm32 devboard as before
Hardcode the block address in my code in an aptly named constant
Run the code
And lo, behold, here it is:
(there's a sea of debug messages prior to this ofc and the hex is cutoff but ohwell)
I managed to read one single block of 512 bytes form my SD card and it contained my file's contents, which means that it works!
This really seems like a small result but honestly i had to fight tooth and nail through the complex SD spec and navigate hardware inconsistencies and deviations from said spec and even when things were working it was still kind of difficult to pack everything into nice abstractions so i dont end up with 2000 lines of spi.blocking_transfer(&mut buf).
There's still a lot of work ahead of me - writing to the card would be nice, duh - but im super stoked because i started this a long time ago and it's an accomplishment for me. I've never communicated with anything using SPI, i haven't used any storage devices before (no flash, eeprom chips etc - storage built into the microcontroller doesnt count!). This is a pretty big deal and im very happy about the result.
Hopefully i will continue that in the future, i'd like to get writing working but at this stage it sounds like a piece of cake, since the mechanism is relatively similar (unless the card misbehaves once again lmao).
Coming from Rust and coding Python
WTF is this abomination
Just added a Nix run configuration to one of my Rust applications, and it was super easy and straightforward.
Now i can run that tool on any system that has Nix installed by just calling: nix run github:user/repo and it'll get automatically compiled and executed. AMAZING!
shout out to @fish-shell for completing their port to @rust-official
A smart and user-friendly command line shell
So. I found a post from @gaynessopimizationalgorithm. Given the fact that I am a Rust dev, I thought Id recreate this program. I attached some screenshots of it and the output of the test. Tell me if anyone wants me to publish this as a crate on crates.io. I made it a library so i fairly easily could. Is this the best Rust code that could be used? Probably not. But its the way I did it. So shush.
💬 3 🔁 43 ❤️ 168 · Brand new updated gayness optimization algorithm (now a function for easy integration into any code) guaranteed to make
I'm working on a solver to compute a mathematically-proven optimal speedrun for Gorogoa, a card puzzle game. I made a playable text-based simulator to test the minimal game engine I built for it. It's written in Rust and super fast: on my laptop, it can simulate 4.2 million moves/sec per CPU core! That helps loads with exploring all the possible move sequences to find the fastest way to the end.
The game engine is fully data-driven, with interactions modeled in a big YAML file that I wrote out by hand while going through the game. I've modeled through Act 3 for testing so far.
Right now it assumes all moves happen instantaneously, to simplify the algorithm a bit so I can prove the concept. Once I have the whole game modeled and solved for the simpler case, I'll need to go through and time all the interactions, then adapt the algorithm to take time into account.