mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<mbishop> is "value" part of the extended/revised syntax?
<rwmjones> yes
zmdkrbou_ has joined #ocaml
zmdkrbou has quit [Read error: 113 (No route to host)]
zmdkrbou_ is now known as zmdkrbou
pwetpwet has quit [Remote closed the connection]
psnively has joined #ocaml
ita has quit ["Hasta luego!"]
psnively has quit [Excess Flood]
psnively has joined #ocaml
<mbishop> wow, Xavier Leroy was pissed heh
<RobertFischer> Pissed?
<mbishop> On the mailing list
<RobertFischer> Oh. The whole "STOP" thing?
<RobertFischer> Well, it is an entire contest based on mocking Ocaml's purported fragility.
<psnively> ?
<mbishop> yeah, it did seem silly
<psnively> He has a point, and it was good of Till to publicly apologize.
<psnively> He == Xavier.
<mbishop> Yes
<psnively> I love O'Caml. Not uncritically, to be sure, but I'll take it over any other language I'm aware of right now.
<psnively> Anxiously awaiting the naydynlink branch... and it'd be nice if Oleg would do a native-code version of his delimited continuations...
<psnively> natdynlink, even.
RobertFischer has quit ["If you can't get enough of me, check out http://smokejumperit.com and http://enfranchisedmind.com/blog"]
bzzbzz has joined #ocaml
smimou has quit ["bli"]
rogo has joined #ocaml
seafood_ has quit []
xavierbot has quit [Read error: 110 (Connection timed out)]
RobertFischer has joined #ocaml
jonathanv has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
psnively has quit []
jonafan has quit [Read error: 110 (Connection timed out)]
david_koontz has quit []
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
jburd has joined #ocaml
jburd has quit [Connection timed out]
psnively has joined #ocaml
RobertFischer has quit ["If you can't get enough of me, check out http://smokejumperit.com and http://enfranchisedmind.com/blog"]
psnively has quit []
mattam has quit [Read error: 113 (No route to host)]
zvrba has quit [Remote closed the connection]
zvrba has joined #ocaml
psnively has joined #ocaml
Tetsuo has joined #ocaml
psnively has quit []
ygrek has joined #ocaml
m3ga has joined #ocaml
<Tov_enst> hi,
<m3ga> hi
<Tov_enst> which (unit) test framework do you recommend ?
<m3ga> i've heard good things about ounit. i usually roll my own as needed
<Tov_enst> thank you
mattam has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
rickardg has joined #ocaml
smimou has joined #ocaml
seafood has quit [Remote closed the connection]
seafood has joined #ocaml
mrsolo has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
m3ga has quit ["disappearing into the sunset"]
smimou has quit ["bli"]
Tetsuo has quit [Remote closed the connection]
hkBst has joined #ocaml
<flux> hah, I've got a program that does lots of Unix.local_time.. and apparently each such call results in opening /etc/localtime
<flux> no wonder it's slow
<flux> actually no, not reading, only stat64'ing
<flux> which I suppose is much better - but still..
<flux> I suppose the c-library is to be blamed, but perhaps I'd better do the time arithmetics by some other means
<flux> actually it's Unix.mktime - I'm calling it once per read line of log
EliasAmaral has joined #ocaml
authentic has joined #ocaml
buluca has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
felix^^ has joined #ocaml
<felix^^> hi, i have a quick question: what does let x (a,b) = ... mean, in particular what kind of arguments are (a,b) to x?
<rwmjones> felix^^, that defines a function called x
<rwmjones> which takes a single argument
<rwmjones> but the single argument is a pair of somethings
xavierbot has joined #ocaml
<felix^^> rwmjones: is that pair then a record? or another type?
<rwmjones> it's what's known as a tuple
<rwmjones> just a pair of somethings
<rwmjones> let pair = ("hello", 123) ;;
<xavierbot> val pair : string * int = ("hello", 123)
<rwmjones> let a, b = pair ;;
<xavierbot> val a : string = "hello"
<xavierbot> val b : int = 123
<felix^^> ahh, cool
<rwmjones> open Printf ;;
<rwmjones> let x (a,b) = printf "%s, %d\n" a b ;;
<xavierbot> val x : string * int -> unit = <fun>
<rwmjones> x pair ;;
<xavierbot> hello, 123
<xavierbot> - : unit = ()
<rwmjones> x (a, b) ;;
<xavierbot> hello, 123
<xavierbot> - : unit = ()
<felix^^> can i reference the tuple as a whole too?
<rwmjones> yes
<felix^^> inside that fun?
<rwmjones> eg:
<rwmjones> let y pair = pair, pair ;;
<xavierbot> val y : 'a -> 'a * 'a = <fun>
<rwmjones> y pair ;;
<xavierbot> - : (string * int) * (string * int) = (("hello", 123), ("hello", 123))
<rwmjones> normally if you need two arguments to a function you shouldn't use a pair
<felix^^> so the , is generally a constructor for tuples?
<rwmjones> yup
<rwmjones> the brackets can usually be omitted
<felix^^> i see, that's what confused me then :) was trying to apply an existing model of how to define a function and ocaml didn't complain but instead considered it a tuple. so the * is the respective sign for the tuple content?
<rwmjones> * is used when printing types to indicate a tuple
<rwmjones> so the value pair has type int * string
<felix^^> alright, i think i understand then. thanks!
ttamttam has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
ttamttam has quit ["Leaving."]
ttamttam has joined #ocaml
Demitar has joined #ocaml
Tetsuo has joined #ocaml
asmanur has joined #ocaml
ppsmimou has joined #ocaml
ppsmimou has quit [Client Quit]
bluestorm_ has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
ttamttam has left #ocaml []
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
asmanur_ has joined #ocaml
jonathanv is now known as jonafan
loufoque has joined #ocaml
<loufoque> when I have a record with a mutable field, does it mean the field is actually a pointer?
<rwmjones> loufoque, no
<rwmjones> if it's an int (or char) it'll be stored inline
<loufoque> and if it's another record?
<rwmjones> also a record with all float fields, even if mutable, is stored inline
<rwmjones> ah right, if it's another record, then it's always a pointer
<rwmjones> whether or not it's mutable doesn't matter basically
TFK has joined #ocaml
<loufoque> you mean records are necessarily pointers?
<rwmjones> loufoque, there's a function Obj.is_block which you can use to find out if something is a pointer or not
<rwmjones> no records are allocated areas of memory
<rwmjones> but things which refer to records are pointers!
<loufoque> so if I put records in an array, my array actually containers pointers to those areas?
<rwmjones> yup
<loufoque> what if I don't want that?
<rwmjones> use something like BigArray to memory-map your data
<rwmjones> but basically if you want to use Array you're s.o.l
mikeX has joined #ocaml
<loufoque> if I have type pos = {x : int; y : int} and type pair = { a = pos; b = pos; }, the fields of pair aren't inline?
asmanur has quit [Read error: 110 (Connection timed out)]
<loufoque> a : pos; b : pos sorry
<asmanur_> no
<loufoque> if I use a tuple instead, will it be?
<asmanur_> no
<asmanur_> a tuple use the same representation in memory than a record
<loufoque> so writing type pair { a_x : int; a_y : int; b_x : int; b_y : int} is actually more efficient?
<asmanur_> (something like a C-array)
<asmanur_> hum, I guess
<loufoque> isn't that quite ridiculously annoying?
<bluestorm_> do you have a good reason to care so much about memory efficiency ?
<rwmjones> loufoque, no because other important things like persistence wouldn't work if the implementation was different
<rwmjones> if you want an array of ints, use the BigArray array of ints
<loufoque> bluestorm_: I'm doing image processing, and it's slow.
<loufoque> (also it eats quite a lot of memory it seems)
<bluestorm_> and the profiling shows that your pair is in the slow path of your code ?
<rwmjones> loufoque, how about keeping your data as strings? they're basically opaque lumps of memory with fast access
<loufoque> rwmjones: because my data structure is fairly more complicated, it contains 32-bit integers that index other parts of the image too.
<loufoque> I'm not too sure using left shifts etc. everytime I want to get the int of the string is a good idea
<Tov_enst> cannot refactor your structure into a high-level + low-level one ?
<rwmjones> loufoque, how about writing a preprocessor to add an "inline record" modifier for records?
<rwmjones> eg:
felix^^ has quit [Read error: 113 (No route to host)]
<rwmjones> type foo = { inline a : pos ; inline b : pos }
<rwmjones> which would just unfold the type of pos inline
<loufoque> that would be quite nice yes
<loufoque> but how would that preprocessor work?
<rwmjones> using camlp4 of course
<loufoque> what would it generate
<rwmjones> type foo = { a_a_x : int; a_a_y : int; (* etc *) }
<rwmjones> and some convenience functions for access
<rwmjones> or have an access operator as well in the preprocessor
<loufoque> unfortunately, I know nothing about campl4
<loufoque> so I can't write such a thing
<bluestorm_> rwmjones: your suggestion is interesting
<bluestorm_> but it's not really hmm, "user-friendly" ^^
<loufoque> if my type is abstract, yet is an int
<loufoque> will it be inlined?
<rwmjones> loufoque, yes
<rwmjones> the compiler knows all the types
<bluestorm_> rwmjones: cross modules ?
<rwmjones> yes of course, otherwise how would the compiler know how to code the allocation for a structure, unless it knew its type completely?
smimou has joined #ocaml
<bluestorm_> hm, i thought the allocation code could be in the module object code, and thus be connected at linking time
TFK has quit [Read error: 110 (Connection timed out)]
CRathman has joined #ocaml
rickardg has quit [Read error: 110 (Connection timed out)]
ita has joined #ocaml
mikeX_ has joined #ocaml
psnively has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
EliasAmaral has quit [Read error: 101 (Network is unreachable)]
asmanur_ has quit [Read error: 110 (Connection timed out)]
Torment has joined #ocaml
psnively has quit []
hkBst has quit ["Konversation terminated!"]
ygrek has joined #ocaml
Jedai has quit [Read error: 110 (Connection timed out)]
ygrek has quit ["Leaving"]
ygrek has joined #ocaml
EliasAmaral has joined #ocaml
ttamttam has joined #ocaml
CRathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.9/2007102514]"]
romanoffi has left #ocaml []
buluca has joined #ocaml
kelaouchi has joined #ocaml
ygrek has quit [Remote closed the connection]
\\ has quit [Remote closed the connection]
\\ has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Remote closed the connection]
filp has quit ["Bye"]
ita is now known as ita|zzz
ita|zzz has quit ["Hasta luego!"]
<loufoque> how can I have the trace of an exception to debug it?
<pango_> compile with -g, set OCAMLRUNPARAM='b' in environment
<pango_> before 3.10, it also only works for bytecode
* loufoque has 3.09
* loufoque wonders why his distribution doesn't have a more recent version
RobertFischer has joined #ocaml
RobertFischer has quit [Client Quit]
Tetsuo has quit [Remote closed the connection]
Tetsuo has joined #ocaml
loufoque has quit ["Quitte"]
loufoque has joined #ocaml
<loufoque> hmm, I just compiled ocaml 3.10 and lablgtk doesn't work anymore
<loufoque> why do libraries get broken in compiler upgrades?
<flux> the interface compatibility requirements are quite strict in ocaml
<flux> that is: it doesn't accept any change
<flux> I understand that's because that hasn't been researched that much, and it's a safe choice (so you won't be able to subvert the soundness of the type system)
bluestorm_ has quit ["Konversation terminated!"]
<flux> although one would think that it should be possible to allow for example an interface that is purely a superset of an older one..
<loufoque> well, breaking the C++ ABI a few times generated quite some fuss, people weren't happy at all
<loufoque> yet ocaml people don't care?
<flux> but there aren't shared ocaml libraries around, are there?
<flux> so it doesn't matter that much
<flux> basically just recompile all modules. and if you're using a distribution, that's done for you.
<flux> of course, in C nothing prevents a library from changing int foo(int a, int b) into float foo(float a, char* b) between releases - and even C++ symbol mangling doesn't prevent changing the type of the return value of a function
<flux> with ocaml, people like things to actually work once they compile :)
buluc1 has joined #ocaml
david_koontz has joined #ocaml
ttamttam has left #ocaml []
psnively has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
mikeX__ has joined #ocaml
Tetsuo has quit ["Leaving"]
mikeX_ has quit [Read error: 101 (Network is unreachable)]
psnively has quit []