gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
maihem has joined #ocaml
Submarine has left #ocaml []
foxster has quit [Client Quit]
cjohnson has joined #ocaml
Anvil_Vapre has quit ["Leaving"]
Anvil_Vapre has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
Smerdyakov has joined #ocaml
cedricshock has joined #ocaml
maihem has quit [Read error: 54 (Connection reset by peer)]
Anvil_Vapre has quit [Read error: 60 (Operation timed out)]
vezenchio has joined #ocaml
fab_ has joined #ocaml
Anvil_Vapre has joined #ocaml
_fab has quit [Read error: 60 (Operation timed out)]
GreyLensman has quit ["Leaving"]
Smerdyakov has quit ["sleep"]
cjohnson has quit [Read error: 104 (Connection reset by peer)]
Iter has quit [Read error: 104 (Connection reset by peer)]
Iter has joined #ocaml
ramen has joined #ocaml
cedricshock has quit ["Leaving"]
ramen has quit [Read error: 54 (Connection reset by peer)]
buggs^z has joined #ocaml
buggs has quit [Read error: 60 (Operation timed out)]
mrsolo has joined #ocaml
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
vezenchio has joined #ocaml
Iter has quit [Read error: 110 (Connection timed out)]
buggs^z is now known as buggs
buggs^z has joined #ocaml
buggs has quit [Read error: 60 (Operation timed out)]
buggs^z is now known as buggs
Anvil_Vapre has quit [Read error: 110 (Connection timed out)]
Anvil_Vapre has joined #ocaml
Anvil_Vapre has quit [Read error: 110 (Connection timed out)]
Anvil_Vapre has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
Anvil_Vapre has quit [Read error: 110 (Connection timed out)]
Anvil_Vapre has joined #ocaml
kinners has joined #ocaml
mij has quit [Read error: 104 (Connection reset by peer)]
Iter has joined #ocaml
mattam_ is now known as mattam
mattam has quit [Read error: 110 (Connection timed out)]
bk_ has joined #ocaml
wolfman8k has joined #ocaml
Anvil_Vapre has quit [Read error: 110 (Connection timed out)]
Anvil_Vapre has joined #ocaml
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
mattam has joined #ocaml
mij has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
taco2 has joined #ocaml
<taco2> hi there, can i ask for a little help ?
<p0lartype> no
<p0lartype> ;)
<taco2> er...
<taco2> pleaz :/
<p0lartype> ask instead of asking to ask
Iter has quit [Read error: 110 (Connection timed out)]
mattam has joined #ocaml
<taco2> here's my problem : i have a float matrix data stored in matrix.data file
<taco2> and i want to load it in a bigarray.array2
<taco2> here's what i coded :
<taco2> let myFile = Unix.openfile "matrix.data" [ O_RDONLY ] 0;;
<taco2> let myMatrix = Bigarray.Array2.map_file myFile float32 c_layout false 4 3;;
<taco2> but when i try to display myMatrix, its a 4x3 matrix filled with 0.0 !
<taco2> and now i want to die :-(
murl has joined #ocaml
taco2 has quit [Remote closed the connection]
maihem has joined #ocaml
kinners has quit ["leaving"]
murl has quit ["Segmentation fault (2h59m23s)"]
slashvar1ejcp] has joined #ocaml
slashvar[ejcp] has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
<wolfman8k> anyone use lablgtk and lablgl?
Anvil_Vapre has quit ["Leaving"]
<wolfman8k> this is why OCaml is scary:
<wolfman8k> This expression has type GlGtk.area = < as_area : GlGtk.gl_area Gtk.obj; as_widget : Gtk.widget Gtk.obj; coerce : GObj.widget; connect : GlGtk.area_signals; destroy : unit -> unit; drag : GObj.drag_ops; event : GObj.event_ops; get_id : int; make_current : unit -> unit; misc : GObj.misc_ops; set_size : width:int -> height:int -> unit; swap_buffers : unit -> unit > but is here used with type < height : int; make_current : unit -> (x:int -> y:int
<wolfman8k> -> w:int -> h:int -> unit) -> int -> int -> int -> int -> 'a; width : int; .. > Only the second object type has a method height
<wolfman8k> is one supposed to get used to these types of error messages?
<fab_> wolfman8k: the most importand part is the last sentence
Anvil_Vapre has joined #ocaml
* wolfman8k cries
GreyLensman has joined #ocaml
jean-fr has joined #ocaml
jean-fr has quit [Client Quit]
taco2 has joined #ocaml
<taco2> hi, does anyone knows the solution to the problem i exposed like 2 hours ago ?
<taco2> so, no one knows how to fix this... :/
<wolfman8k> argh, lablgtk is severely lacking :(
<wolfman8k> taco2: sorry, i'm a newbie :(
<taco2> mkay
taco2 has quit ["Leaving"]
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> Nein! my OCaml program crashed hard and took down my X server! :O
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> mega Nein! it did it again :o
wolfman8k has quit [Remote closed the connection]
<mattam> ...
wolfman8k has joined #ocaml
<wolfman8k> :'(
<mattam> wolfman8k: you know xkill, right ?
<wolfman8k> the entire X server is crashing
<mattam> ha, i suppose you're using OpenGL then
<wolfman8k> yes
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> ok i think i figured it out
<wolfman8k> it only seems to crash on exit when i quit using a shortcut key :O
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> or not =(
Anvil_Vapre has quit [Read error: 60 (Operation timed out)]
Anvil_Vapre has joined #ocaml
Submarine has joined #ocaml
monotonom has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
yella has joined #ocaml
<yella> hi
<yella> why is this not working:
<yella> let global = ref
<yella> global := "la"
<monotonom> You must give an initial value to ref. let global = ref "la"
<yella> but without an inital value i have 'a which seemed fine..
<monotonom> No, that is not fine.
<Submarine> You cannot create refs with no value inside.
<yella> if i have to define a reference to a record which content is not available now, how do I define it then?
<Submarine> let foobar = ref None
<Submarine> ...
<Submarine> foobar := Some (x)
<monotonom> Give it a silly record.
<Submarine> (or if you really want to optimize the thing away, there are tricks with Obj.magic, but this is wizardry.)
<yella> ah submarine, that's an idea.
<yella> im not used to using options
<bk_> i've heard Obj.magic is evil
<monotonom> You should also consider using mutable fields in the record.
<Submarine> bk: It is.
<yella> well. mutable or not does not really affect this?
<bk_> ok :>
<Submarine> Well, if you have mutable record components, then you may not need to have the record through a reference.
<Submarine> bk: Ditto for Marshal. :-)
<bk_> i'll kepp that in mind then
<bk_> keep even
<yella> submarine: true. but creating a mutable record just for this reason ..
<Demitar> bk_, let me affirm what Submarine said. Obj.magic is *evil*! If you think you need it you don't. Ever.
<Submarine> Demitar: False.
<Submarine> Demitar: It is obvious that there are legitimate cases where you need it.
<Demitar> When 99% of the users think they have found one they are very very wrong.
<Submarine> That's probably closer to truth.
<Demitar> Did you have a specific case where it'd be needed in mind?
<Submarine> For instance, the ocaml toplevel has to use Obj.magic or equivalent. The correctness of this is not justified by ocamlc typechecking the ocaml toplevel, but by the subject reduction theorem of the ocaml type system.
<Submarine> Marshalling is also untyped (which may be seen as a weakness).
<Submarine> In general, you may legitimately use Obj.magic when you have a proof that it's correct (and there are cases where this is bound to happen and the ocaml typesystem can't see it), which generally is justified by having a theorem for it, or having the system type in a more general type system.
<Submarine> For instance, translating terms from System F or the Calculus of Constructions to OCaml yields such uses of Obj.magic.
<Demitar> The problem with such proofs are obvious though. They can be wrong. :)
cedricshock has joined #ocaml
<monotonom> You can use Coq to write such proofs. Coq will check the proof.
<Submarine> Demitar: The correctness of any OCaml program relies on the subject reduction property of OCaml, and I don't think there's a proof of it for the current type system.
Smerdy has joined #ocaml
<Submarine> monotonom: Yes, you *can*.
<wolfman8k> what is Obj.magic? some sort of casting?
* Submarine smiles.
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov
<Submarine> wolfman8k: Something you don't want to use unless you REALLY know what you're doing.
<monotonom> And let me quickly terminate this chain of trust. You can say maybe the Coq wrongly approves the proof because some cosmic ray changes a bit in the computer. I have no solution to that.
<wolfman8k> now that it's forbidden, i want to use it =]
<Submarine> wolfman8k: It's a universal cast. It breaks the type system, so if you use it your program may crash.
<Submarine> wolfman8k: You have no reason to use it except in very specific cases.
<monotonom> It is not forbidden.
<Demitar> monotonom, I was more concerned with mistakes like typos and the like. Those will corrupt any program, Obj.magic or not. But if you use Obj.magic they get a lot more difficult to debug. Which is the reason Obj.magic is evil in the first place.
<monotonom> Yes it is evil.
<monotonom> If someone thinks he needs Obj.magic all the time, I will recommend him to switch to C.
* Submarine tries to remember the last time he used Obj.magic
<Submarine> I've used the marshalling thing though.
<Demitar> I only use marshalling for caching. And it's extremely good at that.
<Submarine> caching?
* Submarine has processes communicate using pipes and sockets.
<Demitar> Stat your binary, stat the intermediary file, stat the source file if one doesn't look right regenerate the data otherwise do a lightning fast unmarshalling of the data.
wolfman8k has quit [Remote closed the connection]
<Demitar> I parse big logfiles in that application and this way it's so fast I can regenerate the whole thing each time a new file comes in.
<Demitar> Submarine, that's the second mostly-safe use of marshalling I can think of.
wolfman8k has joined #ocaml
<monotonom> Neat. Pre-compiled C++ headers.
<wolfman8k> this is so sucky, my X server keeps crashing =(
mattam has joined #ocaml
<Submarine> Demitar: In order not to risk any issue with marshalling and cross-process communications, we hash all the ML files defining data structures and tag the files with the hash.
<Submarine> Demitar: We refuse to load data into an app that does not have the same MD5 as the original.
<Submarine> wolfman8k: Are you a student at TAU?
<wolfman8k> Submarine: no
* Submarine was fooled by the hostname.
<wolfman8k> well, actually i sort of am
<Submarine> It's just that I know some of the CompSci profs and grad students there.
<wolfman8k> hm... i probably don't know them
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> i'm afraid to quit my app =(
<monotonom> You probably want to get an account on a reliable server such as those in schools, then no matter what you do, you vnc to the server and run everything there.
<monotonom> So if vnc or your own computer dies, the programs still run on the server fine, you just have to restart vnc and resume.
<wolfman8k> what if the server dies?
<monotonom> I did say reliable :)
<wolfman8k> my box is usually reliable though
<wolfman8k> it's just that i'm using this crusty gtkglarea thing that hasn't been updated in 5 years
<monotonom> Alright I admit these days most school servers are *un*reliable due to the love of Windows and the rise of dummies.
<wolfman8k> it would be nice if lablgtk used gtkglext instead of gtkglarea
<wolfman8k> i would try to do it myself but i have no idea how to even start :(
Anvil_Vapre has quit [Read error: 110 (Connection timed out)]
Anvil_Vapre has joined #ocaml
wolfman8k has quit [Remote closed the connection]
wolfman8k has joined #ocaml
<wolfman8k> what would really rock would be FOX for OCaml =]
<monotonom> What is FOX?
<wolfman8k> it's this great GUI library
<wolfman8k> anyone know Lionel Durigneux?
<Submarine> Sounds like a French name.
<yella> why does the (!=) operator exist when there is (<>) ?
<Submarine> They don't have the same semantics.
<yella> ok
<Submarine> != is the negation of ==
<Submarine> <> is the negation of = (well, almost)
<yella> but == does not seem to be used the C-way..
<Submarine> Not at all.
<Submarine> == is pointer equality, when applied to boxed types.
<yella> so e.g. integers?
<Submarine> to integers, it's equivalent to ==
cjohnson has joined #ocaml
GreyLensman has quit ["Leaving"]
shawn has quit [Read error: 104 (Connection reset by peer)]
shawn has joined #ocaml
Smerdyakov has quit ["go"]
<wolfman8k> has anyone used swig with OCaml?
<Submarine> not me
_shawn has joined #ocaml
shawn has quit [Read error: 104 (Connection reset by peer)]
wolfman8k has quit [Remote closed the connection]
bzzbzz has joined #ocaml