#hmm-rs - haxelib management tool, written in... rust?
1 messages · Page 1 of 1 (latest)
why?
Rather than lix or hxml files, I find myself enjoying working with local haxelib repositories for my projects, with the help of hmm
I think hmm is awesome, but I've started to get spoiled by other tools! I want more out of it... however... I want to make it a VERY good and stable tool that I know the insides of entirely. So I've begun work on reimplementing it myself, in rust!
why rust?
Little learning project for me 🙂 I want to learn rust and haven't found a good "starter" project for myself... until now! also inspired by haxeget by l0go
I've also been spoiled by rust based command line tools and I think they r fun and neat... hehe
progress as of posting
I have a list of hmm commands implemented here: https://github.com/ninjamuffin99/hmm-rs?tab=readme-ov-file#hmm-commands-to-implement
fun benchmark / screenshots
hmm-rs check checks if the current .haxelib installations match the hmm.json-specified versions/refs/etc.
~400ms -> ~6ms
current todo: i been fuckin around adding these ez commands... i need to add it's core functionality... installing haxelibs!
get rid of the unwraps
inspired by haxeget by l0go
hmmmmmmmmmmmm
i will once i learn how to write better rust ✍️
I keep forgetting to look into real dep management solutions. I have a bash script that I wrote a couple years ago that reads a file to get stuff pulled down. It works pretty good, but it's a bit goofy. I'll look into this when I get some free time to fiddle with it
i would definitely recommend taking a peak at the original hmm and giving that a spin https://github.com/andywhite37/hmm
we use it as our dep management on FNF, and works pretty damn good! this rust version i suppose i want to aim for it to work blazinglydamn fast, as that's definitely where some of my pains are for haxelib/hmm, although its no slug by any means!
Ineresting. It honestly appears to be doing the same thing as my bash script (I'm sure in a more thourough manner, however). It looks like hmm is just using haxelib under the hood, as expected. Is it doing anything extra-special with your lib versions?
The way I've been doing dep lists is in just raw text rather than json, so it looks like this (as a couple short examples of libs with versions/git):
flixel 5.4.0
newgrounds 2.0.0
bitlytics git https://github.com/bitDecayGames/Bitlytics.git
I guess one other question is around the speed aspect. Since it's all relying on haxelib commands under the hood, how do you see yourself speeding things up from what hmm does at the moment?
this rust version is downloading from haxelib thru http request itself, and doesnt make any calls to haxelib tool, so u can actually use it without having haxelib installed i believe
Interesting. Is there a measurable difference between using http directly and haxelib? I'm curious how much overhead there is there.
i suppose for this its a bit more direct control over things, rather than going rust cli -> haxelib (already neko VM!) cli -> http request, can just go rust cli -> http
dont quote me on it, but maybe with haxe u can get better performance outta CLI stuff if u tweak things (relative to default haxe, not compared to rust!), but outta the box rust runs things pretty damn good, so thats also a plus in the "less overhead" side
one thing we often run into when using hmm for FNF is when we make local changes to haxelibs without committing + updating the hmm.json, so added something super useful
hmm-rs check will now tell you if you have local changes made to a installed haxelib
https://cdn.discordapp.com/attachments/924803319057227856/1261430103695556708/image.png?ex=6692edd4&is=66919c54&hm=1e98ddd2d7b3139be6fc60641034a35b8a525805808e1413cb8c044cc9a51797&
poking back in on some progress
i finally got the haxelib api stuff figured out, and some nice results
Benchmark 1: hmm-rs haxelib openfl
Time (mean ± σ): 2.242 s ± 0.135 s [User: 0.057 s, System: 0.168 s]
Range (min … max): 2.111 s … 2.590 s 10 runs
Benchmark 2: hmm haxelib openfl
Time (mean ± σ): 4.943 s ± 0.288 s [User: 0.412 s, System: 0.328 s]
Range (min … max): 4.740 s … 5.732 s 10 runs
Summary
hmm-rs haxelib openfl ran
2.21 ± 0.18 times faster than hmm haxelib openfl
Benchmark 1: hmm-rs haxelib flixel
Time (mean ± σ): 1.864 s ± 0.110 s [User: 0.033 s, System: 0.091 s]
Range (min … max): 1.765 s … 2.098 s 10 runs
Benchmark 2: hmm haxelib flixel
Time (mean ± σ): 4.232 s ± 0.232 s [User: 0.282 s, System: 0.224 s]
Range (min … max): 4.103 s … 4.876 s 10 runs
Summary
hmm-rs haxelib flixel ran
2.27 ± 0.18 times faster than hmm haxelib flixel
my specific times are on a bit less stable internet, about 50 Mbps download.
but other haxe vs. rust overheads like unzipping, download handling, all that stuff, might lead to a general improvement to speeds. Very happy with results though!
the specific functionality hmm-rs haxelib flixel is meant to query the haxelib server to see what the latest version of the library is, which I neglected for a while. I ended up having to do a buncho R&D into the old haxe remoting API to sorta pseado reverse enginer the http requests to the haxelib server
also in these benchmarks, hmm is making direct calls to the haxelib cli (a la haxelib install flixel) so this is smidge also a comparison between haxelib and hmm-rs 🫰