mjonsson_ has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 244 seconds]
joewilliams_away is now known as joewilliams
Tobu has quit [Read error: Connection reset by peer]
cthuluh has joined #ocaml
joewilliams is now known as joewilliams_away
ulfdoz has joined #ocaml
<adrien>
gah, crap
<adrien>
I copied the faulting ocaml (from obj.c) function to lablgtk's code and compiled it with -g, and now instead of giving me a backtrace, it exits normally with a kind of assert failure, guess I'll see that later on
ulfdoz has quit [Ping timeout: 260 seconds]
edwin has joined #ocaml
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
zorun has joined #ocaml
ftrvxmtrx has joined #ocaml
avsm has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
mfp has quit [Read error: Connection reset by peer]
Tobu has joined #ocaml
mfp has joined #ocaml
ikaros has joined #ocaml
wormphlegm has quit [Ping timeout: 244 seconds]
Obfuscate has quit [Remote host closed the connection]
avsm1 has quit [Quit: Leaving.]
edwin has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
ikaros has quit [Quit: Ex-Chat]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
larhat has joined #ocaml
Tobu has quit [Ping timeout: 258 seconds]
avsm has joined #ocaml
ftrvxmtrx has joined #ocaml
Anarchos has joined #ocaml
alfa_y_omega has quit [Ping timeout: 240 seconds]
Amorphous has quit [Ping timeout: 255 seconds]
alfa_y_omega has joined #ocaml
alfa_y_omega has quit [Excess Flood]
Amorphous has joined #ocaml
<adrien>
I think I found out why I was having a segfault from ocaml's code (in caml_get_public_method): I was calling Gc.compact while lablgtk was calling C code which was calling back ocaml code, which is exactly what must not be done iirc
<adrien>
still have a segfault inside gtk+ however
<flux>
I was under the impression Gc.compacting doesn't work with lablgtk at all?
edwin has joined #ocaml
<adrien>
I understood it as not being automatically triggered, but calling Gc.compact still lets you shoot yourself in the face
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
lopex has joined #ocaml
alfa_y_omega has joined #ocaml
Obfuscate has joined #ocaml
Obfuscate has quit [Client Quit]
Obfuscate has joined #ocaml
mfp has quit [Ping timeout: 255 seconds]
mfp has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
mfp has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 255 seconds]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
<gildor>
adrien: you are an expert at callback from C code ?
<adrien>
gildor: it's the first time I do one, and parts of the job was already done by lablgtk
<gildor>
any source code that I should look at to know what should be done
<gildor>
?
<gildor>
I pass cbk to a C function, wish use caml{enter/leave]blocking_section
<adrien>
you're having a particular issue?
<gildor>
no I am starting it
Anarchos has joined #ocaml
cthuluh has joined #ocaml
<adrien>
hmmm, don't really know, I can see lablgtk use callback_exn* but I'm not sure how it builds the arguments (does it even need to build anything?)
<gildor>
Seems like ml_g_timeout_add match my need
lamawithonel has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Client Quit]
alfa_y_omega has quit [Read error: Operation timed out]
alfa_y_omega has joined #ocaml
iratsu has quit [Ping timeout: 240 seconds]
iratsu has joined #ocaml
ymasory has joined #ocaml
Anarchos has quit [Ping timeout: 252 seconds]
iratsu has quit [Quit: Leaving.]
iratsu has joined #ocaml
Cyanure has joined #ocaml
lopexx has joined #ocaml
iratsu has quit [Client Quit]
lopex has quit []
lopexx has quit []
lopex has joined #ocaml
iratsu has joined #ocaml
sepp2k has joined #ocaml
joewilliams_away is now known as joewilliams
ymasory has quit [Quit: Leaving]
hyperbor1ean is now known as hyperboreean
larhat has quit [Quit: Leaving.]
Anarchos has joined #ocaml
chambart has quit [Ping timeout: 276 seconds]
chambart has joined #ocaml
chambart has quit [Ping timeout: 240 seconds]
chambart has joined #ocaml
ulfdoz has joined #ocaml
avsm is now known as avsm^away
rgee has quit [Ping timeout: 258 seconds]
rgee has joined #ocaml
cthuluh has quit [Remote host closed the connection]
alfa_y_omega has quit [Ping timeout: 260 seconds]
alfa_y_omega has joined #ocaml
ikaros has joined #ocaml
alfa_y_omega has quit [Max SendQ exceeded]
alfa_y_omega has joined #ocaml
jamii has joined #ocaml
rgee has quit [Ping timeout: 244 seconds]
jamii has quit [Ping timeout: 258 seconds]
jamii has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
jamii has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
sepp2k has quit [Ping timeout: 255 seconds]
jamii has quit [Ping timeout: 258 seconds]
<adrien>
great, I now have a gtk+2 package built with -g3 -ggdb and I know which line my program is segfaulting on but that simply doesn't help me at all
jamii has joined #ocaml
rgee has joined #ocaml
<thelema_>
because it's something innocuous?
<adrien>
"if (height != GTK_RBNODE_GET_HEIGHT (node))", I guess it goes with their rb-tree, but I have no idea why they have an rb-tree :-)
<thelema_>
node = null?
<adrien>
node=0x8804a0, but maybe it has been freed
<adrien>
maybe valgrind can help
* NaCl
wonders why I can't find lwt-2.3.1 anywhere
<adrien>
just went to ocsigen.org, some people are skilled :P
<thelema_>
they are used differently in that example.
<adrien>
#event#connect#delete maybe?
<thelema_>
that said, I don't want a non-closable window, I want to close my window and stop the event loop...
<thelema_>
adrien: ah, thank you
<adrien>
np
* adrien
thanks grep in return
<adrien>
really needs a system to get a path from an object to a method, based on their names/types
<thelema_>
yes, the inheritance in lablgtk is crazy. maybe with enough experience it categorizes things nicely. not yet for me.
ftrvxmtrx has joined #ocaml
<NaCl>
gildor: seems that ocaml-type-conv has branched a bit
<adrien>
hard to categorize things nicely with "misc" and "event"
<_habnabit>
`let x (y :> z) = y` is a syntax error. how am I supposed to write this?
<thelema_>
let x y = (y :> z)
<_habnabit>
ah, I see.
<thelema_>
(expr :> type)
<_habnabit>
so, if I needed to do y#foo, it would be `let x y = let y' = (y :> z) in y'#foo` ?
<thelema_>
sure. or `let x y = (y :> z)#foo`
<_habnabit>
sure, yeah.
<_habnabit>
hm, this doesn't seem to solve the issue I was having. I'll post some code after lunch.
<thelema_>
`let x y = (y : z1 :> z2)#foo` maybe
bzzbzz has quit [Ping timeout: 260 seconds]
Cyanure has quit [Remote host closed the connection]
lopexx has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
lopex has quit [Ping timeout: 250 seconds]
lopexx has quit [Client Quit]
lopex has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
jamii has joined #ocaml
cthuluh has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz has joined #ocaml
<NaCl>
gildor: ocaml-data-notation does not compile with type-conv-3,0.0
<NaCl>
*3.0.0
ulfdoz has quit [Quit: deprecated]
<_habnabit>
is there a way to signify that a function takes a type or any subtypes of that type?
<NaCl>
let f (arg:some_type_here) = ... ;;
<NaCl>
not sure if that gets subtypes, though
<_habnabit>
it doesn't, no.
<NaCl>
then I have no idea. :P
<sheets>
_habnabit: type q= {q : 'a. (#ob as 'a) -> 'a }
ulfdoz has joined #ocaml
<sheets>
i think this should work for methods as well but i've not been able to make it happen so i use a record to encapsulate the polymorphism as suggested by thelema_
<_habnabit>
hm, I got "this type scheme cannot quantify 'a". let me put together a minimum working example.
<sheets>
specifically: "The type #point used below in the constraint clause is an abbreviation produced by the definition of class point. This abbreviation unifies with the type of any object belonging to a subclass of class point."
<_habnabit>
aha.
<sheets>
That is, #ob is the type of class 'ob' with the row variable included.
<sheets>
dunno if there is a better explanation of it somewhere else :-/
zorun has quit [Quit: leaving]
<_habnabit>
hm, this seems to require a polymorphic class.
<_habnabit>
parameterized class?
<_habnabit>
I don't know what the name for `class ['a] ...` is.
<thelema_>
polymorphic
<thelema_>
_habnabit: what are you trying to do, at a high level?
<_habnabit>
thelema_, I have two kinds of trees, where both have a #get_bl method that returns a float. I'm trying to make a method that takes either kind of tree.
<_habnabit>
since all it needs to do is call #get_bl a few times.
<thelema_>
# let x y = y#get_bl +. 0.0;;
<thelema_>
val x : < get_bl : float; .. > -> float = <fun>
<_habnabit>
yeah, and I have a method that does that. one moment; I'll get the original error.
<sheets>
or wrap it in a record so that your user-class can type
ftrvxmtrx has quit [Quit: Leaving]
zorun has joined #ocaml
<sheets>
i messed with the method polymorphism stuff for several hours a few weeks ago and could not get it to work correctly. in the end, i resorted to using the wrapping record and it works ok if a bit verbose
<thelema_>
as this: method distance : ’a. (#point0 as ’a) -> int = fun other -> abs (other#get_x - x)
<thelema_>
(you may substitute the type ocaml gives you for #point0)
<_habnabit>
aha.
bzzbzz has joined #ocaml
<_habnabit>
... this isn't new in 3.12, is it?
<sheets>
nope
<_habnabit>
yeesh. it works in my minimal reproduction, but not in my real code.
<sheets>
have you tried the record-based quantification?
<thelema_>
what's the real code error?
<_habnabit>
sheets, how exactly would you do that?
<sheets>
no, i mean, 17 is a method returning a float?
<sheets>
or a method returning a foo -> float function?
<_habnabit>
the latter.
<_habnabit>
... ah, hm.
Tobu has joined #ocaml
<_habnabit>
no; no change if I use fun instead.
<thelema_>
fun fv -> ?
<_habnabit>
the `flag` function builds a record type; `fv` pulls something out of it.
<thelema_>
what about `method get_normalization : 'a. ((#Newick_bark.bewick_bark as 'a) Gtree.gtree -> float =
philtor has joined #ocaml
<_habnabit>
do you mind if I post ~3 lines to the channel, or should I keep using a pastebin for everything?
<thelema_>
_habnabit: 3 lines seems reasonable
<_habnabit>
Error: This method has type #Newick_bark.newick_bark Gtree.gtree -> float
<_habnabit>
which is less general than
<_habnabit>
'a. (#Newick_bark.newick_bark as 'a) Gtree.gtree -> float
<thelema_>
more than 5 - probably better to paste
<_habnabit>
okay.
<thelema_>
hmmm...
<sheets>
So the type of your StringMap isn't sufficiently polymorphic
iratsu has joined #ocaml
<_habnabit>
is that it?
<sheets>
I assume it's holding these polymorphic functions from obj hier to float?
<_habnabit>
hm, I think I finally reproduced this in my minimal case.
<_habnabit>
... or not, since it compiled with `((#c1 as 'a) container)`
<sheets>
you need to make the type of the values of your string map into records that has a universally quantified function field
<thelema_>
_habnabit: try using a record to keep the polymorphism so you can store the functions in your StringMap
<sheets>
type q = {q: 'a. #ob as 'a -> float }
<_habnabit>
oh, is that what you were suggesting before?
<sheets>
yes
<_habnabit>
is there a document about that, or at least an example of usage?
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
jamii has joined #ocaml
Tobu has quit [Read error: Connection reset by peer]
jderque has quit [Quit: leaving]
ftrvxmtrx has joined #ocaml
edwin has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
alexyk has joined #ocaml
ztfw has quit [Remote host closed the connection]
lamawithonel has quit [Read error: Connection reset by peer]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
alfa_y_omega has quit [Ping timeout: 255 seconds]
bzzbzz has quit [Quit: leaving]
ulfdoz has quit [Ping timeout: 252 seconds]
Guest58407 has joined #ocaml
<_habnabit>
well, I ended up fixing it thusly: `method get_normalization: <get_bl: float; ..> Gtree.gtree -> float = ...`
<_habnabit>
apparently ocaml is satisfied with that.
<thelema_>
really? nice.
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
alfa_y_omega has joined #ocaml
alfa_y_omega has quit [Excess Flood]
alfa_y_omega has joined #ocaml
willb has joined #ocaml
alfa_y_omega has quit [Ping timeout: 240 seconds]
alfa_y_omega has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
jamii has quit [Ping timeout: 258 seconds]
Tobu has joined #ocaml
lamawithonel has joined #ocaml
<_habnabit>
is there a way to get a full traceback with `OCAMLRUNPARAM=b` with a native binary? I'm having a problem with ocamlgsl that I can't reproduce with a .d.byte.
<thelema_>
_habnabit: make sure everything is compiled with debugging on
<_habnabit>
I'm using ocamlbuild. is there a tag for that, then?
<thelema_>
true: debug
<_habnabit>
okay.
<_habnabit>
hm, it has /more/ frames but it still seems to be missing frames.
<thelema_>
make sure your libraries are compiled with -g
<_habnabit>
even within the same project, though. hm.
<thelema_>
I only recently learned there's no runtime penalty for this unless debugging is enabled at the toplevel
<thelema_>
it's possible inlining is killing some of your expected frames
<thelema_>
-inline 0
<_habnabit>
is that an ocamlopt flag?
<thelema_>
there's no way to completely prevent inlining, this minimizes it
<thelema_>
yes
<_habnabit>
okay.
<thelema_>
ocaml will always inline functions whose body is shorter than the call site
<_habnabit>
well, that explains a lot of things.
<_habnabit>
can't imagine why gsl would work differently in native code vs. bytecode, though.
<_habnabit>
it must still be inlining things.
<_habnabit>
let's see if I can get this down to a minimal example.