Details
-
AboutAAAAAAAAAAAAAAAAAAA
-
SkillsRust and other things
-
Locationhere
-
Website
Joined devRant on 12/8/2018
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
@PaperTrail I have to agree with Lensflare on this one lol
-
@retoor I'm always a quick shot, hah ladies? ;)
-
@retoor There is some overhead in Rust if you use a lot of the high level features, but if you know what you're doing it's not a big deal. And in the end it all gets optimized via LLVM, same as C via Clang ;P
-
@retoor What CPU do you have btw?
-
@retoor How often did you have to run it to get that result? ;D
-
@retoor It's still my newest code. I just pulled your latest commit and those are the numbers :P
-
@YourMom Thats a meme that everybody just repeats with virtually no evidence
Of course the reason is that people feel threatend by Rust (which is stupid btw, Rust isn't a silver bullet) and so they make this shit up so they can feel validated that Rust and its users are all just immature idiots
Mind you, there are a lot of immature idiots. But those people aren't part of the rust community. Script kiddies can't write Rust after all -
@retoor Nice code btw. Your version is more correct than mine right now (because I have been too lazy to correctly implement scalar loop tails :P)
-
@retoor My Rust version did correct utf8 too before the last optimization. I tried matching the semantics of the C version as closely as possible so that it's a fair fight, and it didn't do utf8 so I threw it out
-
Btw, isspam stopped being about "X language vs Y language" a LONG time ago lol
Now it's purely a "who can come up with a better simd algorithm" exercise. Still fun, but definitely not a language comparison :P -
Have you fixed it yet? Last time it optimized out all calculations
I wanted to work on a little test harness that ensures all versions produce the correct numbers anyways, maybe I'll do that at some point :P -
And get some nutella while your at it :D
-
Did you try a waffle recipe with buttermilk? Those are actually insane
-
AoC gets INSANE really quickly. Last year i didn't make it past day 12 i believe lol
-
@retoor I dunno, i'm not a vibe coder, but I am pretty knowledgeable when it comes to very low level and interpreter programming
Rava seems pretty good! I wonder how you are doing memory management though... I haven't seen any garbage collection or similar in the code -
@retoor I don't really remember, but if valgrind found anything than probably because some singleton was persistently allocated until the end of the program. There's not really anything wrong with that since the OS will clean up the memory at end of process. In fact I optimized my latest isspam version to leak values at the end so that drop impls don't increase run time :P
And if you like Swift, then do swift. I don't have anything against it. I just really like rust -
@retoor I can emulate C in Rust with 3 lines of code, it's very simple. The whole point is that it's *also* memory safe :P
-
@Lensflare I want to try swift at some point but I also just really like Rust
-
@retoor Sorry, haven't read it yet
-
@lorentz Just look at the codegen difference: https://godbolt.org/z/vsTeGcz8M
Pretty crazy -
@lorentz It's probably fine either way :P
But the issue with "heavy" branches that contain function calls, etc -- even if they are very rarely taken -- is that it pessimizes everything else around it, especially register allocation. And in case of the Rc decrement, I think that can panic aswell, which requires the codegen to do some stuff for unwinding too -
@antigermanist Its that big huh
-
@lorentz Arenas would impose some awkward lifetime restrictions if you want to use raw ptrs internally and make it not unsound. Alternatively you could use general indices but then you need to query the arena with a key all the time which is very awkward -- I actually did that before switching to Rc because it was way too annoying
I guess ultimately, I'm doing this because why not :P
And it's gonna be pretty fast too. Using Rcs has some unfortunate codegen. If you have a bunch of short lived Rc clones, each time you drop one it has to check whether it's dead and emit a heavy dealloc branch -
@afaIk Maybe your parents shouldn't have coded your dna
-
@Lensflare Well it *can* if you make it do it :P
It's really not *that* complex though. Rust can be as low level as C, so essentially I'm just implementing a spin on conservative tracing garbage collection (and it's single threaded, so quite a lot easier)
So if you call a gc cycle, I load the current stack pointer and walk over the raw stack. Anything that looks like a valid gc pointer (i.e. it points to within my gc heap) is treated like a real pointer and that object gets tagged. Then you go over your heap and delete all dead objects
From a Rust standpoint it's no problem: Gc<T> is just a raw ptr with a deref impl. That cannot result in UB since aslong as somebody still holds a gc handle it won't get deleted. And once nobody holds it, nobody can obverse the deletion -
@retoor Was your GC just part of a higher level code or actual pointer and byte level? Because that's when it becomes tricky :P
Right now I'm kinda struggling how to make the memory allocator not waste a bunch of space
I'm thinking creating a ram-sized virtual memory region and then committing the pages I need but for each n pages I also have one metadata page so that "is this pointer a valid allocation" (which is needed for the conservative tracing routine) can be efficient -- without wasting one slot per page for page metadata. At higher size classes (> 16 byte) that's just wasted space... -
@BordedDev If you keep to a sane subset yaml is actually pretty nice IMO. When people say they hate YAML most of the time they hate the weird kubernetes config language which is YAML with special tags for a bit of scripting (which is very horrible)
-
@retoor Yeah but you hopefully know what your program does :P
I mostly object to a bunch of outlandish claims in the readme that are just lies -
I think when the """author""" doesn't even know what the code does and the README contains shit like "production ready", "extremely efficient", "fully featured" then it's definitely slop
Also a bunch of emoji spam -
Maybe you just weren't white enough
