#hmm-rs - haxelib management tool, written in... rust?

1 messages · Page 1 of 1 (latest)

timid condor
#

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!

static orbit
#

get rid of the unwraps

earnest violet
#

inspired by haxeget by l0go
hmmmmmmmmmmmm

timid condor
rigid jasper
#

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

timid condor
#

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!

rigid jasper
#

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?

timid condor
rigid jasper
#

Interesting. Is there a measurable difference between using http directly and haxelib? I'm curious how much overhead there is there.

timid condor
#

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

timid condor
earnest violet
#

oh, i could see myself using that

#

neat!

timid condor
#

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 🫰