dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
lmbdwr is now known as novasilver
romildo has quit ["Leaving"]
mikeX_ has quit ["leaving"]
jeremy_c has joined #ocaml
chessguy has joined #ocaml
danly_ has joined #ocaml
danly__ has joined #ocaml
danly has quit [Read error: 60 (Operation timed out)]
batdog|gone is now known as batdog
danly_ has quit [Read error: 60 (Operation timed out)]
slipstream has quit [kornbluth.freenode.net irc.freenode.net]
duncanm has quit [kornbluth.freenode.net irc.freenode.net]
khaladan has quit [kornbluth.freenode.net irc.freenode.net]
bohanlon has quit [kornbluth.freenode.net irc.freenode.net]
julien has quit [kornbluth.freenode.net irc.freenode.net]
datrus has quit [kornbluth.freenode.net irc.freenode.net]
seafood_ has quit [kornbluth.freenode.net irc.freenode.net]
gim has quit [kornbluth.freenode.net irc.freenode.net]
datrus has joined #ocaml
slipstream has joined #ocaml
duncanm has joined #ocaml
khaladan has joined #ocaml
bohanlon has joined #ocaml
julien has joined #ocaml
seafood_ has joined #ocaml
gim has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
abez has joined #ocaml
<abez> Hi, I'm having problems with compiling threading on GNU/Linux 2.6. I call Fatal error: exception Sys_error("Thread.create: Cannot allocate memory")
<abez> err that is the error, I call /usr/local/bin/ocamlc.opt -thread unix.cma threads.cma control_module.ml to compile it
<abez> I can use vmthreads and run from the interpretter just fine, but when I compile natively it chokes and gives me that Fatal error.
<abez> And I have pthreads compiled with ocaml
jeremy_c has quit []
chessguy has quit [" Want to be different? HydraIRC -> http://www.hydrairc.com <-"]
JosephRivers has joined #ocaml
<Smerdyakov> ocamlc doesn't compile native programs.
<abez> well I also tried ocamlopt.opt
<abez> both give the same error
<abez> but if I use ocamlc it doesn't
<abez> nm ocamlc is the same
M3liik has joined #ocaml
<M3liik> i need help people
<M3liik> ?
<M3liik> someone
<Smerdyakov> First rule of IRC etiquette: Just Ask Your Question
M3liik has quit []
<abez> :)
<abez> WORKS: ocamlc -thread -I /usr/lib/ocaml/3.09.1/unix -I /usr/lib/ocaml/3.09.1/vmthreads/ unix.cma threads.cma control_module.ml
<abez> FAILS: ocamlopt.opt -thread -I /usr/lib/ocaml/3.09.1/unix -I /usr/lib/ocaml/3.09.1/threads/ unix.cmxa threads.cmxa control_module.ml
<abez> Fatal error: exception Sys_error("Thread.create: Cannot allocate memory")
<abez> ocamlopt.opt -thread -I /usr/lib/ocaml/3.09.1/unix -I /usr/lib/ocaml/3.09.1/vmthreads/ unix.cmxa threads.cmxa control_module.ml
<abez> Files control_module.cmx and /usr/lib/ocaml/3.09.1/threads/threads.cmxa
<abez> make inconsistent assumptions over interface Thread
<abez> so that's if I use vmthreads :|
<abez> there's my source file
<abez> I create threads at the bottom
<abez> Smerdyakov: so have you successfully compiled some ocaml code that uses threads?
<abez> I can't find any google info on this. It is like this doesn't happen to people. I have tried 3.09.1 and 3.09.3
JosephRivers has quit [Read error: 104 (Connection reset by peer)]
Skal has joined #ocaml
<abez> so I compile http://churchturing.org/w/control_module.ml with ocamlopt.opt -thread -I /usr/lib/ocaml/3.09.1/unix -I /usr/lib/ocaml/3.09.1/threads/ unix.cmxa threads.cmxa control_module.ml
<abez> and I get Fatal error: exception Sys_error("Thread.create: Cannot allocate memory")
<abez> when I run it
<abez> if I compile it with ocamlc -thread -I /usr/lib/ocaml/3.09.1/unix -I /usr/lib/ocaml/3.09.1/vmthreads/ unix.cma threads.cma control_module.ml
<abez> it works
<abez> Does anyone have any example thread code that compiles natively?
Skal has quit [Remote closed the connection]
dechunker has joined #ocaml
_fab has joined #ocaml
pauldia has joined #ocaml
<pango_> abez: how many threads do you create ?
<abez> oh jeeze
<abez> that is the best question
<abez> I thought it was blocking
<abez> but it was creating tonnes
<pango_> with vmthreads the limit is quite high (over tens of thousands I think, even if performance quickly gets horrible), while with native threads you run in operating system limit first
<pango_> if you plan to use lots of threads switch to Erlang, or something designed for that
<abez> Isnt Unix.listen supposed to block?
<abez> My problem was I spawning a billion threads for no good reason
<pango_> I think it's accept() that's blocking
<abez> yep
<abez> you're right
<abez> I was wondering why there was such high latency before
<abez> :(
<abez> thank you pango_ for your great question
<pango_> np ;)
_velco has joined #ocaml
microcape has joined #ocaml
shawn has quit ["This computer has gone to sleep"]
_fab has quit [Read error: 104 (Connection reset by peer)]
batdog is now known as batdog|gone
velco has joined #ocaml
pango_ has quit ["brb"]
pango has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
ramki has joined #ocaml
Demitar_ has quit [Read error: 104 (Connection reset by peer)]
Demitar__ has joined #ocaml
Demitar_ has joined #ocaml
Demitar__ has quit [Read error: 104 (Connection reset by peer)]
Demitar__ has joined #ocaml
_fab has joined #ocaml
velco has quit [Remote closed the connection]
Skal has joined #ocaml
clog has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
jeremy_c has left #ocaml []
_velco has quit ["I'm outta here ..."]
Snark has quit ["Leaving"]
<dark_light> why with let rec x = 1 :: 2 :: 3 :: 4 :: 5 :: x;; i got val x : int list = [1; 2; 3; 4; 5; 1; 2; 3; 4; 5; 1; 2; 3; 4; 5; 1; 2; 3; 4; 5; 1; 2; 3; 4; 5; ...] but with let rec x = [1; 2; 3; 4; 5] @ x;; i receive only This kind of expression is not allowed as right-hand side of `let rec' pointing to x?
<abez> dark_light: because x is a function and not a list
<abez> dark_light: Think order of operations
<dark_light> abez, no, x has type int list
<dark_light> and, hmmm
<abez> no
<abez> let rec x
<dark_light> x is a recursive constant, not a function..
<abez> that means x is a function
<abez> wait
<dark_light> let rec x y = means that x is a possibly function, but let rec x = means that x is a possible recursive constant..
<dark_light> well, maybe the allowing using x with @ leads to undecidable situations
<abez> you can't use functions involving y either
<abez> I saw a section in the manual on recursive definition
<dark_light> what you mean?
<dark_light> hm
<abez> 7.3 Recursive definitions of values
<abez> statically constructive
<pango> yes, [...] @ x is not
<abez> there you go :|
<pango> if it wasn't for a compiler error, program would get into a loop anyway
<abez> I didn't know about this feature..
<dark_light> 'but well why the program would not get in an loop when i use 1 :: x ?
<pango> dark_light: it just builds a cyclic value
<dark_light> [1] @ x too
<pango> it = the compiler, not the program
<dark_light> hm
<abez> Well
<abez> my List.length x;;
<abez> is not ending..
<pango> correct
<dark_light> well semantically let rec x = 1 :: x is equivalent to let rec x = [1] @ x
<abez> 'a list -> 'a list -> 'a list is different from 'a -> 'a list -> 'a list
<pango> @ is a function, :: is a constructor
<pango> that's not the same thing
<dark_light> the compiler should generate the same or equivalent code, but instead it rejects it
<dark_light> abez, in both cases x would have type int list
<dark_light> pango, hmmmm
<abez> @ is not statically constructive
<pango> dark_light: oh, btw, I found a bug in your animated ifs of the other day
<pango> dark_light: why the drawing is not connex
<dark_light> pango, show me :) (i didn't expected that code to run well..)
<dark_light> Ah..
<dark_light> where?
<pango> s/y -. s/y -. c/
<pango> if par then
<pango> (x -. s, y +. c), (x +. s, y -. c)
<dark_light> in the end i found that non-connex drawing a "feature".. that permitted the fractall looks 3D..
<dark_light> pango, hmmmmmmm....
<dark_light> wow, but, but, but, but..
<dark_light> i checked the equations many many times, :( well.. thanks:)
<pango> the expressions weren't symetrical, so I suspected something ;)
<dark_light> pango, with angle as 45 degrees, my initial expression was right, draws a \ line, then two /, then four \ ..
<pango> those can be modified to get plain rotation, but the result is boring :)
<dark_light> it looked disconnex only at other degrees
<pango> well, that's like stopped clock that's correct twice a day ;)
<dark_light> ahahahah :P
<romildo> Any of you has any experience of the internals of lablgtk?
<romildo> I am trying to add GtkDatabox to lablgtk.
<romildo> And have some questions regarding lablgtk.
<romildo> For instance, I would like to understand better the *.props files.
<romildo> What are the meanings of "wrap" and "wrapsig" in a class declaration in a .props file?
<dark_light> just to reply, i know nothing about it :)
<abez> No clue :(
chessguy has joined #ocaml
<datrus> what is the notation for functions with variable number of arguments?
shawn has joined #ocaml
<pango> you can pass a list...
<datrus> i guess i should search where sprintf is implemented for example
<pango> sprintf doesn't take a variable number of arguments
<pango> it takes one:
<pango> # Printf.sprintf ;;
<pango> - : ('a, unit, string) format -> 'a = <fun>
pango has quit [Remote closed the connection]
pango has joined #ocaml
<pango> "sprintf format" is a function, whose signature depends on the value of "format" (which is a constant, even if it looks like a string)
<pango> # Printf.sprintf "%s %d %s";;
<pango> - : string -> int -> string -> string = <fun>
<datrus> ah ok
<pango> I think it requires some amount of compiler "magic", but I don't know how much ;)
<datrus> so i suppose there is no support for variable number of arguments in ocaml. i have to pass a tuple, list or something like that
<pango> well, a list more than a tuple; tuples have constant length, that depend on their type
<datrus> i would have liked to be able to define a function sum for example
<datrus> sum 1 2;;
<datrus> sum 1 2 3;;
<datrus> etc.
<pango> what's wrong with sum [1;2] and sum [1;2;3] ?
<datrus> nothing
<pango> it's even easy: let sum = List.fold_left (+) 0
<pango> you could use an array too
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- Try something fresh"]
chessguy has joined #ocaml
gim_ has joined #ocaml
postalchris has quit ["Leaving."]
dark_light has quit [Remote closed the connection]
chessguy2 has joined #ocaml
fab_ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
chessguy has quit [Connection timed out]
beschmi has quit ["Leaving"]
chessguy2 has quit [" Try HydraIRC -> http://www.hydrairc.com <-"]
Skal has quit [Remote closed the connection]
smimou has quit ["bli"]
gim__ has joined #ocaml
gim_ has quit [Read error: 60 (Operation timed out)]
gim__ has quit ["zzzdodo"]
chessguy has joined #ocaml
dechunker has quit []