gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
lopex has quit []
Ptival has quit [Read error: Connection reset by peer]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz_ is now known as ulfdoz
<NaCl> is there a way to signal aa .iter operation to stop?
groovy2shoes has joined #ocaml
m3ga has joined #ocaml
<m3ga> hi, i'm on linux, trying to call out to an external C lib. in my .ml file i have "external whatever : int -> int -> string -> (int * int * string) = "c_whatever"
<m3ga> in the C stub, I unpack what i need, call the C lib function, then "v_response = caml_alloc_tuple (3) and then "Store_field (v_response, 0, caml_copy_nativeint (width)) ; Store_field (v_response, 1, caml_copy_nativeint (height)) ; Store_field (v_response, 2, caml_copy_string (code)) ;" followed by "CAMLreturn (v_response) ;"
* NaCl is afraid to ask m3ga to use a pastebin
<m3ga> thats all the relevant code really. i can pastebin it if you want.
<NaCl> oh
<m3ga> weird thing is back in the ocaml code, the two ints in the tuple are screwed up, but the string is fine.
* NaCl bows to m3ga
<m3ga> really?
<NaCl> uh
<NaCl> I may be confusing you with someone else
<NaCl> oh
<NaCl> nope
<m3ga> ?
<NaCl> ah, you don't remember the fun in #wicd
<m3ga> oh, right wicd. yeah, i remember.
<NaCl> hm could it have something to do with that extra bit that ocaml reserves?
<m3ga> nope, the int values are small, < 100.
<NaCl> I'm guessing, really. And of numbers negative?
<m3ga> numbers are > 10, < 100
<m3ga> hmm, what i get back in the ocaml code looks like a pointer
<m3ga> thats a clue
<NaCl> indeed
<quackv2> hey everyone, im just starting to learn ocaml and im having trouble with modules
<quackv2> is there a naming scheme that modules need to follow with respect to filename?
<quackv2> probably a noob question, but having trouble googling it
<m3ga> quackv2: its a bit weird.
<NaCl> just like the rest of ocaml. :P
<m3ga> the case of the first filename letter doesn't matter. ocaml assumes it is uper case regardless. all following letters are cases sensitve.
<quackv2> interesting
<NaCl> much of ocaml is case sensitive
<m3ga> also, filenames can only contain valid identifier chars, so '-' (minus) is not allowed
<NaCl> yeah, that threw me for a loop
<quackv2> do they need to mwatch? like can i do moocow.ml and have a module named CowSoup ?
<m3ga> modules don't need to match either
<quackv2> okay cool
<quackv2> sweet, thanks for the info
<m3ga> sorry module name doesn't need to match filename
<quackv2> ah okay
<quackv2> i think i saw this, but want to verify, can a file have multiple modules?
<NaCl> most stuff I've seen has the modules match the names, probably to make it easier to find stuff
<quackv2> yea, feels like good practice to make it match
<NaCl> yeah, I think you can
<quackv2> okay cool
<NaCl> I haven't tried such a thing, though. You can do stuff like "module A = Array" and "module L = List" in the same file
<m3ga> quackv2: yes, multiple modules in a single file is fine, as are nested modules
<NaCl> and paramaterized modules. :P
<quackv2> heh eim not there yet
<quackv2> thanks for the help! =)
<NaCl> np
bzzbzz has quit [Ping timeout: 260 seconds]
<m3ga> hmm, Val_int works where caml_copy_nativeint doesn't.
groovy2shoes has quit [Quit: leaving]
jamii has quit [Ping timeout: 246 seconds]
m3ga has left #ocaml []
StepanKuzmin has quit [Read error: Connection reset by peer]
gno has joined #ocaml
hcarty has quit [Read error: Connection reset by peer]
sebz has quit [Quit: Computer has gone to sleep.]
StepanKuzmin has joined #ocaml
sebz has joined #ocaml
junsuijin has quit [Quit: Leaving.]
dnolen has quit [Quit: dnolen]
sebz has quit [Quit: Computer has gone to sleep.]
ulfdoz has quit [Ping timeout: 246 seconds]
sebz has joined #ocaml
gno` has joined #ocaml
gno has quit [Ping timeout: 255 seconds]
larhat has joined #ocaml
f[x] has joined #ocaml
rixed has quit [Ping timeout: 240 seconds]
<thelema> f[x]: error on batteries freebsd on your jenkins - disk space limit reached
<f[x]> argh, /tmp is filled with ocamlXXXpipe files, thanks for the heads-up
StepanKuzmin has quit [Read error: Connection reset by peer]
ankit9 has quit [Ping timeout: 255 seconds]
ankit9 has joined #ocaml
StepanKuzmin has joined #ocaml
quackv2 has quit [Quit: leaving]
Ptival has joined #ocaml
<flux> I think maybe quackv2 was missing a critical piece of information: files alway introduce a module, and the modules inside it go below that
sebz has quit []
bobry has joined #ocaml
thomasga has joined #ocaml
<Ptival> is it possible for a function to take any kind of Map and fold it?
<sgnb> Ptival: what do you mean by "any kind of Map"?
<Ptival> not sure about Ocaml's terminology
<Ptival> any module SomeMap = Map.Make(...)
<raphael-p> Ptival: you can fold over the 'bindings' with List.fold and SomeMap.bindings
<Ptival> should work
<Ptival> I want to write a "generic" map printer
<Ptival> the problem is I wanted it to call SomeMap.fold, but SomeMap changes when the map changes, so I tried to take it as an argument but that doesn't quite work
Cyanure has joined #ocaml
avsm has quit [Quit: Leaving.]
<sgnb> Ptival: you can make a functor that takes a map in parameter
<sgnb> Ptival: or, alternatively, use first-class modules of ocaml >= 3.12
avsm has joined #ocaml
StepanKuzmin has quit [Read error: Connection reset by peer]
StepanKuzmin has joined #ocaml
<Ptival> sgnb: thanks
bobry1 has joined #ocaml
seafood has joined #ocaml
seafood has quit [Quit: seafood]
sebz has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 250 seconds]
lopex has joined #ocaml
Amorphous has quit [Ping timeout: 252 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
Amorphous has joined #ocaml
gno` is now known as gno
StepanKuzmin has quit [Read error: Connection reset by peer]
StepanKuzmin has joined #ocaml
bobry1 has quit [Ping timeout: 260 seconds]
pdhborges has joined #ocaml
<pdhborges> Hi!
<pdhborges> what is the difference between using Lwt.detach and using Lwt_unix jobs?
bobry1 has joined #ocaml
<goncalo> is ocaml-tutorial.org gone for good?
_andre has joined #ocaml
StepanKuzmin has quit [Read error: Connection reset by peer]
<mfp> pdhborges: AFAICS Lwt_unix jobs are meant to be used with externals, Lwt.detach is the user-friendly wrapper for blocking functions
<goncalo> thanks pdhborges
<pdhborges> mfp so it's a programming error to detach an external?
StepanKuzmin has joined #ocaml
<mfp> pdhborges: no, a blocking external is just a particular case of a blocking function :)
<mfp> but Lwt_unix jobs require additional externals to create, get the result and free jobs
<pdhborges> so what is the advantage?
<mfp> and Lwt.detach only wants a ('a -> 'b) function
<pdhborges> you are right!
<pdhborges> damn I'll have to use unix jobbs
<mfp> I believe that it's the ability to select the async method in the case of Lwt_unix jobs
<mfp> what kind of function/job are you wrapping?
<pdhborges> message sending are receiving
<pdhborges> s/are/and
<mfp> using some external messaging sys that doesn't allow you to use Lwt_io directly, I assume?
<pdhborges> no
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
<mfp> if you're using plain/SSL sockets, Lwt_io/Lwt_ssl should do
<pdhborges> I'm using zmq sockets
<pdhborges> they dont have a channel abstraction
<mfp> looking at Lwt_unix.async_method's desc, it looks like Lwt_unix jobs exist mostly for performance reasons
<pdhborges> well I'll use it then
<pdhborges> my function signatures don't match 'a -> 'a
<pdhborges> ups 'b
<pdhborges> and speed is always good
<pdhborges> thanks for the help!
<mfp> note that it doesn't have to be 'a -> 'b
<mfp> you can use partial application
<mfp> so there's no pb detaching a int -> int -> int -> whatever func, you just do Lwt.detach (f a b) c
<mfp> but it looks like there's some sort of speed advantage to Lwt_unix jobs
<pdhborges> but that would alloc a closure every time someone
<mfp> yes
<pdhborges> needed to send a message
<mfp> allocating the closure is way cheaper than the communication between the worker thread and the main one, though
<pdhborges> the thing is one of the major selling points of zeromq is performance
<mfp> a few days ago I timed Lwt.detach (fun () -> ()) () and got ~17us/call
<mfp> w/ lots of sys time related to condition variables and such
<pdhborges> but
<pdhborges> if detach uses ocaml native threads they can't execute concurrently
<pdhborges> ups I meant in parallel
<mfp> well, at some point the runtime must be released (in the external) before the blocking function is called
<mfp> if it's pure OCaml code, yes, there's no parallelism
<mfp> but if there's a caml_enter_blocking_section (now renamed to caml_release_runtime_system) in the external, that thread will run in parallel
<pdhborges> yourr right
<pdhborges> I'll use detach then
<pdhborges> if someone complains I'll investigate further
<pdhborges> and time workers vs detach
bobry1 has quit [Quit: Leaving.]
bobry1 has joined #ocaml
svenl has quit [Ping timeout: 258 seconds]
svenl has joined #ocaml
dnolen has joined #ocaml
<adrien> we don't have bindings to VTK, do we?
<adrien> visualization toolkit from kitware)
iratsu has quit [Ping timeout: 255 seconds]
pdhborges has quit [Quit: Leaving.]
goncalo_ has joined #ocaml
jonathandav has quit [Read error: Connection reset by peer]
goncalo has quit [Read error: Connection reset by peer]
jonathandav has joined #ocaml
metasyntax|work has joined #ocaml
goncalo_ has quit [Ping timeout: 240 seconds]
goncalo has joined #ocaml
metasyntax|work has quit [Quit: Leaving]
iratsu has joined #ocaml
pdhborges has joined #ocaml
hcarty has joined #ocaml
dnolen has quit [Quit: dnolen]
pdhborges has quit [Remote host closed the connection]
StepanKuzmin has quit [Remote host closed the connection]
ttamttam has joined #ocaml
mcclurmc has joined #ocaml
Ptival has quit [Quit: Leaving]
ttamttam has quit [Remote host closed the connection]
lopex has quit []
larhat has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
lopex has joined #ocaml
Transformer has joined #ocaml
Transformer has quit [Excess Flood]
avsm1 has quit [Quit: Leaving.]
Ptival has joined #ocaml
bobry1 has quit [Quit: Leaving.]
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
joewilliams_away is now known as joewilliams
bitbckt_ has joined #ocaml
bitbckt_ has quit [Client Quit]
kfx has joined #ocaml
<kfx> are there known issues with the way ocamlbuild handles linking? I have read the library-finding document from gerd, but something is very wrong
<kfx> when I run ld -lsqlite3 on the command line it works. when ocamlbuild calls it I get 'cannot find -lsqlite3'. is this a known problem?
<adrien> kfx: with ocaml 3.12, you get builtin support for ocamlbuild, and for 3.12.1, you get some bug fixes
<kfx> ah, I see
<kfx> so I'm badly out of date
<adrien> as for linking with C libraries, I think it's the job of the library to tell it will have to be linked against it
<adrien> can you run ocamlbuild with -classic-display and pastebin the output?
<kfx> when I try to update by downloading the latest godi-rocketboost tar, I get checksum errors during install
<kfx> adrien: I can try. I'll need some time to figure out how this makefile is structured.
<adrien> kfx: makefile of what?
<kfx> the program I'm trying to build, pplacer
<adrien> hmm, never heard of it, but simply looking up "ocamlbuild" should be enough
<adrien> search-replace
<adrien> kfx: checksum errors for what exactly?
junsuijin has joined #ocaml
<adrien> actually sqlite3 reminds me of something, but I can't remember what
<adrien> I'm pretty sure someone already had the issue
<kfx> ok
<kfx> in this channel? are there online logs?
<adrien> did you go through the archives and everything?
<adrien> there are logs
<adrien> and I thought the link was in the topic
<adrien> actually it's freenode best-policy to mention in the topic that there are public logs for a channel
<kfx> yes, I couldn't find anything on the archives.
<kfx> http://intma.in/pastes/2011-08-08T14:04:21.raw <-- this is the godi build failure
<adrien> actually I think I'll look at my own logs to find the url of the logs
<kfx> I found a logfile repository on github
<kfx> but grepping that for sqlite3 doesn't mention any problems with libraries
<adrien> hmmm, don't seem to have much things in my logs either but I think I rather suck at keywords
<kfx> any hints on the godi build failure? there's an outside chance that if I can get a newer version installed the problem will have been addressed
Cyanure has quit [Ping timeout: 240 seconds]
<adrien> remove pcre-ocaml-6.2.2.tar.gz from your system and try to download it again, you can also get it from http yourself and put it in the right place
sebz has joined #ocaml
Cyanure has joined #ocaml
nimred has quit [Quit: leaving]
nimred has joined #ocaml
<_habnabit> hmm, interesting. godi fails at the 'creating boot console' step if I just run the bootstrap script, but if I go into the ocamlrun directory after it fails and do `make clean; make ocamlrunfat` then rerun the bootstrap script, it succeeds.
<adrien> how are you running it?
<_habnabit> running which part?
<adrien> godi, how are you calling it, and on which platform and ...
<_habnabit> just doing `./bootstrap` after unpacking rocketboost.
<_habnabit> 10.6; Xcode 3.
<adrien> ah, os x
<_habnabit> yes
<_habnabit> hm, nope, it looks like it failed again eventually.
<_habnabit> ... hahaha, and right as I'm about to explain, someone else just posts to the godi list with my exact error.
<_habnabit> excellent timing.
<kfx> yep, I get that too
<kfx> not just for godi-pcre
<kfx> I also get it for godi-ocamlgsl
<_habnabit> any solution?
<kfx> I just set NO_CHECKSUM="yes" in build/bsd.pref.mk
<_habnabit> ah.
<kfx> obviously this is not the proper solution
<_habnabit> and then how did you restart the build?
<kfx> sh bootstrap -restart
<_habnabit> ah okay.
<_habnabit> hmm, I don't have a file called that. did you have to create it?
<kfx> no, that file will appear in the target directory
<_habnabit> oh, did you mean build/mk/bsd.pref.mk ?
<kfx> yes, that one
<kfx> sorry
<kfx> look for .undef NO_CHECKSUM
<kfx> comment it out, then put NO_CHECKSUM="yes" on a line before or after
<_habnabit> okay.
<kfx> (and make yourself a note to remove that edit once this bug is addressed :)
<_habnabit> okay, rerunning it while I go to lunch. thanks, though.
<kfx> yep
Ptivalternative has joined #ocaml
Ptival has quit [Disconnected by services]
Ptivalternative is now known as Ptival
<_habnabit> aha, that did it.
<_habnabit> so let's rebuild all the packages I need now..
<_habnabit> huh, it looks like godi's batteries is really old.
<_habnabit> when do packages get updated in godi?
Anarchos has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
_andre has quit [Quit: leaving]
iratsu has quit [Ping timeout: 264 seconds]
<hcarty> _habnabit: When the packagers update them. It varies from package to package.
<hcarty> oasis + oasis-db/odb makes the release process simpler, so hopefully that will eventually translate into a simple way to get more timely updates
<hcarty> It's already a good portion of the way there
<Anarchos> adrien ca avance :)
<_habnabit> so, it seems like really the only reason to use godi is that it's ocaml that comes with, like, findlib.
<hcarty> _habnabit: It's usually more up to date than anything other than possibly Debian Sid; It makes rebuilds of everything much more simple when you update OCaml or a core package; It provides a large number of packages in an easily managed form.
<_habnabit> yeah, but I use OS X.
<hcarty> s/much more simple/much easier/
<_habnabit> (and doesn't oasis take care of most of those things?)
<hcarty> oasis is just a build system
<_habnabit> ah.
<hcarty> oasis-db may eventually take care of some or all of them, but oasis-db doesnt't exist as anything other than a server right now.
sebz has quit [Quit: Computer has gone to sleep.]
<hcarty> odb provides a simple/proof-of-concept cleint which may eventually grow into more
<hcarty> *client
<kfx> I can't get godi to build a working ocamlgsl
george_z0rwell has quit [Read error: No route to host]
<kfx> it's like it's missing include files or something
<kfx> it passes tests, but then no software can actually link against it
<hcarty> kfx: What OS, version of OCaml and version of GSL are you using?
<kfx> RHEL5, 3.12, 1.13
<hcarty> kfx: It should work? What error(s) are you getting?
<kfx> I get no error during godi_perform -build godi-ocamlgsl
<kfx> but when I try to build any package against ocamlgsl, I get a torrent of errors, which I will now pastebin
thomasga has quit [Quit: Leaving.]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
sebz has joined #ocaml
<hcarty> kfx: It looks like you need to configure ocamlgsl to look at the correct GSL include and lib directories. Or it could be some problem related to those static linking errors.
<kfx> hcarty: yes that's what I assumed
<kfx> but the godi build process is a little obtuse, and it's not obvious where I would go to instruct it
<kfx> it looks like it's based on pkgsrc?
<hcarty> kfx: There may be configuration options for the godi-ocamlgsl package
<hcarty> You can see them from godi_console and probably from somewhere else as well
<kfx> ok, will check.
<kfx> it's strange that it builds and installs with this problem.
<kfx> godi_console doesn't offer any configuration
<hcarty> I'm not sure - I've used it on Fedora, Debian and Ubuntu
<hcarty> Good luck tracking down the problem, whatever it ends up being!
Cyanure has quit [Remote host closed the connection]
avsm has joined #ocaml
iratsu has joined #ocaml
ztfw has joined #ocaml
bobry has quit [Ping timeout: 246 seconds]
pheredhel has quit [Ping timeout: 240 seconds]
pheredhel has joined #ocaml
mundkur has quit [Ping timeout: 276 seconds]
mundkur has joined #ocaml
technomancy has joined #ocaml
avsm has quit [Quit: Leaving.]
<technomancy> is there a way to look up function documentation from the command line or from within Emacs?
<zorun> the tuareg-mode for emacs does that, iIrc
<technomancy> looks promising; thanks
<zorun> yeah, it does a lot more :)
<bitbckt> M-x tuareg-help :)
philtor has joined #ocaml
<technomancy> why would I not have access to Str.regexp in my toplevel?
<technomancy> anything special I need to declare first?
<philtor> Anybody try to install the new godi lately?
<philtor> I'm getting:
<philtor> ### Building godi-pcre
<philtor> => Checksum mismatch for pcre-ocaml-6.2.2.tar.gz.
<philtor> Make sure the Makefile and checksum file (/home/phil/godi-3.12.1/build/godi/ godi-pcre/distinfo)
<philtor> are up to date. If you want to override this check, type
<philtor> "godi_make NO_CHECKSUM=yes [other args]"
<philtor> ...this after running ./bootstrap
<philtor> Linux, 64bit.
<philtor> (MintLinux which is essentially Ubuntu)
ztfw has quit [Remote host closed the connection]
chrissbx has quit [Ping timeout: 240 seconds]
dsheets1 has quit [Quit: Leaving.]
sebz has quit [Quit: Computer has gone to sleep.]
lopexx has joined #ocaml
lopex has quit [Ping timeout: 276 seconds]
lopexx has quit [Client Quit]
lopex has joined #ocaml
dsheets has joined #ocaml
<technomancy> I'd like to port dmenu to ocaml. basically it just needs to take input one char at a time and output a list of strings straight to the gui. would it be reasonable to use the Xlib library for this? http://www.linux-nantes.org/~fmonnier/OCaml/Xlib/doc/Xlib.html
lopexx has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
dnolen has joined #ocaml
arubin has joined #ocaml
sebz has joined #ocaml