emmanuelux has quit [Read error: Connection reset by peer]
bohanlon has joined #ocaml
boscop_ has quit [Ping timeout: 246 seconds]
boscop_ has joined #ocaml
philtor has joined #ocaml
<NaCl>
Is there a way to make arguments "required" in the Arg module?
ymasory has joined #ocaml
ymasory has quit [Read error: Connection reset by peer]
ymasory has joined #ocaml
joewilliams is now known as joewilliams_away
<thelema>
NaCl: fail if a certain option isn't set
<NaCl>
kk
lamawithonel has quit [Ping timeout: 246 seconds]
lamawithonel has joined #ocaml
ankit9 has joined #ocaml
dnolen has quit [Quit: dnolen]
lamawithonel has quit [Ping timeout: 246 seconds]
lamawithonel has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
hto_ has quit [Ping timeout: 246 seconds]
lamawithonel has joined #ocaml
hto has joined #ocaml
lamawithonel has quit [Ping timeout: 246 seconds]
lamawithonel has joined #ocaml
schme has quit [Ping timeout: 260 seconds]
schme has joined #ocaml
schme has quit [Changing host]
schme has joined #ocaml
vivanov has joined #ocaml
vivanov has quit [Ping timeout: 240 seconds]
ymasory has quit [Quit: Leaving]
vivanov has joined #ocaml
boscop_ is now known as boscop
vivanov has quit [Ping timeout: 260 seconds]
eye-scuzzy has quit [Ping timeout: 248 seconds]
joelr has joined #ocaml
ygrek has joined #ocaml
petebu has quit [Read error: Connection reset by peer]
ulfdoz has quit [Read error: Operation timed out]
petebu has joined #ocaml
jderque has joined #ocaml
vivanov has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
lamawithonel has quit [Ping timeout: 246 seconds]
petebu has quit [Read error: Connection reset by peer]
vivanov has quit [Remote host closed the connection]
petebu has joined #ocaml
<joelr>
good morning
<joelr>
folks, how is the ocaml option type represented on the C side?
lamawithonel has joined #ocaml
<joelr>
never mind, found it
<adrien>
=)
<adrien>
I like fmonnier's page, it has a nice list of translations
ygrek has quit [Ping timeout: 246 seconds]
Cyanure has joined #ocaml
vivanov has joined #ocaml
penryu` has joined #ocaml
penryu` has quit [Client Quit]
<joelr>
adrien: im looking at that page but it's still unclear to me how to store a variant into the (Some x) in C
<joelr>
it sounds like i need to allocate a block for that but i'm not sure
vivanov has quit [Ping timeout: 276 seconds]
hto has quit [Ping timeout: 260 seconds]
larhat has joined #ocaml
<joelr>
larhat: ping
<larhat>
joelr: pong
<joelr>
larhat: are you working with zmq on windows?
<joelr>
larhat: did you have any issues with oasis when ocaml-zmq was using it? i
<joelr>
i'm wondering why pedro chose to switch away from oasis
<larhat>
no, i haven't tried to build zmq on windows, but people in zmq mailing list sometimes write about it. No, I didn't have any issues with oasis in zmq. as far as i remember, pedro claimed that oasis generates to many files for small project.
<larhat>
there was discussion on this channel about it
chegibari has joined #ocaml
<chegibari>
Hello. Are numeric values tagged in ocaml?
<flux>
chegibari, integers are not tagged. but all values have one bit for indicating whether they are tagged or not, and therefore integers are 31 bits wide.
<flux>
(or 63)
<chegibari>
and how is the int32 type implemented?
<chegibari>
maybe in the reference manual I'll find something about that
<chegibari>
flux: thanks
ankit9 is now known as ankit9|away
oriba has joined #ocaml
oriba has quit [Remote host closed the connection]
eye-scuzzy has joined #ocaml
ikaros has joined #ocaml
<flux>
chegibari, int32 is tagged
ikaros has quit [Quit: Ex-Chat]
ikaros has joined #ocaml
<joelr>
larhat: i'm gonna put oasis back
<joelr>
larhat: it's a risk that pedro won't take it but ... i already changed the typing of the whole ZMQ module to accommodate poll so that's a much bigger risk, personally. i'm adding unit tests now
<joelr>
and i really don't want to mess with makefiles when oasis is so simple
<flux>
I can easily understand why making many makefiles is an easy approach for a program, makefiles don't really support internal modularity..
<flux>
(I don't know what oasis does, though, I haven't used it :-o)
<larhat>
joelr: i like it, but isn't that mean, that we will have three versions of zmq bindings?
<joelr>
larhat: your lwt version being one?
<flux>
btw, pgocaml is something to learn from: it is functorized to support any kind of monad
<larhat>
joelr: no, my lwt version is thin layer on top of plain zmq library (currently pedro's ocaml-zmq). There is Caravan.
<joelr>
larhat: let's just say that i like ocaml-zmq and we are building an ad network around it.
<joelr>
larhat: given this, i'm tailoring it to our needs while keeping pedro's spirit
<larhat>
:-) and last time, when i tried to build caravan, i failed
<joelr>
larhat: one of our needs is to be able to use poll. this required me to first fix poll and then change the typing of the module. it also required me to add unit tests.
<joelr>
if i have to fork ocaml-zmq to have what we need for our production use then i have no qualms about doing that
<joelr>
i will try to encourage pedro to accept my changes of course
<larhat>
i like your changes (and returning of oasis) and i hope that pedro will merge ocaml-zmq with your fork
<joelr>
but if fragmentation is needed to meet my goals then ... so be it :-(
<joelr>
larhat: you like the new typing?
<joelr>
larhat: what makes you like it?
<larhat>
i like poll on different types and unit tests, typing is low-level thing
<joelr>
larhat: great, thanks
jderque has quit [Quit: leaving]
vivanov has quit [Ping timeout: 240 seconds]
<gildor>
joelr, flux, larhat: I don't understand why pedro think oasis generate too many files for small projects
<gildor>
it needs 2 files: _oasis and setup.ml
<joelr>
me neither and i like how ocaml projects are switching to oasis
<joelr>
en masse
<gildor>
the rest of the files generated are for ocamlbuild (mandatory)
<joelr>
gildor: what do you think of distributing the Makefile as well
<joelr>
saves you from typing all those ocaml setup.ml ... commands
<gildor>
joelr: this can be confusing to have makefile and oasis
<larhat>
joelr: DevFiles plugin does it!
<joelr>
actually, i think makefile should always be distributed
<joelr>
but that's my personal opinion
<joelr>
that's how i'm doing it
<gildor>
joelr: a good example is ocaml itself that distributes makefiles and ocamlbuild files
<larhat>
with DevFiles oasis generates makefile that runs ocaml setup.ml … for you
<flux>
ocaml can be compiled with ./configure && make
<joelr>
larhat: that's what i'm doing, yes
<gildor>
joelr: this just generates twice as many bugs
<flux>
as should every project ;)
<flux>
system admins being told to install package X into the system don't really appreciate when packages don't work that way ;)
<gildor>
larhat: I always use DevFiles plugin as well
<joelr>
gildor: so you suggest that i rename to stubs library, right? ZMQB, for example
<gildor>
joelr: I think the problem comes from the name of the C binding library (libZMQ.a)
<joelr>
yes, indeed
<joelr>
darn
<flux>
heyy, I used to have the same problem in my bindings :)
<flux>
(without oasis)
<gildor>
it is probably not a problem on case sensitive fs, but on e.g. Mac you can have a pb
<joelr>
yay, that did it!
<joelr>
Library ZMQB did it
<gildor>
joelr: there is a patch that will rename the binding using _stub
<gildor>
so you won't even have to rename the module
<joelr>
gildor: so you suggest that i only check in (to distribute) setup.ml and _oasis itself, right? and maybe makefile
<gildor>
joelr: due in version 0.2.1
<joelr>
what about META, clib, etc
<gildor>
joelr: I have no strong opinion on this points
<joelr>
ok
<gildor>
joelr: my personnal scheme is to check in at least a version of .clib, META et al
<gildor>
joelr: and use setup-dev
<joelr>
ok
<gildor>
joelr: but this will probably evolve,
<gildor>
joelr: the problem with my scheme is that if somebody check out your source, generated with setup-dev, he will need oasis
<flux>
I think it's not a problem. it's the same that can happen with gnu autotools
<joelr>
gildor: well, i use 'oasis setup'
<gildor>
joelr: I am thinking of generating a setup-dev that look for oasis, and fallback to non setup-dev if it cannot found it
<joelr>
my impression was that oasis won't be needed in this case. am i wrong?
<joelr>
gildor: yes, that would be helpful
<flux>
(ie. the version control repo may not have a configure script, but instead autogen.sh that generates all that, but requires autoconf&make to be around)
<gildor>
joelr: if you use 'oasis setup', you should checkin all files generated
<joelr>
point taken
<gildor>
joelr: yes in the case of 'oasis setup', you don't need oasis
<joelr>
ok
<gildor>
flux: indeed, that was my thought when I design it, but people complain that oasis is not as common as autoconf
vivanov has quit [Ping timeout: 246 seconds]
vivanov has joined #ocaml
Sebi2011 has quit [Ping timeout: 264 seconds]
petebu has quit [Ping timeout: 240 seconds]
petebu has joined #ocaml
jderque has joined #ocaml
<joelr>
larhat: can you take a quick look at what i'm doing?
<larhat>
yes, i can try
mfp has quit [Ping timeout: 246 seconds]
<joelr>
sec, let me check it in
<joelr>
larhat: just pushed my tests branch. my new poll is not working for some reason (poll.c)
vivanov has quit [Remote host closed the connection]
vivanov has joined #ocaml
<larhat>
joelr: it returns poll_event array. why are you returning None. if no events happened? afaik, other bindings returns something only if there are some events occurred.
<joelr>
larhat: I'm returning an array of event option, matching in length the mask array
<joelr>
why?
<joelr>
because zmq, for example, modifies the flags in the same array and you can instantly figure out what socket this happened on
<joelr>
with previous poll you would get an array of sockets that events happened on but this would not be the same socket that you put in, e.g. the phantom type is stripped
<joelr>
you no longer know if it was a `Sub or a `Pull, etc.
<joelr>
and when matching on the returned array of poll items you relied on (structured?) equality, e.g. on that ocaml could figure out that the type-stripped socket was equal to the original one
<joelr>
larhat: with my new approach, you put in a mask of N items and you get back an event array of the same N items with either None if no events on that socket or Some Mask
<joelr>
so there are no equality or type stripping issues
<joelr>
larhat: fair?
<joelr>
larhat: my issue now is that the pasted code works from the ocaml prompt but the poll unit tests hangs :-(
vivanov has quit [Ping timeout: 240 seconds]
<joelr>
larhat: any suggestions on why that may be?
<joelr>
larhat: it looks like the event array i'm returning is invalid somehow
<joelr>
although it shows up fine in the ocaml prompt
<joelr>
because this hangs when i split the assert assert_equal [| None; None |] events;
<joelr>
events is returned fine but equality hangs
<joelr>
larhat: thanks for that. does the test pass, though?
<joelr>
the whole thing
<joelr>
no assert hanging?
<larhat>
yes, with this changes it passes
<joelr>
larhat: why do you think assert_equal was hanging, though?
<joelr>
shouldn't it have simply failed?
<larhat>
no idea, i
<larhat>
i'm not familiar with OUnit.
<larhat>
i think, it should fail
<joelr>
right, a bug in ounit, maybe
<joelr>
or the interaction with zmq inproc?
<joelr>
larhat: what do you think of my new poll approach?
<larhat>
rather good, maybe you should write some helper functions for getting sockets from original array, basing on events array, if typing allows that
<joelr>
larhat: how would you see that work? its not an issue of typing, i think, since the sockets in the mask array are properly typed
<joelr>
larhat: the idea is that if you see that you have None in position 0 then you can either pull the socket from mask or you would just know that you stuck this or that socket into that position in mask and you could use that socket directly
<larhat>
i'm thinking of something like "get_readable_sockets"/"get_writable_sockets" . For individual sockets you can use Array.iteri, yes.
<joelr>
larhat: hmm... i see what you mean. yes, you could do that
<joelr>
larhat: i wouldn't use such a function, though, because the sockets are not generic (req/rep) and i would want to know specifically whether my req socket had data or the rep socket, etc.
<joelr>
larhat: my use case is a pull socket on one end that receives data from mongrel2 and a sub socket on the other end to receive state updates.
<joelr>
in this case, i wouldn't want to know which sockets were readable or writeable, i would specifically want to know if my pull socket had data or the sub socket had data, because the processing path for data received from these would be different
<joelr>
larhat: what hangs is the "failwith"
<joelr>
the interaction with zmq is what's hanging
<larhat>
why it's hanging on assert_equal?
<joelr>
larhat: because that one is calling failwith
<joelr>
and i may be able to tell you why that fails in a minute
<joelr>
larhat: it's about ounit setup and teardown
<joelr>
zmq tests should initialize context and create sockets in setup and properly close shop in teardown
<joelr>
then ounit failures won't hang
<larhat>
right, with zmq it's important to close sockets and context.
<joelr>
so that was the hanging
<joelr>
larhat: i pushed to master
jderque has quit [Quit: leaving]
<joelr>
larhat: enjoy!
<larhat>
joelr: :-) i'll implement lwt-zmq on top of your fork, tests and oasis are good things, thanks :-)
<joelr>
larhat: i'll add more tests as time goes by. they also serve as usage examples and make sure my type system tweaks work as well.
<joelr>
cheers
dnolen has joined #ocaml
vivanov has quit [Ping timeout: 264 seconds]
jamii has quit [Ping timeout: 248 seconds]
jamii has joined #ocaml
vivanov has joined #ocaml
vivanov has quit [Remote host closed the connection]
vivanov has joined #ocaml
avsm has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
edwin has joined #ocaml
oriba has joined #ocaml
oriba has left #ocaml []
dnolen has quit [Quit: dnolen]
vivanov has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
* thelema
tries to figure out what is dose3 and if there's any relevance to odb
<joelr>
gildor: ping
<joelr>
how do you pass in -threads with oasis?
<joelr>
ByteOpt, NativeOpt
<joelr>
cool
<f[x]>
not
<f[x]>
BuildDepends: threads
avsm has quit [Quit: Leaving.]
ymasory has joined #ocaml
joelr_ has joined #ocaml
<joelr_>
f[x]: that's for the library but there's also the -threads flag
joelr has quit [Ping timeout: 276 seconds]
joelr_ is now known as joelr
<f[x]>
which gets automatically enabled by ocamlbuild plugin ones you use threads packages
bohanlon has quit [Quit: So long, and thanks for all the fish!]
philtor has joined #ocaml
jamii has joined #ocaml
jamii has quit [Ping timeout: 246 seconds]
vivanov has quit [Quit: Lost terminal]
ygrek has joined #ocaml
joelr has quit [Quit: joelr]
olauzon has joined #ocaml
jamii has joined #ocaml
joewilliams_away is now known as joewilliams
jderque has joined #ocaml
lopexx has joined #ocaml
jamii has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
joelr has joined #ocaml
joelr has quit [Client Quit]
jamii has joined #ocaml
lopex has quit []
lopexx has quit []
lopex has joined #ocaml
ankit9|away is now known as ankit9
hto has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
ulfdoz_ is now known as ulfdoz
avsm has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
avsm has quit [Ping timeout: 246 seconds]
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
avsm has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
ankit9 has quit [Quit: Leaving]
Snark has joined #ocaml
avsm has joined #ocaml
vivanov has joined #ocaml
avsm has quit [Ping timeout: 250 seconds]
vivanov has quit [Ping timeout: 276 seconds]
vivanov has joined #ocaml
avsm has joined #ocaml
<brendan>
Hello. I'm having trouble building ocaml on mac os x 32-bit with xcode 4 (it builds ok in 64-bit). The error is:
<brendan>
ld: in ocamlbuild/ocamlbuild_pack.o, in section __DATA,__data reloc 1: sectionForAddress(0x4028458) address not in any section for architecture i386
<avsm>
out of interest, are you looking for a 32-bit version for performance reasons, or to build fat binaries or something?
<brendan>
nothing so interesting. I somehow got stuck packaging ocaml for fink, and lots of users use the 32-bit tree
<avsm>
ahh, nice one
<thelema>
brendan: I thought that homebrew was the new hotness...
<avsm>
its a bit of a pain porting ocaml to homebrew; ive got a tree on my github with a few packages on it
<brendan>
not very interested in the new hotness. I like debian-like packaging much more than gentoo-style
<avsm>
reason is that it symlinks everything into /usr/local but installs packages in their own subdirs. interacts poorly with ocamlc -where
<thelema>
brendan: fair enough.
<brendan>
(plus I have the commit bit for fink, which solves its major problem of being a bit out-of-date, for me)
<_habnabit>
Is there a function to print a list like it would get printed in the toplevel?
<_habnabit>
ocamldebug seems too tedious to use for doing much other than stepping backward and looking at tracebacks. Unless there's some way of executing arbitrary expressions I'm missing.
<thelema>
_habnabit: not built in, but batteries provides this: List.print Int.print stdout [1;2;3] prints "[1;2;3]"
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
ztfw has joined #ocaml
<hcarty>
_habnabit: Or if you want to get fancy and use syntax extensions: (Print.printf p"%{int list}" [1;2;4]) also prints "[1;2;3]"
ankit9 has joined #ocaml
<_habnabit>
I'm just plain not seeing how people debug programs that involve mildly-complex data structures? Decompose everything enough to be poked at from the toplevel?
<thelema>
_habnabit: I make sure I've written pretty printers for my data structures so I can inspect them easily.
<_habnabit>
thelema, inspect them from /where/? I have pretty printers.
<thelema>
I just print their values at key places in my program.
<thelema>
I dream of one day loading my programs into the toplevel for debugging, but depsorting and #load-ing everything is just a pain
<_habnabit>
I have a Set.S list list list, where the Set.S has a pretty printer, but there's the extra levels of lists which is making it more irritating.
<thelema>
which is where batteries comes in very handy -- List.print (List.print (List.print (S.print Int.print))) stdout foo
<_habnabit>
Maybe I should finally install batteries.
<_habnabit>
Do you know offhand what the godi package is?
<thelema>
or if you dislike lisp-ish parens, (Int.print |> S.print |> List.print |> List.print |> List.print) stdout foo
<thelema>
should be just batteries
<thelema>
godi-batteries
<_habnabit>
Oh hey, an equivalent to $ from haskell. That would be nice.
<_habnabit>
Oh, no, it's not equivalent.
<thelema>
no, it's the other way around.
<_habnabit>
Yeah.
chegibari has quit [Quit: ChatZilla 0.9.86.1 [Firefox 3.6.3/20100401080539]]
avsm has joined #ocaml
avsm1 has quit [Read error: Connection reset by peer]
lpereira has joined #ocaml
<hcarty>
I wonder if we can get OCaml up and running in this, to provide yet another Try OCaml From Your Browser option: http://bellard.org/jslinux/
<brendan>
alioth should run its benchmarks in there too
<sheets1>
what's the current best Try OCaml From Your Browser option?