swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cdidd has quit [Ping timeout: 260 seconds]
destrius has quit [Ping timeout: 252 seconds]
destrius has joined #ocaml
damason has quit [Ping timeout: 246 seconds]
damason has joined #ocaml
Algebr has quit [Remote host closed the connection]
AltGr has joined #ocaml
psy_ has joined #ocaml
rgrinberg1 has joined #ocaml
darkf has joined #ocaml
shinnya has quit [Ping timeout: 250 seconds]
noplamodo has quit [Ping timeout: 246 seconds]
noplamodo has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
creichert has quit [Quit: Leaving]
The_Mad_Pirate has quit [Quit: Konversation terminated!]
MercurialAlchemi has joined #ocaml
kolko has quit [Ping timeout: 240 seconds]
BitPuffin|osx has quit [Ping timeout: 245 seconds]
rgrinberg1 has quit [Ping timeout: 246 seconds]
BhavyaM has joined #ocaml
kolko has joined #ocaml
rgrinberg1 has joined #ocaml
kolko has quit [Ping timeout: 260 seconds]
kolko has joined #ocaml
cdidd has joined #ocaml
BhavyaM has quit [Quit: Quit the channel]
<flux>
you can, but then you obviously need to memory manage it yourself
<flux>
algebr`, and then there is this option that disables that ability
gpietro has quit [Ping timeout: 246 seconds]
<flux>
algebr`, of course you then cannot also mutate the structure in ocaml, because that data would then also become non-gc'd
Algebr has joined #ocaml
gpietro has joined #ocaml
<flux>
algebr`, oh, and particular, if that data then refers to OCaml heap, the GC will collect it, because to it it looks like data that's not used, thus your structure would then point to invalid memory
<Algebr>
wait, I think I missed something earlier
<Algebr>
How do I give oasis the equivalent of -g on the command line
keen___________2 has joined #ocaml
keen___________1 has quit [Ping timeout: 252 seconds]
noplamodo has quit [Ping timeout: 265 seconds]
noplamodo has joined #ocaml
tmtwd has quit [Remote host closed the connection]
AlexRussia_ has joined #ocaml
tmtwd has joined #ocaml
browncodes has joined #ocaml
KDr2_ has joined #ocaml
xificurC has joined #ocaml
tg has quit [Ping timeout: 252 seconds]
tg has joined #ocaml
Algebr has quit [Remote host closed the connection]
tmtwd has quit [Remote host closed the connection]
xet7 has quit [Ping timeout: 245 seconds]
xet7 has joined #ocaml
Simn has joined #ocaml
ygrek has joined #ocaml
AlexRussia_ has quit [Ping timeout: 240 seconds]
ely-se has joined #ocaml
rgrinberg1 has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
sh0t has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
<Leonidas>
schoppenhauer: isn't extlib dead and superceded by batteries?
paradoja has joined #ocaml
sh0t has quit [Ping timeout: 272 seconds]
tane has joined #ocaml
<companion_cube>
I don't think it's really dead, but indeed it's but a subset of batteries
obadz- is now known as obadz
<flux>
if one is writing a library, extlib might sound like a nicer, smaller dependency
<flux>
at least if one has the version that doesn't collide with camomile :), or whatwasit
dsheets has quit [Ping timeout: 246 seconds]
obadz- has joined #ocaml
paradoja has quit [Ping timeout: 240 seconds]
obadz has quit [Ping timeout: 255 seconds]
tibor has joined #ocaml
<tibor>
Hi
<companion_cube>
hi
<tibor>
May I have a technical question about OCaml here?
<companion_cube>
sure, go on
<flux>
tibor, certainly :)
<Leonidas>
I thought this channel was just for philosophical questions about OCaml.
<companion_cube>
OCaml is only for objective philosophers of the family of camelides
<companion_cube>
;)
<tibor>
I have a variant type which contains another variant type and I would like to create an element which type is the first variant type, but inside has the second variant type. How can I do this?
<tibor>
OK
<tibor>
:(
<companion_cube>
could you give more details about your types?
<companion_cube>
type a = A type b = B of a ?
alinab has quit [Ping timeout: 272 seconds]
<tibor>
type A = B1 of b1 | B2 of b2;;
<tibor>
type B1 = C1 of c1 list;;
<flux>
type names are lowercase
<tibor>
type B1 = C1 of c1 list | C2 of c2;;
<companion_cube>
ok, so a contains b1 as a sub-case, fine
<tibor>
ok :( I'm sorry, I'm a begginer :(
<companion_cube>
no problem
<tibor>
type a = B1 of b1 | B2 of b2;;
<companion_cube>
you might want to use a toplevel to test things quickly, if you don't already
yomimono has joined #ocaml
<tibor>
Yes :)
<companion_cube>
good!
<flux>
tibor, once you get the types working, you construct them like: B1 (C1 [])
<flux>
truth to be told I would expect any ocaml tutorial to explain this.. :)
<tibor>
thank you :( I'm sorry for this question :(
<flux>
I haven't read it, but I understand it's a fine book
paradoja has joined #ocaml
<companion_cube>
no, it's good, I think
<tibor>
Thank you
<tibor>
Do you have some good tips for debugging? (Tools for tracing profiling and ...)
<companion_cube>
mosly, for me, enabling backtraces and using print statements
obadz- is now known as obadz
<tibor>
:) OK :) Thank you
<Leonidas>
yes, especially profiling is kinda meh
<Leonidas>
debugging can be neat, because the debugger can step back in time
octachron has joined #ocaml
bobry has joined #ocaml
<gasche>
for time profiling I use gprof or (linux) perf, and it has served me well
<gasche>
for memory-profiling there is ocp-memprof which seems nice (but I have never done memory profiling myself)
<gasche>
(I've used the "poor man profiler" trick for profiling as well, and it worked nicely as well, giving stack traces for the hot spots)
<Leonidas>
I was never able to get gprof to display me the correct timing information
<companion_cube>
same for me
<companion_cube>
and I never got anything but assembly out of perf :/
<companion_cube>
(I probably use it wrong)
<companion_cube>
oh, hi gasche
jonludlam has joined #ocaml
jonludlam has quit [Client Quit]
Haudegen has quit [Ping timeout: 246 seconds]
ski has quit [Ping timeout: 264 seconds]
ski has joined #ocaml
Haudegen has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
paradoja has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 240 seconds]
rgrinberg1 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 250 seconds]
<tibor>
Thank you all for the advice
tane has quit [Quit: Verlassend]
kakadu has joined #ocaml
ollehar has joined #ocaml
noplamodo has quit [Ping timeout: 250 seconds]
noplamodo has joined #ocaml
jbrown has quit [Remote host closed the connection]
KDr2_ has quit [Remote host closed the connection]
AlexRussia_ has joined #ocaml
ollehar has quit [Quit: ollehar]
noplamodo has quit [Ping timeout: 244 seconds]
obadz has quit [Ping timeout: 255 seconds]
noplamodo has joined #ocaml
ely-se has quit [Quit: leaving]
obadz has joined #ocaml
obadz has quit [Ping timeout: 265 seconds]
Anarchos has joined #ocaml
obadz has joined #ocaml
browncodes has quit [Remote host closed the connection]
rossberg has quit [Remote host closed the connection]
rossberg has joined #ocaml
jonludlam has joined #ocaml
nullcatxxx_ has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
flx has joined #ocaml
flx_ has joined #ocaml
orbitz has quit [Ping timeout: 244 seconds]
flux has quit [Ping timeout: 256 seconds]
flx is now known as flux
lupine has quit [Ping timeout: 246 seconds]
psy_ has quit [Ping timeout: 246 seconds]
sgnb has quit [Ping timeout: 246 seconds]
merry has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
merry has joined #ocaml
orbitz has joined #ocaml
flxx has quit [Ping timeout: 252 seconds]
sgnb has joined #ocaml
flxx has joined #ocaml
noplamodo has quit [Ping timeout: 250 seconds]
mawuli has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
cschneid has quit [Ping timeout: 246 seconds]
jyc has quit [Ping timeout: 246 seconds]
flx has joined #ocaml
noplamodo has joined #ocaml
jeroud has quit [Read error: Connection reset by peer]
bobry has quit [Read error: Connection reset by peer]
flx_ has quit [Ping timeout: 246 seconds]
flux has quit [Ping timeout: 246 seconds]
flx is now known as flux
bobry has joined #ocaml
jeroud has joined #ocaml
cschneid has joined #ocaml
psy_ has joined #ocaml
lupine has joined #ocaml
jyc has joined #ocaml
mawuli has joined #ocaml
bobry has quit [Quit: Connection closed for inactivity]
<Drup>
perf works just fine, you need to use a switch with frame pointers
<Drup>
well, not need, but it gives the graph, like gprof does
rgrinberg1 has joined #ocaml
igoroliveira has joined #ocaml
rgrinberg1 has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 260 seconds]
BitPuffin has joined #ocaml
jonludlam has quit [Ping timeout: 264 seconds]
johnelse has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
tane has joined #ocaml
tane has quit [Read error: Connection reset by peer]
paradoja has joined #ocaml
johnelse_ has joined #ocaml
Guest74677 has joined #ocaml
ely-se has joined #ocaml
ely-se has quit [Client Quit]
siddharthv_away has quit [Ping timeout: 246 seconds]
siddharthv_away has joined #ocaml
Guest74677 has quit [Ping timeout: 264 seconds]
rgrinberg1 has joined #ocaml
ely-se has joined #ocaml
ely-se has quit [Client Quit]
rgrinberg1 has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
ggole has joined #ocaml
ananas__ has joined #ocaml
tennix has joined #ocaml
<ananas__>
Hi! A question for the OASIS users: is there a way to tell oasis to use "ocamlfind ocamlc -config" instead of "ocamlc -config" to generate its setup.data ? I use a certain OCAMLFIND_TOOLCHAIN.
<companion_cube>
Drup: interesting
<companion_cube>
is there any doc/blog post... about using perf, in particular for OCaml ?
<Drup>
any perf manual ?
<Drup>
there is pretty much nothing ocaml specific
<Drup>
except the weird naming convention maybe, but you can get it pretty quickly
<Drup>
"perf record -- ..."
<Drup>
"perf report"
<Drup>
IIRC
<companion_cube>
ok, then the only thing to know is to use frame pointers :)
<Drup>
if you want the graph
<Drup>
if you don't care and just want the toplevel call, then you don't need it
<def`>
--call-graph=dwarf
<def`>
to get a graph with normal compiler and debug symbols
<Drup>
def`: that's equally reliable ?
paradoja has quit [Ping timeout: 272 seconds]
<def`>
Drup: in my experience, yes (provided recent kernel & compiler)
<Drup>
(if yes, why were frame pointers introduced in ocaml to begin with ?)
<def`>
(I can't answer)
ely-se has joined #ocaml
<flux>
maybe perf wasn't always able to do that?
ely-se has quit [Client Quit]
<flux>
a perf presentation from 2010 says "needs -fno-omit-frame-pointer"
<Drup>
flux: that's for the compiler yeah, there are opam switches with the option enabled
<flux>
it seems DWARF unwind support for perf tools was implemented at Jan 2014
<companion_cube>
oh wow, nice, def`'s option works
<def`>
tada!
<companion_cube>
in the sense that I can unfold the function calls
paradoja has joined #ocaml
<Drup>
I don't remember if there is a dot output to have a real graph
tmtwd has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
tmtwd has quit [Ping timeout: 244 seconds]
jao has quit [Ping timeout: 246 seconds]
paradoja has quit [Ping timeout: 245 seconds]
jonludlam has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
jonludlam has quit [Remote host closed the connection]
kushal has joined #ocaml
paradoja has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
rgrinberg1 has joined #ocaml
kushal has quit [Ping timeout: 246 seconds]
segmond has quit [Ping timeout: 246 seconds]
lupine has quit [Ping timeout: 246 seconds]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
<Enjolras>
this backlog is the best read of the month ! I didn't know that you could get a callgraph with perf for ocaml, only the statistical call list
_andre has quit [Ping timeout: 265 seconds]
<companion_cube>
yeah, it's nice
<companion_cube>
profiling ++
<Drup>
I used that a lot (in combination with christophe's benchmark package) to optimize lilis, it's nice, yeah
segmond has joined #ocaml
<rgrinberg1>
companion_cube: hi
_andre has joined #ocaml
tennix has joined #ocaml
lupine has joined #ocaml
jonludlam has joined #ocaml
ely-se has joined #ocaml
kushal has joined #ocaml
jonludlam has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
kdas_ has joined #ocaml
tennix has quit [Ping timeout: 260 seconds]
ely-se has quit [Quit: leaving]
jeffmo_ has joined #ocaml
tmtwd has joined #ocaml
ryanartecona has joined #ocaml
kushal has quit [Disconnected by services]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
tennix has joined #ocaml
Sim_n has joined #ocaml
flx has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
mort___ has quit [Ping timeout: 244 seconds]
abbe has quit [Ping timeout: 246 seconds]
Leonidas has quit [Ping timeout: 246 seconds]
Simn has quit [Ping timeout: 244 seconds]
Leonidas has joined #ocaml
flxx has quit [Ping timeout: 240 seconds]
abbe has joined #ocaml
mort___ has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
noplamodo has quit [Ping timeout: 252 seconds]
Guest11361 has quit [Quit: Nettalk6 - www.ntalk.de]
noplamodo has joined #ocaml
ely-se has joined #ocaml
ely-se has quit [Client Quit]
jeffmo_ has quit [Quit: jeffmo_]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tmtwd has joined #ocaml
kushal has quit [Quit: Leaving]
mort___ has quit [Ping timeout: 244 seconds]
lyxia has quit [Ping timeout: 246 seconds]
lyxia has joined #ocaml
rgrinberg1 has quit [Ping timeout: 265 seconds]
mort___ has joined #ocaml
Denommus has joined #ocaml
zpe has quit [Remote host closed the connection]
rgrinberg1 has joined #ocaml
AltGr has left #ocaml [#ocaml]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
mort___ has quit [Quit: Leaving.]
ollehar has joined #ocaml
ollehar has quit [Ping timeout: 260 seconds]
<schoppenhauer>
are bigarrays always initialized with zeroes?
ollehar has joined #ocaml
ollehar has quit [Client Quit]
<schoppenhauer>
I mean the ones created with Array1.create
paradoja has quit [Ping timeout: 260 seconds]
ollehar has joined #ocaml
JuggleTux has joined #ocaml
<gasche>
14:43 < Drup> (if yes, why were frame pointers introduced in ocaml to begin with ?)
ryanartecona has joined #ocaml
<gasche>
I'd like to point out that frame pointers were not introduced in OCaml upstream
<flux>
nope.. my callback doesn't seem to get called when the connection closes on error?
jonludlam has quit [Ping timeout: 245 seconds]
dsheets has quit [Ping timeout: 245 seconds]
yomimono has joined #ocaml
Denommus has joined #ocaml
<maurer>
Does anyone know how expensive caml_aquire_runtime and release are?
<maurer>
I'm binding an OCaml library as a C library, and I'm wondering whether it makes sense to just put those around my exported C functions by default, or if I should have two versions, one which auto acquires/releases, and one which does not do either in case someone wants to use a dedicated call thread
ananas__ has quit [Quit: Leaving]
ggole has quit []
Pepe_ has quit [Ping timeout: 260 seconds]
Pepe_ has joined #ocaml
kushal has quit [Ping timeout: 250 seconds]
<mrvn>
maurer: put it around anything that blocks
<mrvn>
or may block
<mrvn>
or takes time
<mrvn>
The call itself is cheap but it would be pointless to use it when the function takes no time.
kushal has joined #ocaml
<maurer>
mrvn: Wrong direction - I've got a C-main, and sometimes it calls OCaml
<maurer>
mrvn: So these functions have to be called, it's just a matter of whether small blocks or big blocks of holding the lock will be used
<mrvn>
then you must aquire it
rgrinberg1 has quit [Ping timeout: 260 seconds]
<mrvn>
you may only access ocaml values or call ocaml code while holding the lock
<maurer>
Yes, I'm wondering how bad of a performance impact writing porcelain code so that users don't have to manage the lock would be
<mrvn>
but if you aren't doing multithreading you can hold it forever.
<maurer>
The very first application I am building wants to multithread
<maurer>
:P
<maurer>
But it's a question of whether I should make users do "acquire, libfunc1, libfunc2, release"
<maurer>
or if I should put acquire/release into libfunc1 and libfunc2 so that the users will do "libfunc1, libfunc2" which has a suprious release/acquire, but is easier for users to get right and simpler to write
<maurer>
(the users of this code don't know it's OCaml, so any rules I have about how to use the code have to be explained to them)
<mrvn>
I would put it in there. you can't know what users will do and without the lock it will crash and burn.
<maurer>
OK. If release/acquire were expensive, then putting it in there would seem pretty bad
ananas__ has joined #ocaml
<maurer>
but I'll put it in there
<mrvn>
it just toggles a pthread mutex. Not too cheap but not to expensive either.
<ananas__>
Sorry for bothering you with a stupid question, but how should I read the standard output/error of a command ? Sys.command only returns its code.