Haudegen has quit [Remote host closed the connection]
Haudegen has joined #mirage
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]
mort___ has joined #mirage
mort___ has quit [Remote host closed the connection]
mort___ has joined #mirage
mort___ has quit [Client Quit]
mort___ has joined #mirage
mort___ has quit [Quit: Leaving.]
mort___ has joined #mirage
wendar has quit [Ping timeout: 244 seconds]
wendar has joined #mirage
mort___ has quit [Quit: Leaving.]
mort___ has joined #mirage
jnavila has joined #mirage
<hannes>
I've some more stupid questions about keys and functoria
<hannes>
is it possible to have a setup as follows: I want a (key-value) storage. this can be provided by several devices -- an in-memory one, a unix filesystem backed one, or a git-backed one.
<hannes>
the opam dependencies vary, thus I'd like to have a configure-time choice, similar to target. let's call it storage. similarly to target, using an enum for the three choices.
<hannes>
now what we get is an assertion failed in app/functoria_graph.ml:238 :/ (example config.ml is at https://github.com/roburio/caldav/blob/master/mirage/config.ml -- the current code does not assert, but if the let store = .. in line 162 is used). any hints?
<Drup>
1) user-facing assert false are a bug, so I would appreciate a reproducable bug report :p
<Drup>
2) For the rest, this should work fine, you can just copy the way it works for file systems
<Drup>
(actually, what you described is mostly implemented already, through kv_ro
<hannes>
ok, I'll see whether I can minimize the test to report a proper issue.
<hannes>
in kv_ro: (a) Key.(value target) is used, not a new enum (yes, i know this should not change much), (b) the dirname is a hardcoded string (in our case, it should be a configure/runtime arguemnt ("take dir /foo/bar") instead
<Drup>
right, it's annoying to do that change due to various limitations in functoria
<hannes>
what does this mean? it's not possible (and will never be) with functoria? or it's possible but looks complex&ugly? or "if functoria would be extended here and there, it's straightforward"?
<apache2>
:-/
<Drup>
hannes: So, you can have Key.t, which represent something that comes from the command line
<Drup>
Key.value, which represents "a bunch of *configure time* computations that uses cli arguments"
<Drup>
(Key.key, not Key.t)
<Drup>
If you get something from Key.key, you can persist it to runtime, and make the value accessible to the unikernel
<hannes>
ok
<Drup>
but you *can't* persist Key.value, because they can do arbitrary computations, and that would require giving extra serializer for their types
<Drup>
So, it's possible to have something that is "either a constant or a cli argument": it's a Key.value
<Drup>
But it's not possible to make that accessible to runtime with the current API
<Drup>
Which means that, for things like kv_ro, you have to chose: either make it constant, or put it on the cli, but not both
<Drup>
It's ... unfortunate. The only way to really solve it would be either to make the API heavier or use something like modular implicits
<hannes>
ok, thanks for explaining. i'm still not sure i follow through, though (sorry).
<hannes>
what my current mindset would want: a string key that says "by default take tls/ subdir", but you can set the default at configure or compile time.
<hannes>
and then use this key in the kv_ro device in the call to connect (i.e. Mirage_fs_unix.KV_RO_bla.connect %a serialize my_key
<Drup>
Yeah, that should be fine
<hannes>
it sounds possible, and indeed we managed to write such a thing today. but the amount of "boilerplate" (sorry for that bad name, should rather be lifting/...) was not very low
<hannes>
now this is for keys which carry values.. but with e.g. match_impl not able to peek into the values -- (which is sensible in some way..)
<hannes>
so, the common example for a configure-only enum key is target, and we tried to follow that for our --storage thing.
<hannes>
hmm, not sure how to explain. will get some food and work on a small example. thanks again for your explanations
<Drup>
match_impl cannot peak into values on purpose, it would break doc generation (and all kind of things :p)
<hannes>
oh, but how does than "match_impl Key.(value target) [ ... ] ~default:..." work?
<Drup>
It tests for equality over a limited number of cases
<Drup>
The important bit is that it's match-like, and not bind-like
<hannes>
ok
<hannes>
thanks again, now really food
mort___ has quit [Quit: Leaving.]
<hannes>
not sure i'll finish this.. a bit too frustrating
<Drup>
hm ? It seems like you did most of the work already
<hannes>
now I tried fresh from the beginning, and thought: easiest real issue I want to solve is that atm "crunch" get's a static string, but instead I'd like it to be configurable (with directory to pick) via a configure-time key.
<hannes>
if I use in the match _and in_ the default "p2 $ default_posix_clock" --> boom (assertion failed in line 248). if I remove the case in the match -> works, if I replace any (default or match) with "impl p1", works.
jnavila has quit [Remote host closed the connection]
<hannes>
Drup: i put some info into the READMEs, in case you've some time to look into that. i suspect "minimal" is pretty straightforward to translate to a pure-functoria-thing. and once kv-ro-configure is solved (+minimal), the storage-select should be straightforward as well
<Drup>
Can you open a bug report ? I'll forget otherwise