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
garrigue has joined #ocaml
garrigue has quit [Remote host closed the connection]
dgfitch_ has joined #ocaml
dgfitch has quit [Ping timeout: 260 seconds]
_yezariaely has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 260 seconds]
yezariaely has quit [Ping timeout: 245 seconds]
_yezariaely is now known as yezariaely
mal`` has quit [Ping timeout: 245 seconds]
mal`` has joined #ocaml
jave_ has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
jave has joined #ocaml
madroach has quit [Ping timeout: 265 seconds]
madroach has joined #ocaml
osa1 has quit [Ping timeout: 248 seconds]
Mnabil has joined #ocaml
sepp2k has quit [Remote host closed the connection]
Mnabil has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
ankit9 has joined #ocaml
emmanuelux has quit [Ping timeout: 268 seconds]
ankit9 has quit [Quit: Leaving]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
Yoric has joined #ocaml
<cacho> isn't there anything like fst and snd in ocaml?
<cacho> or other way to access tuples without adding bindings to inner values
ankit9 has joined #ocaml
wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
gnuvince has quit [Read error: Connection reset by peer]
Progster has joined #ocaml
gnuvince has joined #ocaml
<_habnabit> cacho, uh, yes? ocaml defines fst and snd
<xenocons> dont know why im bringing this up, but i always missed arbritrary tuple access with '#'
<cacho> fuck, tried it and works, I think there was an error in another part and made me think it was the fst/snd thing
<cacho> xenocons: better use records if you gonna have more than 2-fields-tuple
<xenocons> i duno, probably yes
<xenocons> but i like #3 (1,2,3,4)
<xenocons> val it = 3 : int
<xenocons> normally if not using records i just pattern match tuples
<cacho> is that in sml?
<xenocons> yeh
Progster has quit [Ping timeout: 245 seconds]
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
pango is now known as pangoafk
ftrvxmtrx has quit [Quit: Leaving]
ocp has joined #ocaml
<fasta_> How can I check how Lwt is compiled?
<fasta_> In particular whether it has been compiled with --enable-react.
<diml> fasta_: ocamlfind query lwt.react
<fasta_> diml: that gets me a directory.
<fasta_> diml: I think that is a yes.
<fasta_> diml: thanks
ankit9 has quit [Quit: Leaving]
ocp has quit [Ping timeout: 240 seconds]
mika1 has joined #ocaml
eni has joined #ocaml
<cacho> ocamlbuild -do-the-magic
cago has joined #ocaml
ftrvxmtrx has joined #ocaml
<fasta_> Is there some easier way to install something from force.ocamlcore.org than manually downloading it?
<fasta_> forge*
srcerer has quit [Ping timeout: 245 seconds]
srcerer has joined #ocaml
madroach has quit [Quit: leaving]
beckerb has joined #ocaml
iago has joined #ocaml
<flux> I don't think there's a client for that
<flux> not such a bad idea although I don't know how much ocaml stuff the forge even has..
eikke has joined #ocaml
ocp has joined #ocaml
thomasga has joined #ocaml
ankit9 has joined #ocaml
eikke has quit [Ping timeout: 260 seconds]
eikke has joined #ocaml
ulfdoz has joined #ocaml
<adrien> but everything is not accessible in a uniform way
eni has quit [Ping timeout: 252 seconds]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 244 seconds]
<flux> oh, too bad. it could be?
<fx_> unique number in url is driving me mad
osa1 has joined #ocaml
osa1 has quit [Read error: Operation timed out]
thomasga has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 246 seconds]
Yoric1 has joined #ocaml
<adrien> :P
jamii has joined #ocaml
madroach has joined #ocaml
Yoric1 has quit [Ping timeout: 244 seconds]
Yoric has joined #ocaml
osa1 has joined #ocaml
Kakadu has joined #ocaml
osa1 has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
eni has joined #ocaml
osa1 has joined #ocaml
osa1 has quit [Client Quit]
eni has quit [Ping timeout: 252 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
eni has joined #ocaml
gnuvince has quit [Ping timeout: 252 seconds]
cdidd has quit [Read error: Connection reset by peer]
Progster has joined #ocaml
minus273 has joined #ocaml
gnuvince has joined #ocaml
eni has quit [Ping timeout: 240 seconds]
Mnabil has joined #ocaml
jamii has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
ankit9 has quit [Quit: Leaving]
cago has quit [Quit: Leaving.]
cago has joined #ocaml
cago has quit [Client Quit]
cago has joined #ocaml
<thelema> fasta_: give the download url to odb; it will try to do the right thing
<fasta_> thelema: thanks, I was just writing a program to do that :)
<fasta_> thelema: the 'parse the whole ocamlcore website' already works.
hkBst has quit [Ping timeout: 246 seconds]
hkBst has joined #ocaml
<fasta_> thelema: it doesn't really suggest that it can do that via --help
<fasta_> thelema: is it documented somewhere?
Mnabil_work has joined #ocaml
mattrepl has joined #ocaml
mattrepl has quit [Client Quit]
mattrepl has joined #ocaml
rixed_ has quit [*.net *.split]
samposm has quit [*.net *.split]
hkBst has quit [Read error: Connection reset by peer]
rixed_ has joined #ocaml
samposm has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
Kakadu has quit [Quit: Page closed]
mika1 has quit [Quit: Leaving.]
<thelema> fasta_: one sec, I'll see if I put it into the readme.
<thelema> I may not have documented it because it's still under test
<fasta_> thelema: is there any way to do XPath, fetch HTML, parse HTML, etc. via OCaml?
<fasta_> thelema: I am currently doing it via Ruby.
smondet has joined #ocaml
<fasta_> thelema: I don't like anything formally about Ruby, but it does work.
<thelema> you can google xpath+ocaml as well as I.
<fasta_> thelema: yeah, I did that already.
<thelema> meaning that I don't know any more than google
<thelema> I've never needed xpath in my ocaml use
<flux> netstring comes with some html support
<flux> no idea how good it is
<fasta_> I'd had preferred to use xpath2.
<fasta_> But almost everyone seems to only implement xpath1.
minus273 has quit [Ping timeout: 246 seconds]
usualsuspect has joined #ocaml
<usualsuspect> hey
<usualsuspect> I'm learning Ocaml by doing Project Euler problems
<usualsuspect> And I have a problem for which my OCaml code loops endlessly on a seemingly arbitrary number
<usualsuspect> Would anyone mind looking at my code and telling me where I'm wrong?
<fasta_> thelema: what constitutes a 'package'?
<fasta_> thelema: would http://ocsigen.org/download/lwt-2.4.0.tar.gz qualify?
<usualsuspect> The problem is searching for the longest sequence of this collatz conjecture thing
cago has quit [Ping timeout: 246 seconds]
<usualsuspect> I'm not sure if that matters, my program locks up around number 77577 but if I manually try these in another script (same code) it works
<usualsuspect> so I suspect my recursion is causing problems
<fasta_> thelema: can odb check for new versions?
<fasta_> thelema: because odb needs --force foo to install the newer version of foo
hkBst has quit [Quit: Konversation terminated!]
<fasta_> thelema: it's also not clear whether --info contacts a server.
<fasta_> thelema: in the --help it should say something like 'using the Internet or using local information'
<usualsuspect> I don't get it, I've switched all constructs but somewhere around 77500 is a magic number where it just dies
<usualsuspect> What's a good solution to looper over numbers 1 .. 1,000,000?
<usualsuspect> I don't have a tail-recursive range function
<usualsuspect> I tried to replace it with a recursive function that simply calls itself with i+1
<usualsuspect> but that too dies around the same mark
<mfp> usualsuspect: runs for me with a 8 MB stack; also AFAICS your functions are properly tail-recursive
<usualsuspect> is 8MB stack standard of a special param?
<fasta_> usualsuspect: works for me.
<fasta_> usualsuspect: last line is Checking 1000001
<usualsuspect> Yeah, <= is wrong ;)
<usualsuspect> then my OCaml must be broken
<usualsuspect> In fact I have 3.11.2
<mfp> oh, this one is obviously not a tail call but it doesn't look harmful > let steps = calc start 1 in
<usualsuspect> mh
emmanuelux has joined #ocaml
<mfp> usualsuspect: you can try to change your stack size with ulimit -s (and maybe the l option in OCAMLRUNPARAM, but can't remember if it applied only to bytecode, see man ocamlrun) and see if the depth changes
<usualsuspect> I'll give it a try, although I don't even get a Stack Overflow, it just keeps looping
<usualsuspect> It's partially prints a line but that's it, CPU at 100% and no further output
<usualsuspect> That's okay though, I'll try it somewhere else where I can upgrade OCaml
<usualsuspect> I have to say, OCaml/fp is fantastic, it's something completely different (in a good way) after writing imperative stuff for years :)
eni has joined #ocaml
eni has quit [Client Quit]
eni has joined #ocaml
<fasta_> mfp: don't you think it's kind of a bad thing that a program just dies?
<fasta_> mfp: IMHO, it should never die.
<fasta_> mfp: it should simply switch to heap allocating stack frames.
<fasta_> It could also output a warning like 'now entering heap allocating stack frames mode'.
<fasta_> But failing is a failure on the RTS developers, imho.
thomasga has joined #ocaml
<_andre> hello
<flux> fasta_, well, I suppose it still doesn't matter, as you can have just as much stack as you like..
<_andre> i'm writing stubs for a C library that takes callbacks and uses pthreads internally
<_andre> what are the guidelines for using caml_c_thread_register()?
<fasta_> flux: I think the point of a computer is that it understands a formal language.
<fasta_> flux: I don't think stack size is part of the OCaml specification.
<fasta_> flux: or if it is, it's a bad spec.
<_andre> is it just a matter of doing caml_c_thread_register(); caml_callback(...); caml_c_thread_unregister(); ?
emmanuelux has quit [Ping timeout: 268 seconds]
pollux has quit [Ping timeout: 265 seconds]
<_andre> hmm i'm getting a segfault on caml_c_thread_register
<diml> _andre: you also need caml_acquire/release_runtime_system
<diml> also, make sure that the Thread module is initialized before calling caml_c_thread_register
<_andre> diml: thanks. do i need to call any function from the Thread module or is it just a matter of compiling with -thread?
<diml> _andre: toplevel declaractions of the Thread module must be executed before the first call to caml_c_thread_register, if you have a reference to Thread in the module of your library it should work
ftrvxmtrx has quit [Quit: Leaving]
eni has quit [Ping timeout: 248 seconds]
<diml> _andre: i did that once, i added "let _ = Thread.self ()" at the beginning of the module
<diml> and used these macro at the beginning and end of C callbacks: http://paste.debian.net/184212/
paolooo has joined #ocaml
<_andre> it's not segfaulting now, but caml_c_thread_register seems to block forever
usualsuspect has quit [Quit: leaving]
gnuvince has quit [Ping timeout: 256 seconds]
gnuvince has joined #ocaml
jave has quit [Read error: Connection reset by peer]
jave has joined #ocaml
avsm has joined #ocaml
pangoafk is now known as pango
Anarchos has joined #ocaml
sepp2k has quit [Ping timeout: 246 seconds]
ftrvxmtrx has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
thomasga has quit [Quit: Leaving.]
sepp2k has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
eikke has quit [Ping timeout: 245 seconds]
cdidd has joined #ocaml
mfp has quit [Ping timeout: 252 seconds]
<_habnabit> I appear to be running into issues with hashtbls getting too big; I just got a Stack_overflow where every entry on the stack was in hashtbl.ml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Anarchos has joined #ocaml
eni has joined #ocaml
mfp has joined #ocaml
ocp has quit [Ping timeout: 246 seconds]
eni has quit [Ping timeout: 240 seconds]
<_habnabit> ah, it's `insert_bucket` that's stack overflowing apparently
<_habnabit> in Hashtbl.resize
<_habnabit> well that's terrible!
<_habnabit> maybe I should just use maps for everything always
<mfp> _habnabit: doesn't that mean you're running into worst-case behavior (several thousand elements in the same bucket), i.e. dysfunctional hash function anyway?
<_habnabit> maybe!
<_habnabit> guess I should figure that out
fraggle_ has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
fraggle_ has joined #ocaml
paradoja has joined #ocaml
<_habnabit> mfp, hmm, I don't know what the distribution is supposed to look like, but I made a histogram of the bucket sizes in a typical (but smaller) hashtbl
<_habnabit> [(0, 649); (1, 200); (2, 75); (3, 37); (4, 17); (5, 14); (6, 6); (7, 5); (8, 4); (9, 4); (10, 3); (12, 1); (14, 3); (17, 1); (21, 1); (26, 1); (29, 1); (47, 1); (110, 1)]
<_habnabit> it's (size, count)
<_habnabit> the 110 looks a bit wrong to me
eni has joined #ocaml
Yoric has joined #ocaml
jave has quit [Read error: Connection reset by peer]
jave has joined #ocaml
bzzbzz has quit [Ping timeout: 240 seconds]
eni has quit [Quit: Leaving]
gnuvince has quit [Ping timeout: 265 seconds]
ivan\ has quit [Ping timeout: 268 seconds]
_andre has quit [Quit: leaving]
paolooo has quit [Ping timeout: 245 seconds]
gnuvince has joined #ocaml
avsm has joined #ocaml
osa1 has joined #ocaml
mattrepl has quit [Quit: mattrepl]
ivan\ has joined #ocaml
gnuvince has quit [Ping timeout: 260 seconds]
Yoric has quit [Read error: Connection reset by peer]
smondet has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Anarchos has quit [Ping timeout: 246 seconds]
avsm has quit [Quit: Leaving.]
iago has quit [Quit: Leaving]
Anarchos has joined #ocaml
zbroyar has joined #ocaml
Anarchos has quit [Quit: need to sleep]
paradoja has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 268 seconds]
emmanuelux has joined #ocaml