ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
rgrinberg has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
boogie has quit [Remote host closed the connection]
lordkryss has quit [Ping timeout: 272 seconds]
racycle_ has quit [Quit: ZZZzzz…]
alpounet has quit [Remote host closed the connection]
eikke_ has quit [Ping timeout: 264 seconds]
eikke_ has joined #ocaml
claudiuc has quit [Remote host closed the connection]
lordkryss has joined #ocaml
eikke_ has quit [Ping timeout: 245 seconds]
manizzle has quit [Ping timeout: 264 seconds]
yomimono has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
boogie has joined #ocaml
boogie has quit [Remote host closed the connection]
manizzle has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
manizzle has quit [Ping timeout: 240 seconds]
lordkryss has quit [Ping timeout: 240 seconds]
q66 has quit [Quit: Leaving]
yomimono has quit [Quit: Leaving]
macron has quit [Ping timeout: 240 seconds]
macron has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
alpounet has joined #ocaml
alpounet has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
dant3 has joined #ocaml
divyanshu has joined #ocaml
divyanshu has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
divyanshu has joined #ocaml
manizzle has quit [Ping timeout: 245 seconds]
Eyyub has quit [Ping timeout: 264 seconds]
alpounet has joined #ocaml
alpounet has quit [Ping timeout: 264 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
axiles has joined #ocaml
ygrek has joined #ocaml
racycle has joined #ocaml
racycle has quit [Ping timeout: 255 seconds]
ggole has joined #ocaml
Hannibal_Smith has joined #ocaml
ggole has quit [Read error: Connection timed out]
ggole has joined #ocaml
alpounet has joined #ocaml
divyanshu has joined #ocaml
ebzzry has quit [Remote host closed the connection]
slash^ has joined #ocaml
racycle has joined #ocaml
racycle has quit [Ping timeout: 240 seconds]
demonimin_ has quit [Ping timeout: 240 seconds]
pyon has joined #ocaml
demonimin has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
Oejet has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
__JokerDoom has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: Leaving.]
racycle has joined #ocaml
racycle has quit [Read error: Connection reset by peer]
racycle has joined #ocaml
racycle has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
avsm has joined #ocaml
pyon has quit [Read error: Connection reset by peer]
Arsenik has joined #ocaml
pminten has joined #ocaml
slash^1 has joined #ocaml
slash^ has quit [Ping timeout: 272 seconds]
<ggole> This is called "referential transparency": making sure you don't see inconsistent results.
racycle has joined #ocaml
BitPuffin has joined #ocaml
racycle has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
avsm has quit [Quit: Leaving.]
Simn has joined #ocaml
slash^1 has quit [Read error: Connection reset by peer]
lordkryss has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
ygrek has joined #ocaml
racycle has joined #ocaml
racycle has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
thomasga has quit [Quit: Leaving.]
pminten has quit [Remote host closed the connection]
BitPuffin has quit [Ping timeout: 240 seconds]
Nahra has joined #ocaml
huza has joined #ocaml
thomasga has joined #ocaml
huza has quit [Ping timeout: 272 seconds]
thomasga has quit [Quit: Leaving.]
racycle has joined #ocaml
huza has joined #ocaml
thomasga has joined #ocaml
racycle has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
tane has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
Thooms has joined #ocaml
nikki93 has quit [Remote host closed the connection]
q66 has joined #ocaml
racycle has joined #ocaml
eikke_ has joined #ocaml
racycle has quit [Ping timeout: 244 seconds]
araujo has quit [Quit: Leaving]
ontologiae has joined #ocaml
araujo has joined #ocaml
shinnya has joined #ocaml
Nahra has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
divyanshu has joined #ocaml
NoNNaN has quit [Ping timeout: 264 seconds]
NoNNaN has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
eikke_ has quit [Ping timeout: 240 seconds]
darkf has quit [Quit: Leaving]
bjorkintosh has quit [Ping timeout: 255 seconds]
racycle has joined #ocaml
racycle has quit [Ping timeout: 240 seconds]
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
alpounet has quit [Ping timeout: 245 seconds]
Hannibal_Smith has joined #ocaml
slash^ has joined #ocaml
ontologiae has joined #ocaml
maattdd has joined #ocaml
nikki93 has joined #ocaml
alpounet has joined #ocaml
eikke_ has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
maattdd has quit [Ping timeout: 240 seconds]
seanmcl has joined #ocaml
racycle has joined #ocaml
racycle has quit [Ping timeout: 264 seconds]
eikke_ has quit [Ping timeout: 255 seconds]
Averell has quit [Ping timeout: 245 seconds]
ontologiae has quit [Ping timeout: 240 seconds]
pminten has joined #ocaml
BitPuffin has quit [Ping timeout: 244 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
Averell has joined #ocaml
Averell has quit [Remote host closed the connection]
Averell has joined #ocaml
Averell is now known as Averell
racycle has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
racycle has quit [Ping timeout: 255 seconds]
nrlucaroni has joined #ocaml
divyanshu has quit [Ping timeout: 245 seconds]
maattdd has joined #ocaml
so has quit [Ping timeout: 264 seconds]
tianon has quit [Ping timeout: 272 seconds]
tianon has joined #ocaml
pminten has quit [Remote host closed the connection]
philtor_ has joined #ocaml
nrlucaroni has quit [Quit: Lost terminal]
divyanshu has joined #ocaml
Kakadu has joined #ocaml
slash^ has left #ocaml [#ocaml]
so has joined #ocaml
Arthur_Rainbow has quit [Ping timeout: 276 seconds]
<reynir> What GUI libraries are there for linux?
<axiles> reynir: lablgtk, labtk, lablqt, ocaml-efl and maybe some others
<adrien> something with wx too
<adrien> sfml, sdl and gl too but they're a bit differnet
<adrien> different
<reynir> Thanks!
philtor_ has quit [Ping timeout: 264 seconds]
pyon has joined #ocaml
johnnydiabetic has joined #ocaml
Eyyub has joined #ocaml
maattdd has quit [Ping timeout: 272 seconds]
shinnya has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
pminten has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nikki93 has joined #ocaml
seanmcl has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
lordkryss has quit [Ping timeout: 255 seconds]
avsm has joined #ocaml
bjorkintosh has joined #ocaml
avsm has quit [Quit: Leaving.]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mal`` has quit [Ping timeout: 240 seconds]
diginux has quit [Ping timeout: 240 seconds]
tianon has quit [Ping timeout: 264 seconds]
diginux has joined #ocaml
tianon has joined #ocaml
maattdd has joined #ocaml
mal`` has joined #ocaml
demonimin has quit [Ping timeout: 240 seconds]
Arsenik has quit [Remote host closed the connection]
Arsenik has joined #ocaml
pminten has quit [Remote host closed the connection]
manizzle has joined #ocaml
zarul has quit [Ping timeout: 264 seconds]
zarul has joined #ocaml
BitPuffin has joined #ocaml
oriba has joined #ocaml
<oriba> I tried to compile the first example from http://ocaml.org/learn/tutorials/introduction_to_gtk.html
<oriba> With the compile
<oriba> one-liner it works
divyanshu has quit [Quit: Computer has gone to sleep.]
<oriba> I tried to compile with OCamlMakefile, and the resut is much smaller
<oriba> and it crashes
<oriba> How can I use OCamlMakefile to compile that stuff?
slash^ has joined #ocaml
divyanshu has joined #ocaml
Eyyub has quit [Ping timeout: 272 seconds]
Hannibal_Smith has joined #ocaml
ontologiae has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
ontologiae has quit [Ping timeout: 272 seconds]
Eyyub has joined #ocaml
divyanshu has joined #ocaml
<oriba> ah, found a solution: Markus Motl's answer in https://groups.google.com/forum/#!topic/fa.caml/nKvEa7DGrHY
manizzle has quit [Ping timeout: 244 seconds]
dapz has joined #ocaml
Eyyub has quit [Ping timeout: 255 seconds]
Eyyub has joined #ocaml
asmanur has joined #ocaml
ggole has quit []
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
Arsenik has quit [Remote host closed the connection]
Arsenik has joined #ocaml
maattdd has joined #ocaml
<weykent> https://paste.weasyl.com/show/xFnrgm4AHk3WlMJEuzqA/ is one of these obviously better than the other?
<weykent> the second one is more compact, but i don't particularly like using ref for some reason
rgrinberg has joined #ocaml
Arsenik has quit [Remote host closed the connection]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> weykent: replace the solution 2 by a hashtable, instead of a ref to a map
<Drup> especially considering the fact that it's a functional map of int, int being hashed stuff :D
<weykent> Drup, i need a map because i'm doing doing Map.split a bunch
alpounet has quit [Remote host closed the connection]
<Drup> except if "pred factor" is really small, you're better of using a hashmap and then iterating on it
ontologiae has joined #ocaml
<Drup> (I think)
<Drup> (deserve benchmark, at least)
<weykent> sure, i could benchmark it
<weykent> Drup, were you suggesting a Hashtbl just because it's mutable?
nikki93 has joined #ocaml
<Drup> and because ... you are hashing stuff
<weykent> Drup, https://github.com/weykent/ocaml-consistent-hash here's the whole project, btw
<Drup> your key is "(hash_val digested (fun x -> x + i * 4))"
<weykent> Drup, it's consistent hashing
<Drup> I don't know what "consistent" mean in this contexte
ontologiae has quit [Ping timeout: 240 seconds]
<Drup> I see, so you need a succ operation
nikki93 has quit [Remote host closed the connection]
<weykent> oh, i'm not doing anything with random trees
<Drup> ok
<Drup> weykent: is the fact there is 4 division constant ?
<weykent> Drup, sorry, i'm not sure what you mean
<Drup> the internal loop is from 0 to 3
<weykent> Drup, yeah, that's constant
nikki93 has joined #ocaml
<Drup> benchmark both :p
<weykent> ah, good ol' |>
<weykent> i'll try that out
<Drup> unrolled is better :p
<Drup> (and the compiler is never going to unroll that for you)
johnnydiabetic has quit [Ping timeout: 240 seconds]
<aggelos_> hmm
<aggelos_> the ocp-build readme talks about how annot files will be next to the source files, but in practice I find them in _obuild/prog/temp/*.annot
<aggelos_> am I doing something incorrectly?
<aggelos_> little mention of -annot in the ocp-build manual...
johnnydiabetic has joined #ocaml
johnnydiabetic has quit [Client Quit]
philtor_ has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
<aggelos_> quiz question: I have let func (f : 'el -> 'nel p) (l : 'el list) : ('nel list * blah list) = ...
<aggelos_> (where p and blah are defined)
<aggelos_> yet when I use annot to print out the type of func, I get: ('a -> 'a p) -> 'a list -> 'a list * blah list
<mrvn> so?
<aggelos_> what am I doing wrong here? is it the case that the scope of 'el and 'nel is not the whole definition?
<mrvn> nothing. The compiler infered that 'el == 'nel
<aggelos_> mrvn: well, this seems to force the types in the sig to be the same, so I get a type error when using the function from a different module
<aggelos_> mrvn: ok, I don't understand why
<aggelos_> this function is not called in this module
<aggelos_> or referenced in any way, in fact
<mrvn> well, something makes it think they are the same
<Drup> aggelos_: 'el and 'nel are merely type variables
<Drup> the compiler can put anything as value of this type variables
<aggelos_> other than a call of func with a concrete 'f' passed in as argument, I don't think I know of any other way that the compiler could infer things about 'el and 'nel
<Drup> "let x : 'a list = [ 4 ]" is valid
<aggelos_> Drup: sure, my problem is that the resulting type signature essentially forces that f : 'a -> 'a p
<aggelos_> which is of course not the case
<Drup> of course ?
<Drup> the compiler think it is, and he's usually better than you at figuring that out
<mrvn> show the source
<aggelos_> Drup: that is my experience too, so I'm trying to figure out what information I'm mistakenly passing along
<aggelos_> mrvn: sec, lemme do a simple testcase
axiles has quit [Remote host closed the connection]
<aggelos_> mm yah, turns out I don't have ocaml 3.12.1 on this box, lemme move things to a box with opam...
<Drup> I doubt it will change with ocaml versions
<mrvn> and while you do that we could already look at the source and find the bug
<aggelos_> Drup: I also doubt that, but I try not to make such assumptions ;)
<aggelos_> mrvn: ForkWork just farms out the computation to worker processes and brings in & unmarshals the result
<aggelos_> the badly-named ForkWork.fold_enumerator does the same, but tries to call the f_acc function (to overwrite the input with the result in the accumulator) as results come in, so that we don't keep (almost) the same data in memory twice until the computation for everything finishes
<aggelos_> anyways, that was mostly a high-level explanation
philtor_ has quit [Ping timeout: 240 seconds]
<aggelos_> mostly interested to find out possible sources for the problem, I'm happy to debug my own code
rand000 has joined #ocaml
<mrvn> What's the signature of ForkWork.fold_enumerator?
<aggelos_> mrvn: it's provided as an annotation to the original paste, just scroll down a bit
<aggelos_> (I had trouble with using a type variable in the place of int * 'c there too, but needed to move forward a bit)
<mrvn> Error: Unbound value update_bench
<aggelos_> mrvn: oh so you do want to compile it. hold on then
Kakadu has quit [Quit: Konversation terminated!]
<Drup> merlin doesn't even need update_bench to tell you that's it's going to unify el and nel :p
<aggelos_> Drup: again, I can see what's happening. any clue as to how to find out the *why* would be most helpful
<aggelos_> update_bench is basically:
<aggelos_> let update_bench mb = let mb = new Perfacc.marshalled_bench mb in mb#replay ()
<aggelos_> so lemme just cook up a .mli for that
<mrvn> fold_enumerator takes "(int * 'acc, 'el) folder" and you are passing "('acc2 -> 'nel -> 'acc2) -> 'acc2 -> 'acc2"
slash^ has quit [Read error: Connection reset by peer]
<aggelos_> mrvn: fair point, I haven't run into that yet, as I can't fully compile the file
<mrvn> That make 'el == 'nel
<aggelos_> any clues as to why I can't use 'acc2 in the place of (int * 'acc) in that sig would be welcome too
<aggelos_> mrvn: oh
<Drup> aggelos_: to debug this kind of issue, you can do modify the declaration of fold_over into : " (type a) (type b) (f_el : a -> b workfunc_result) (f_acc : 'acc -> int -> b -> 'acc) (acc : 'acc)"
<aggelos_> Drup: ah! thanks
<aggelos_> Drup: I think I've seen that in one of the books, but couldn't find it today
<Drup> do something like*
<aggelos_> so any ideas fold_enumerator too?
shinnya has joined #ocaml
<aggelos_> *re: fold_enumerator
<aggelos_> namely
<aggelos_> val fold_enumerator : ?maxprocs:int -> ?fail_fast:bool -> ('el -> 'nel) -> ('acc -> int -> 'nel -> 'acc) -> 'acc -> (int * 'acc, 'el) folder -> 'acc
<aggelos_> this is the sig that is inferred in the .ml file
<mrvn> shouldn't it be 'nel at the end?
<aggelos_> I tried using 'acc2 in place of int * 'acc
<aggelos_> but got a 'not included' error
<aggelos_> mrvn: sorry, which function do you mean?
<mrvn> the folder
<Drup> aggelos_: just modify the type as I told you, the type error are going to be quite clear
<aggelos_> no, the folder just folds over the input list
<Drup> errors*
<aggelos_> Drup: will do, thanks again
Simn has quit [Quit: Leaving]
<mrvn> aggelos_: then in fold_over the fold has to use 'el too. Best to use the folder type there by the way
<aggelos_> mrvn: that fixed it
<mrvn> let fold_over (f_el : 'el -> 'nel workfunc_result) (f_acc : 'acc -> int -> 'nel$ (fold : ('acc2 -> 'el -> 'acc2) -> 'acc2 -> 'acc2) =
<mrvn> val map_list : ('el -> 'nel workfunc_result) -> 'el list -> 'nel list * exn_with_bt list
<mrvn> one little letter
<aggelos_> mrvn: happens all the time :)
<aggelos_> still not sure how to debug the fold_enumerator thing
<aggelos_> but can live with that for today
Eyyub has quit [Ping timeout: 240 seconds]
<mrvn> With the (type a) (type b) thing I get:
<mrvn> Error: This expression has type
<mrvn> (nel workfunc_result, exn_with_bt) result list
<mrvn> (nel workfunc_result, 'a) result list
<mrvn> The type constructor nel would escape its scope
<mrvn> but an expression was expected of type
<aggelos_> mrvn: I think you still need to use 'nel there?
<mrvn> aggelos_: no
<aggelos_> right
tane has quit [Quit: Verlassend]
<Drup> (you might need 4.01 for this to work properly)
<mrvn> or annotate all functions strictly polymorphic
<mrvn> Drup: this is 4.01 by the way
<mrvn> aggelos_: I think your types are way to complicated. this must work simpler.
<aggelos_> mrvn: I agree, but I've been working with ocaml in my research project for a year now, I should level up already ;)
<aggelos_> mrvn: IOW, I might do that before committing this
<aggelos_> (simplifying the types)
<Drup> bah, not really
<Drup> it's just over annotated
<mrvn> why not map the list to results and then at the end split it into Ok and Bad?
<Drup> if you remove all the annotation, the compiler will figure out the proper type
<Drup> in this case, aggelos_ improperly annotated the fold function with a 'nel instead of an 'el
<Drup> the code is too complicated, the types are not
<mrvn> val fold_over :
<mrvn> ('el -> 'nel workfunc_result) ->
<mrvn> 'acc ->
<mrvn> ('acc -> int -> 'nel -> 'acc) ->
<mrvn> ((int * ('acc * ('nel workfunc_result, exn_with_bt) result list) ->
<mrvn> 'el -> int * ('acc * ('nel workfunc_result, exn_with_bt) result list)) ->
<mrvn> int * ('acc * ('nel workfunc_result, exn_with_bt) result list) ->
<mrvn> int * ('acc * ('nel workfunc_result, exn_with_bt) result list)) ->
<Drup> aggelos_: the bottom line is don't annotate like that
<mrvn> 'acc * exn_with_bt list
<mrvn> You consider that a simple type?
nikki93 has left #ocaml [#ocaml]
<Drup> mrvn: give it some type alias and use -short-type
<Drup> it's going to be much smaller
<mrvn> still way to complex code
<Drup> that, I agree
<aggelos_> Drup: sure, was debugging another type issue when I added all those annotations
<Drup> but the type issue come from the annotations
<mrvn> I assumed he added the annotations to figure out some error
<aggelos_> mrvn: the issue here is that I need to add the result to the accumulator asap
<Drup> probably, but he introduced the error we were trying to debug ;)
<aggelos_> mrvn: because this code forks off possibly thousands of processes (only ncores at once though, of course)
<mrvn> aggelos_: why?
<aggelos_> mrvn: memory usage explodes
Eyyub has joined #ocaml
<aggelos_> mrvn: the elements in the hashtable are very large when marshaled (30MB is common)
alpounet has joined #ocaml
<mrvn> you are building 2 lists: One with OK results and one with backtraces. How does building those list earlier save memory?
ontologiae has joined #ocaml
<aggelos_> mrvn: so if I wait until all the results come in, I'm holding N * 30MB in memory at once
<aggelos_> mrvn: it's not about building the lists earlier, it's about doing the f_acc call asap
<aggelos_> mrvn: in either case, the boxed result gets put into the list
<mrvn> aggelos_: because that only saves res.ret instead of the whole res?
<aggelos_> mrvn: no, because the user-supplied accumulator will be doing something like BatHashtbl.replace
<aggelos_> mrvn: so the /old/ version of the structure gets dropped as soon as we have the old one
<mrvn> in map_list you set f_acc to (fun list _ el -> el :: list)
<aggelos_> mrvn: I won't be using map_list any more, that's just to keep the code compiling or for farming out computations that deal with smaller structures
<aggelos_> mrvn: also to verify correctness, of course
<aggelos_> well, test for obvious correctness issues, at least ;)
alpounet has quit [Ping timeout: 272 seconds]
<aggelos_> would have just used BatEnum.t instead of this folder, actually, but might consider submitting the change to forkwork at some point
ontologiae has quit [Ping timeout: 272 seconds]
<Drup> where does forkwork comes from ?
<Drup> (and believe, you don't want to use BatEnum)
<mrvn> And why not let the f_acc deal with the ('a, 'b) results? Maybe it wants to know which elements failed
<mrvn> aggelos_: going back to your ram usage: (f_acc acc i res.ret, result :: results)
<mrvn> aggelos_: you put all the results in the second part of the tuple. So you have the ram usage anyway.
<aggelos_> Drup: some person who put it up on github?
<aggelos_> mrvn: but I do want all the results
<mrvn> aggelos_: but you said you need to call f_acc early so you can free the memory.
<aggelos_> mrvn: say I have N input elemens of a (large) size M
<aggelos_> mrvn: and they're in a hashtable
<aggelos_> mrvn: if I use map_list and then do the replace
<Drup> huum, didn't know this forkwork
<aggelos_> and the work function basically just mangles each element a bit
<aggelos_> mrvn: then, until list_map returns, I'll have in memory /both/ the original version of the N elements /and/ the new one
<aggelos_> mrvn: (there's no sharing, as the results have to be marshaled back)
<aggelos_> mrvn: so what I want to do is to BatHashtbl.replace the old version of an element as soon as the new one comes in
<Drup> aggelos_: are you sure you gain from using forking ?
<aggelos_> Drup: yes
<Drup> ok
<aggelos_> Drup: forking does a pipeline of transformations
<Drup> because marshaling is a performance killer
<aggelos_> Drup: I'm aware, but the numbers are pretty clear
<Drup> ok
<Drup> (I was just making sure you benchmarked it :p)
<aggelos_> Drup: my main concern is that forking kills all sharing, so memory usage increases quite a lot anyway
<Drup> yeah
<mrvn> aggelos_: which you do have anyway I think
<aggelos_> mrvn: I'm sorry? what do I have anyway?
<mrvn> aggelos_: both all the old items and all the new items.
<aggelos_> mrvn: Hashtbl.replace should be dropping the only reference to the old element
<aggelos_> mrvn: so then it will get GC'd at some point
<mrvn> aggelos_: at least the way you use it in map_list you end up with both the input list and output list being alive till fold_over returns.
<aggelos_> mrvn: see above, I won't be using map_list, the code will be updated to use fold_enumerator directly
<aggelos_> mrvn: I mean, the code which currently uses map_list
<aggelos_> thank you both for your help btw
<mrvn> aggelos_: good luck.
<mrvn> when you're done do check that the GC can actually free up stuff like you think.
<aggelos_> mrvn: yah, took me quite some time to find the actual point where memory explosion happens and I'm not even 100% sure my conclusion is correct atm...
<aggelos_> mrvn: honestly, I'm mostly worried about the unsharing :/
<aggelos_> err, a few lines above, I meant the code will be updated to use fold_over, of course (doing that now)
<mrvn> the fold function will keep your input list alive
<aggelos_> mrvn: hmm
<aggelos_> mrvn: that's a good point
<aggelos_> mrvn: so I'd have to do acrobatics where I temporarily stick the elements in a different data structure (possibly an array)... damn
<aggelos_> this is getting hairier and hairier
<mrvn> use an enumeration, not a list
<aggelos_> mrvn: where do you see a list in fold_over?
<Drup> aggelos_: look at recent ephemerons, they might help you out
<mrvn> the fold function
<aggelos_> mrvn: ah you mean for the intermediate data structure?
<aggelos_> mrvn: well, the fold is supplied by the caller and initially I was going to use BatHashtbl.fold
<aggelos_> well, in a lambda to massage the arguments, possibly
<mrvn> is that save to use while you modify the table?
<aggelos_> Drup: ok, dunno what that is
<Drup> basically, weaktbl
eikke_ has joined #ocaml
<aggelos_> mrvn: probably not. would need to get the keys out first then, then fold on those... that would work nicely actually
<aggelos_> Drup: oh k. I don't think it's necessary here
<aggelos_> Drup: or especially convenient
<aggelos_> Drup: oh I see. I'm stuck with 3.12.1 atm, as that's the latest version supported by the framework I'm using
<Drup> (what is the framework ?)
<aggelos_> Drup: http://bap.ece.cmu.edu
<Drup> oh, BAP, yeah
<Drup> what is the issue with newer ocaml version ?
algoriddle has joined #ocaml
<aggelos_> Drup: haven't even investigated. pretty busy building stuff on top of the version that was available a year ago, so...
<Drup> urk, their distribution tarball makes me sad :(
<aggelos_> well at least they do code dumps
<Drup> yeah
<aggelos_> most research code is in the basement behind closed doors and smells pretty bad
<Drup> don't tell me about it =')
demonimin has joined #ocaml
eikke_ has quit [Ping timeout: 244 seconds]
ebzzry has joined #ocaml
darkf has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
Oejet has quit [Quit: Leaving.]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
shinnya has joined #ocaml
racycle has joined #ocaml
ohama has quit [Remote host closed the connection]