rwmjones has quit [Read error: Operation timed out]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
wtetzner has joined #ocaml
rwmjones has joined #ocaml
Boscop has quit [Ping timeout: 248 seconds]
sebz has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
sebz has quit [Client Quit]
dgbaley27 has left #ocaml []
sebz has joined #ocaml
ousado has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ulfdoz has quit [Ping timeout: 258 seconds]
ulfdoz has joined #ocaml
arubin has joined #ocaml
mjonsson has quit [Remote host closed the connection]
g0dmoney- has quit [Ping timeout: 258 seconds]
g0dmoney- has joined #ocaml
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
sebz has joined #ocaml
sepp2k1 has quit [Read error: Connection reset by peer]
sebz has quit [Read error: Connection reset by peer]
sebz has joined #ocaml
arubin has quit [Quit: arubin]
sebz has quit [Ping timeout: 240 seconds]
leoncamel has quit [Ping timeout: 245 seconds]
bzzbzz has quit [Quit: leaving]
leoncamel has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
leoncamel has quit [Ping timeout: 260 seconds]
albacker has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
<flux>
(there is 'ignore')
<flux>
(although perhaps that would be better written like let () = x in.. to avoid accidental ignoring of value, say in the case of partial application)
musically_ut has quit [Ping timeout: 276 seconds]
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
leoncamel has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
ttamttam has joined #ocaml
Cyanure has joined #ocaml
foocraft has quit [Ping timeout: 245 seconds]
foocraft has joined #ocaml
avsm has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
avsm has quit [Client Quit]
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
sebz has joined #ocaml
avsm has quit [Client Quit]
ttamttam has quit [Remote host closed the connection]
avsm has joined #ocaml
ttamttam has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
albacker has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
Kakadu has joined #ocaml
avsm has joined #ocaml
avsm has quit [Ping timeout: 258 seconds]
ikaros has joined #ocaml
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ankit9|zzz is now known as ankit9
sebz has joined #ocaml
sebz has quit [Client Quit]
alxbl has quit [Ping timeout: 260 seconds]
alxbl has joined #ocaml
edwin has joined #ocaml
<bnwr>
flux: I tend to annotate the type of ignores for this reason
ikaros has quit [Remote host closed the connection]
rntz has quit [Read error: Operation timed out]
rntz has joined #ocaml
sepp2k has joined #ocaml
albacker has quit [Ping timeout: 240 seconds]
ttamttam has quit [Ping timeout: 276 seconds]
ikaros has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Snark has joined #ocaml
Cyanure has joined #ocaml
Cyanure has quit [Remote host closed the connection]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
_andre has joined #ocaml
avsm has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm1 has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
sebz has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm1 has quit [Quit: Leaving.]
larhat has joined #ocaml
destrius has quit [Quit: Leaving.]
avsm has joined #ocaml
maufred has joined #ocaml
rossberg has quit [Ping timeout: 240 seconds]
rossberg has joined #ocaml
ikaros has quit [Ping timeout: 258 seconds]
Cyanure has joined #ocaml
musically_ut has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
musically_ut has quit [Ping timeout: 258 seconds]
ttamttam has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has joined #ocaml
thomasga has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
musically_ut has joined #ocaml
joewilliams has quit [Read error: Operation timed out]
gmcabrita has quit [Ping timeout: 248 seconds]
avsm has joined #ocaml
lopex has quit [Ping timeout: 260 seconds]
ttamttam has quit [Quit: Leaving.]
ttamttam has joined #ocaml
rntz has quit [Ping timeout: 258 seconds]
rntz has joined #ocaml
ttamttam has quit [Quit: Leaving.]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
sebz has joined #ocaml
joewilliams has joined #ocaml
struktured has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
ttamttam has quit [Quit: Leaving.]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
lopex has joined #ocaml
ikaros has joined #ocaml
ousado has quit [Ping timeout: 258 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
EmmanuelOga has joined #ocaml
EmmanuelOga has quit [Client Quit]
ttamttam has quit [Quit: Leaving.]
ttamttam has joined #ocaml
raichoo has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
emmanuelux has joined #ocaml
leoncamel has quit [Ping timeout: 260 seconds]
leoncamel has joined #ocaml
* adrien
<3 ocamlnat on the forge
<hcarty>
adrien: Seconded!
<adrien>
I was wondering if it could be used inside a program to make the program scriptable
<adrien>
hmmm
<adrien>
well, one day I'll try it :P
avsm has quit [Quit: Leaving.]
chris_6372 has joined #ocaml
<chris_6372>
ocaml and actors?
<taupin>
why not
chris_6372 has left #ocaml []
avsm has joined #ocaml
<hcarty>
adrien: I imagine it could, as long as the QPL license terms are acceptable.
<hcarty>
adrien: Or you could modify ocamlnat to allow communication over some non-local medium (sockets, something networky) and avoid some of the licensing issues
<hcarty>
I've tried the new ocamlnat/jit project. The performance is impressive.
flapjackery has joined #ocaml
eikke has joined #ocaml
<eikke>
hija
<eikke>
I'm working on some Ocaml-to-C bindings, and need these to be as performant as possible
<eikke>
I noticed in the 'read' binding from the Unix library CAMLparam* isn't used, but only the (old, afaik?) Begin_root and End_roots calls on the 'buf' argument
<eikke>
does this mean one shouldn't use CAMLparam* for integer values?
<hcarty>
eikke: You should always use the CAMLparam and CAMLreturn functions
<hcarty>
eikke: Some older code does not, but it's generally considered bad practice and can introduce subtle data corruption bugs if you don't use the CAML* macros
<eikke>
hcarty: but for which types should CAMLparam* be used?
<eikke>
hcarty: there's some contradicting information out there
<eikke>
hcarty: e.g. for int arguments, I see no reason why 'roots' should be defined etc, since they're just unboxed arguments, so Int_val can work as expected, no matter how GC is involved?
<hcarty>
eikke: Everything
<hcarty>
Roots are separate from the CAMLparam macros, if I recall correctly
<thelema>
hcarty: I think CAMLparam is only needed for proper GC operation, which means it's registering some kind of roots
Kakadu has quit [Quit: Page closed]
<eikke>
indeed
<eikke>
that's what the macros in memory.h look like, at least
<thelema>
eikke: for high performance C calls, it should be safe to skip CAMLparam-ing int-like values
<thelema>
eikke: also, if you can avoid ocaml allocation, you can use "noalloc" for a thinner external call
<eikke>
thelema: I dont do caml allocations myself, but need to use uerror(), which conflicts with noalloc
Boscop has joined #ocaml
<thelema>
eikke: fair enough.
<hcarty>
thelema, eikke: Thank you for the clarificataion on roots. However, if a function doesn't work with noalloc it's probably best to start with CAMLparam*/CAMLreturn*.
<hcarty>
Once that is tested and stable optimizations could be made with a working implementation to compare against.
<thelema>
hcarty: totally agreed
<eikke>
the 'safe' version works fine :) but callgrind shows about 20% of my system call binding is spent in the root management, so was wondering how much I could get rid of that
ikaros has quit [Quit: Ex-Chat]
larhat has quit [Quit: Leaving.]
EmmanuelOga has joined #ocaml
EmmanuelOga has left #ocaml []
ikaros has joined #ocaml
rby has quit [Ping timeout: 245 seconds]
rby has joined #ocaml
<thelema>
eikke: uerror is needed for raising unix errors; you may be able to avoid some of the root management by returning an int to indicate success/failure. On the ocaml side, this could be typed as a variant without arguments.
<avsm>
hcarty: are you sure ocamlnat is bound by the QPL? the compiler standard libraries are LGPL+exception, i thought
<avsm>
eikke: are you using generational roots?
<eikke>
avsm: eh? :)
<eikke>
thelema: true... could look into that as well
<avsm>
you said that your callgrind is spending time in "root management"
<avsm>
your bindings can maybe use the generational roots instead of normal roots, which are faster if they arent modified very much
<thelema>
eikke: is the only reason you're using noalloc because of `uerror`?
<eikke>
thelema: yes
<thelema>
avsm: I don't think generational roots will help
<thelema>
err, "you're using noalloc" -> "you're not using noalloc"
<eikke>
oh, and caml_raise_end_of_file
Calvin_ has joined #ocaml
<thelema>
yes, to raise exceptions. which require allocation
<eikke>
it's part of a much larger file, so this doesnt include headers etc
<thelema>
got it. All this for a pread() call...
<thomasga>
eikke: you should do the error handling on the OCaml side and use noalloc
<Calvin_>
Hi, I'm new to Ocaml and I have some trouble with syntax. I expose my problem here : http://pastebin.com/p9XkR7Nr (Comments are in french, but they are skippable) Can someone help me ?
<eikke>
thelema: that pread calls shows up to be one of the most expensive calls in our app now... (its called a lot as well)
<Calvin_>
thelema thank you !
<thelema>
eikke: maybe a very thin binding to just pread itself, and use ocaml to implement the loop for an exact read
<thelema>
eikke: also, the semantics of this implementation probably aren't what you want.
<eikke>
thelema: loop in ocaml is what we tried before
<eikke>
thelema: how so?
Calvin_ has quit [Quit: Page closed]
<eikke>
I realize there's no enter_blocking_section etc, but that's intentional
<thelema>
eikke: if there are 5 bytes left in the channel to be read, and you ask for 10 bytes, it'll read the 5 bytes and then throw them away, raising end_of_file
<thelema>
that said, I guess that's one valid interpretation of "exactly"
<eikke>
thelema: it's always reading from a file, and the 'exactly' means: unless an error is thrown, that number of chars is read
<eikke>
if it's less, an exception occurs
<thelema>
ok.
<eikke>
but in our application, this should never happen, unless an actual error condition (in the source file) is met
<thelema>
did you have this loop implemented in ocaml in the past?
<eikke>
yes
<thelema>
and I guess you replaced that with this, because it was faster. Try using noalloc and returning the error.
<eikke>
still have a similar loop for 'write' (where the docs of the unix package are slightly wrong, imho)
<eikke>
thelema: will do that (working on something more urgent at the moment)
dsheets has quit [Ping timeout: 260 seconds]
<eikke>
with regard to write: the docs state "write repeats the writing operation until all characters have been written or an error occurs."
<thelema>
eikke: it doesn't?
<eikke>
but if you check the implementation, not all data could be written, but no exception is thrown, when EAGAIN or EWOULDBLOCK occurs
<eikke>
it was confusing at first
<eikke>
I interpreted the docs as: all data will be written and the integer result will be the given length, unless an exception is thrown
<thelema>
:) apparently that's not the right interpretation - an error occurring allows the function to fail however it wants
musically_ut has joined #ocaml
<eikke>
appareantly
ftrvxmtrx has joined #ocaml
raichoo has quit [Quit: Lost terminal]
<thelema>
eikke: another optimization point may be just to reduce the number of calls to this read_exactly operation - maybe you could parse out of a buffer instead of parsing by reading one unit at a time? (making big assumptions that that's what you're doing)
Kakadu has joined #ocaml
<eikke>
thelema: we might look into that at a later stage, but at this moment we can't make any good assumptions on how big the reads should be then
<eikke>
thelema: they're pretty all over the place, depending on workload, and of very varying sizes
ftrvxmtrx has left #ocaml []
maufred has quit [Quit: leaving]
ulfdoz has joined #ocaml
yezariaely has joined #ocaml
avsm has quit [Quit: Leaving.]
yezariaely has quit [Quit: Leaving.]
sepp2k has quit [Read error: Connection reset by peer]
tomprince has quit [Ping timeout: 255 seconds]
thomasga has quit [Quit: Leaving.]
tomprince has joined #ocaml
gmcabrita has joined #ocaml
leboulanger has joined #ocaml
flapjackery has quit [Quit: Leaving]
leboulanger has quit [Remote host closed the connection]
<adrien>
hcarty: right; does QPL mix with GPL?
struktured has quit [Quit: Konversation terminated!]
struktured has joined #ocaml
bzzbzz has joined #ocaml
ztfw has joined #ocaml
rgrinberg has quit [Ping timeout: 259 seconds]
rwmjones has quit [*.net *.split]
Reaganomicon has quit [*.net *.split]
mlh has quit [*.net *.split]
wagle has quit [*.net *.split]
Axioplase_ has quit [*.net *.split]
rwmjones has joined #ocaml
Reaganomicon has joined #ocaml
Axioplase_ has joined #ocaml
mlh has joined #ocaml
wagle has joined #ocaml
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
ygrek has joined #ocaml
ztfw has quit [Read error: Connection reset by peer]
ztfw has joined #ocaml
ztfw has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 258 seconds]
_andre has quit [Quit: leaving]
sh4rm4 has joined #ocaml
<sh4rm4>
i am trying to compile a piece of ocaml sw ... i installed the prerequisites through the package manager
<sh4rm4>
Error: Error on dynamically loaded library: dlllablgtk2.so: dlllablgtk2.so: cannot open shared object file: No such file or directory
<sh4rm4>
this .so does not exist, but i have a liblablgtk2.a
<sh4rm4>
so how can i tell the compiler to use that file instead ?
<adrien>
dll*.so are used for bytecode compilation
<adrien>
maybe your distro has a separate package for that
<thelema>
sh4rm4: have you installed the dev-packages of your prerequisites?
<sh4rm4>
yep
<adrien>
and any reason you're compiling as bytecode rather than nativecode?
<sh4rm4>
i'm just a dump user typing make ;)
<sh4rm4>
*dumb
<adrien>
"make opt"?
<sh4rm4>
no, i've only used "make"
<thelema>
sh4rm4: `dpkg -l liblablgtk2-ocaml-dev`
<adrien>
and do you have separate packages for runtime on yourdistro?
<thelema>
sh4rm4: also, try "make opt" instead of just make
<adrien>
and which distro and which software?
<sh4rm4>
suse 11.4 / the software is called frama-c
<sh4rm4>
i | lablgtk2 | An Objective Caml Interface to gtk2+ | package
<sh4rm4>
i | lablgtk2-devel | An Objective Caml interface to gtk2+ | package
<sh4rm4>
both are installed, there's nothing else
<thelema>
sh4rm4: fair enough. does `make opt` work?
<sh4rm4>
make opt doesnt work either
<sh4rm4>
it calls ocaml.opt, btw
<thelema>
lol
<thelema>
usually `make opt` builds the native version of the program, not using the natively compiled ocaml compiler to build the bytecode program
<sh4rm4>
even make clean doesnt work; ".depends: no such file"
<thelema>
sh4rm4: that's just a warning from `make`, not an error
<adrien>
also, do you want the GUI?
<sh4rm4>
indeed
<thelema>
hmm, `make opt` should build the native code version.
<sh4rm4>
make opt fails as well with ".depends: no such file"
<adrien>
godi's script doesn't seem to try to use the native code
<adrien>
so it's either automatic, or uneavailable
<adrien>
"make depend opt" maybe
avsm has joined #ocaml
<thelema>
sh4rm4: it's possible your lablgtk is packaged incorrectly. Can you install it from source?
<sh4rm4>
i'll try, but i wonder why that .depend file is missing
<thelema>
sh4rm4: `make depend` makes all the .depend files for me.
eikke has joined #ocaml
<sh4rm4>
make depend
<sh4rm4>
Makefile:2267: .depend: No such file or directory
<adrien>
NaCl: remember anything about lablgtk2 in opensuse 11.4?
<thelema>
sh4rm4: is that all it does? mine goes and generates dependencies for all the .ml files in the project.
<sh4rm4>
after that it tries to compile the .so, which is not there
<thelema>
sh4rm4: really? on `make depend`?
<sh4rm4>
no, Error: Cannot find file lablgnomecanvas.cma
<sh4rm4>
oh wait, that's maybe because i just deinstalled labl
fraggle_ has quit [Remote host closed the connection]
<sh4rm4>
i just compiled and installed labl, now i get Error: Cannot find file lablgnomecanvas.cmxa
ftrvxmtrx has joined #ocaml
<thelema>
sh4rm4: you didn't satisfy all the deps of labl, so it couldn't build that part of itself
<sh4rm4>
no, i didn't do "make world" as described in the README, but just make
<sh4rm4>
now the compilation of frama continues
<sh4rm4>
so apparently the suse package is broken
<sh4rm4>
"make world" is required by labl to compile that cmxa stuff, it seems
<thelema>
sh4rm4: well, ok.
<sh4rm4>
ok, compilation finished succesfully. thanks for the help
<thelema>
you're welcome.
sebz has joined #ocaml
<sh4rm4>
...but it doesnt work...
fraggle_ has joined #ocaml
<sh4rm4>
that program is pretty bitchy
<sh4rm4>
of course that's not the guilt of ocaml :)
<thelema>
I can imagine that given the specialist use of frama-c, not too much effort has been put in making it easy to use by newcomers
<adrien>
well, there is a godi package for it and it builds fine iirc
<adrien>
still doesn't work?
<sh4rm4>
it does work, but it has a retarded file open dialog
<thelema>
yes, lablgtk never did upgrade its file chooser
<sh4rm4>
you have to select exactly one C file, that has a main function, and click on "add"
<sh4rm4>
also, it doesnt remember the last path that was used
<sh4rm4>
once you made a mistake (i.e. selecting a file, and clicking just on OK), you have to create a new "project"
<sh4rm4>
some internal state seems to be broken then...
<adrien>
lablgtk2's filechoser?
<thelema>
adrien: yes, lablgtk2 is still using an old filechooser
<adrien>
the one with two columns of equal width?
<adrien>
no it's not :P
<thelema>
isn't it?
<thelema>
I guess I'm mistaken
<thelema>
in any case, that doesn't seem to be sh4rm4's problem
<adrien>
you have to use GWindow.file_chooser_dialog
<adrien>
oh, reminds me there's a bug around that
<sh4rm4>
it's a splitted dialog, you have to browse in one pane, select one or more files (more than 1 didnt work for me) and then click ADD to add it to the second pane, then "OK"
<adrien>
(when you add buttons)
<adrien>
that's the old gtk file chooser
<adrien>
unfortunately gtk's new file chooser is still quite bad
ttamttam has quit [Ping timeout: 260 seconds]
ftrvxmtrx has quit [Quit: Leaving]
Kakadu has quit [Read error: Connection reset by peer]
emmanuelux has quit [Remote host closed the connection]
fraggle_ has quit [Quit: -ENOBRAIN]
ikaros_ has joined #ocaml
leboulanger has joined #ocaml
<adrien>
I have a "value list" with "type value = S of string | I of int | F of float | B of bool"; I want to check that the elements in a list are always of the same kind: always S _ or always I _ or ...
<adrien>
I'd probably do it with something low-level and the numeric value of S, F, I and B
Snark has quit [Quit: Quitte]
<adrien>
or am I missing something simpler/better?
<adrien>
(besides changing the types, which is something I'll probably do anyway)
<thelema>
adrien: let all_same = function [] -> true | h::t -> List.for_all (same_type h) t
<thelema>
let same_type a b = match a,b with S _,S _ | I _,I _ | F _,F _ | B _,B _ -> true | _ -> false
<adrien>
hmmm, the brute-force would only require n+1 match cases, right
<adrien>
I was thinking I'd have to do n^2 cases :P
<adrien>
thanks
<thelema>
If you really wanted to optimize same_type, you could use obj and compare the tags
fraggle_ has joined #ocaml
<adrien>
I don't care about performance for this code
<thelema>
nevermind then, use the above.
<thelema>
If anyone's interested: let same_type (a:value) (b:value) = (Obj.tag (Obj.repr a)) = (Obj.tag (Obj.repr b))
<thelema>
this only works because of the specific type being used.
fschwidom has joined #ocaml
edwin has quit [Remote host closed the connection]
fraggle_ has quit [Quit: -ENOBRAIN]
albacker has quit [Ping timeout: 258 seconds]
leoncamel has quit [Ping timeout: 260 seconds]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
leoncamel has joined #ocaml
fraggle_ has joined #ocaml
dsheets has joined #ocaml
fschwidom has quit [Remote host closed the connection]
ttamttam has joined #ocaml
Arsenik has joined #ocaml
eikke has quit [Quit: leaving]
ttamttam has quit [Quit: Leaving.]
ikaros_ has quit [Quit: Ex-Chat]
albacker has quit [Ping timeout: 240 seconds]
mjonsson has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
wtetzner has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
wtetzner has joined #ocaml
leboulanger has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
PiRSquared17 has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
Associat0r has quit [Quit: Associat0r]
PiRSquared17 has quit [Changing host]
PiRSquared17 has joined #ocaml
PiRSquared17 has quit [Quit: Read error: Ping timeout: 240 seconds]