cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
pants1 has joined #ocaml
<postalchris> twobitsprite: camlp4o outputs a binary IR by default use camlp4o pr_o.cmo
<postalchris> (that is assuming ocaml < 3.10)
gim__ has quit []
malune__ has quit [Read error: 110 (Connection timed out)]
<twobitsprite> ahh
<twobitsprite> what about >= 3.10?
<twobitsprite> (I am playing around with the CVS version)
screwt8 has quit [Read error: 104 (Connection reset by peer)]
pants1 has quit ["Leaving."]
<postalchris> twobitsprite: can't tell you. try here: http://pauillac.inria.fr/~pouillar/camlp4-changes.html
_blackdog has quit [Remote closed the connection]
_blackdog has joined #ocaml
_blackdog has quit [Remote closed the connection]
_blackdog has joined #ocaml
_blackdog has quit [Remote closed the connection]
_blackdog has joined #ocaml
kolmodin has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
kolmodin has joined #ocaml
dan2 has joined #ocaml
dark_light has joined #ocaml
kolmodin has quit [Remote closed the connection]
kolmodin has joined #ocaml
kolmodin has quit [Read error: 104 (Connection reset by peer)]
kolmodin has joined #ocaml
benny has joined #ocaml
kolmodin has quit [Read error: 104 (Connection reset by peer)]
benny_ has quit [Read error: 113 (No route to host)]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
kolmodin has joined #ocaml
screwt8 has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
_blackdog has quit [Remote closed the connection]
pants1 has joined #ocaml
kolmodin_ has joined #ocaml
kolmodin has quit [Connection reset by peer]
kolmodin_ has quit [Read error: 104 (Connection reset by peer)]
sourcerror has quit [Read error: 104 (Connection reset by peer)]
sourcerror has joined #ocaml
Smerdyakov has quit ["Leaving"]
Demitar__ has quit [Read error: 110 (Connection timed out)]
Demitar_ has quit [Read error: 110 (Connection timed out)]
bluestorm_ has joined #ocaml
Demitar has joined #ocaml
Demitar_ has joined #ocaml
love-pingoo has joined #ocaml
Demitar_ has quit [Read error: 110 (Connection timed out)]
Demitar has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [Read error: 104 (Connection reset by peer)]
vorago has quit [Read error: 113 (No route to host)]
ed-t8 has joined #ocaml
joshcryer has joined #ocaml
smimou has joined #ocaml
love-pingoo has quit ["labo"]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
vital303 has quit ["Leaving."]
jlouis has quit [Remote closed the connection]
kelaouchi has quit ["leaving"]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
kelaouchi has joined #ocaml
screwt8 has joined #ocaml
love-pingoo has joined #ocaml
smimou has quit ["bli"]
ita|zzz is now known as ita
ayrnieu has joined #ocaml
Demitar has joined #ocaml
pants1 has quit ["Leaving."]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
pabs3 has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
<pabs3> what stupidity am I committing here? http://www.pastebin.ca/490951
<mrvn> too many arguments to a function
<mrvn> "-package extlib" is not a function so you can't apply the argument oc_find.
<ita> sometimes itd be better if compiler errors were output in french
<mrvn> You are missing a begin/end or () and a ;
<mrvn> And your indentation is wrong.
<pabs3> spot the ocaml n00b
<mrvn> I often paste code into the toplevel and check where it underlines the error.
<mrvn> That is if the indentation doesn't already show it.
<pabs3> indentation is just cause I copied from a terminal
<mrvn> Then you should have noticed that oc_find is indented more than you wanted
moglum has joined #ocaml
<ita> (ocaml+twt wouldve made this error pretty obvious :-))
<mrvn> not at all
<mrvn> ita: from what you said twt replaces the begin/end and ; with indentation and linebreaks. So there would have been no error.
<flux> does someone remember the name of that plotting library/tool written for/in ocaml?
<flux> ah, it was oplot, even though my first google for it didn't look promising
<flux> hm, or maybe not..
<ita> flux: ocamlgraph maybe ?
<flux> it wasn't it, but it'll do
<flux> infact it might do better then the tool I was looking for
<flux> oh, actually I didn't find that, I'm using ocamlplot
* pabs3 postpones this until he has time to learn ocaml
pabs3 has left #ocaml []
<flux> sometimes I wish ocaml had 'pi' defined in Pervasives :), apprently that library (also) defines pi..
moglum has quit []
<flux> must be one of the most-common defined symbol in ocaml programs (not that often, but which symbol is used for the same purpose more often?)
<flux> hmph, what's wrong with defining type point = (float, float) instead of { x : float; y: float }..
<mrvn> nothing
<flux> infact I'd say there's something wrong in picking the latter, which that library does :)
<mrvn> The later allows easier access to the members
<mrvn> no matching required
<flux> fst, snd?
<flux> also not really, unless you also open the module where the record is defined
<mrvn> do fst and snd get inlined by the compiler?
<flux> (I most of the time avoid it, perhaps use module aliases)
<flux> I don't know
<flux> I think they might be
<mrvn> if you open the module or in the module p.x is shorter than (fst p)
<flux> gotta go for a while
moglum has joined #ocaml
<flux> back!
<flux> ocamlopt inlines fst
<flux> in my code I rarely need to get fields from points, they are passed through the code when finally a few functions extract the fields
<flux> much larger portion of the code involves creating such values
<flux> which is where the syntactic overhead matters..
gim_ has joined #ocaml
screwt8 has joined #ocaml
moglum has quit []
moglum has joined #ocaml
_blackdog has joined #ocaml
vorago has joined #ocaml
moglum has quit [Read error: 110 (Connection timed out)]
<mrvn> flux: A drawback of int*int is that it doesn't get recognised as type point easily. With records you always have the exact type.
<flux> true, but I don't think it's a big drawback
<flux> if you're doing graphs, chances are you've got lots of code involved manipulating such values
<flux> of course, if you have, say, coordinates from two different coordinate systems, you could perhaps want to differentiate them
<mrvn> Memory wise they should be identical, right? Block with 2 values?
<flux> I believe so, yes
<ita> bah, what about using ocamgraph for the stuff ?
<mrvn> Wouldn't it be need if one could say 'type point = { x:int; y:int } | int * int'?
<flux> I mean bar graphs, not directed graphs etc what ocamlgraph provides
<flux> (I'm using ocamlplot)
<ita> flux: who uses bar graphs nowadays ?
<flux> mrvn, that would indeed be nice. I suppose it wouldn't hurt much.
<ita> (worst kind of visualization ever)
<flux> ita, well not bar graphs per se, but I'm drawing weather graphs
<flux> anyway, ocamlgraph deals with completely different issues
<mrvn> flux: if you have type Point1.t = { x:int; y:int } and type Point2.t = { u:int; v:int } can you pass a Point2.t to a function expecting a Point1.t?
<flux> what's the correct terminology here?
<flux> mrvn, no
<flux> without using obj.magic atleast :)
<flux> perhaps there should be a compiler-provided safe obj.magic, which would allow structural equivalence
<flux> I'm not sure if that'd be difficult to implement, though
<mrvn> Shouldn't be. The compiler knows the signature
<flux> I'm thinking the type inference stage.. the type of that function isn't something that can be expressed with the current type system.
<mrvn> right. That needs magic.
<ita> and light
<ita> lots of matches
<mrvn> Sometimes I wish the compiler had some Obj.... function to give the type of a variable.
<mrvn> like typeof(x) in C
<ita> mrvn: something like inspect ?
<mrvn> Unbound value inspect
<ita> i think i have seen it in the ocaml book
<mrvn> The manual has it neither as keyword nor as value.
<ita> in any case you can use the interactive shell, or "ocamlc -i"
<ita> the manual does not have it, but the book does
<flux> mrvn, what would you use it for?
<mrvn> flux: marshaling or debuging
<mrvn> At runtime all you can get is the structure of a type but not the signature. So marshaling Point1.t and Point2.t from above gives the same data.
<flux> there was a project that had extended the ocaml toplevel
<flux> with type information queries
<flux> and other things
<mrvn> So for a network protocol you have to add type kind = POINT1 | POINT2 and add that before the data.
<flux> I think I found it from caml weekly archives
<mrvn> uhoh, french
<flux> I like to put my network messages in a record
<flux> make that: sum type
<flux> or two sum types; one for requests, other for replies, in case of an asymmetric protocol
<ita> mrvn: google translate
<mrvn> ita: That seems to be just a description of the memory structure of types.
<ita> mrvn: well, i mixed up with c programming as you do :-)
<mrvn> ita: Same as the "Interfacing C with Objective Caml" in the manual.
<mrvn> flux: You can use 'let convert_points p = Marshal.from_string (Marshal.to_string p []) 0;;
<mrvn> ' but you only get runtime check on the structure.
<flux> hm, what's the point compared to Obj.magic?
<flux> structural check?
<mrvn> I hope so.
<flux> but the compiler still handles those as string -> 'a and 'a -> string -functions
<flux> so you could just as well type let (a:list) = Marshal.from_string (Marshal.to_String p 42.0)
<mrvn> hmm, ot not.
<mrvn> The Marshal module doesn't seem to even check the type.
<flux> I don't think it can; type information is mostly removed during compilation
<flux> gcaml did support type-safe marshalling
<flux> but I guess that project is dead
<mrvn> You can get the structure when you to to_string. But how do you get access to the structure you are supposed to create in from_string?
<mrvn> About a year ago I wrote some marshaling code where you would pass along a representation of the argument. You could still screw up and give it the wrong representation but aside from that it was type safe.
descender has joined #ocaml
<mrvn> Would be nice if one could write 'type var = Int of int | Float of float;; typeof(var);; --> VARIANT [ (0, [INTEGER]); (1, [FLOAT])]' or similar.
<flux> well, that's basically what for example sexplib does
<flux> but it needs you to add 'with sexp' after each involved type definition
<flux> it declares sexp_of_var and var_of_sexp for you
<flux> sexplib is great!
<mrvn> The homepage http://www.janestcapital.com/ocaml/ is dead
<flux> the latter has a more recent version, and isn't dead :)
<mrvn> It should default to index.html instead of giving an error.
screwt8 has quit [Remote closed the connection]
<flux> perhaps it's a misconfiguration, perhaps they want to have it that way :)
<flux> have a look at the README, it has nice examples
<mrvn> Then they should fix the url at the hump
<flux> (well, actually, perhaps not, but something atleast)
<flux> atleast it explains what is converts
<flux> it even supports types like type 'a var = Int of 'a | Foo of (float * 'a var)
<flux> (hm, why did I pick Int?-))
<mrvn> it better be
screwt8 has joined #ocaml
<mrvn> Looking at sexplib I have to remind myself again to learn ocamlp4.
malune_ has joined #ocaml
ed-t8 has quit [Read error: 104 (Connection reset by peer)]
postalchris has joined #ocaml
ygrek has joined #ocaml
moglum has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
malune_ has quit [Read error: 104 (Connection reset by peer)]
malune_ has joined #ocaml
screwt8 has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
love-pingoo has quit ["Leaving"]
pango_ has quit [Remote closed the connection]
slipstream-- has joined #ocaml
pango_ has joined #ocaml
mnemonic has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
<mnemonic> hi
bluestorm_ has joined #ocaml
Demitar has quit [Read error: 104 (Connection reset by peer)]
Demitar has joined #ocaml
benny_ has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
jlouis has joined #ocaml
rickardg has joined #ocaml
slipstream has joined #ocaml
mikeX has joined #ocaml
cjeris has joined #ocaml
slipstream-- has quit [Read error: 110 (Connection timed out)]
<tree_> i am searching for some application that i could use to create diagram of my ocaml project, i want it to show the dependencies and associations between modules
<tree_> it doesnt have to be automaticaly generated :)
<pango_> graphviz's dot
<ita> tree_: ocamlgraph
<ita> tree_: (so you do not have to use the dot by hand)
<ita> pango_: are you part of the gnome clique ?
<pango_> nope
<tree_> ita, pango_ thx a lot ;)
<pango_> np
<bluestorm_> tree_:
<bluestorm_> ocamldoc does that
<bluestorm_> if i rember correctly
<bluestorm_> ocamldoc -dot *.ml -o modules.dot
<bluestorm_> dot -Tpng modules.dot -o graph.png
<tree_> bluestorm_: that is kewl, thx
<bluestorm_> wow
<flux> it's a module dependency graph only, right?
<flux> I'd like to see a static function-dependency graph..
<bluestorm_> hm
<bluestorm_> ocamldoc support type-dependencies too
<bluestorm_> but function-dependecy seems to much
<bluestorm_> i'm afraid you'd have to hack a bit
<flux> there was some discussion that because of higher order functions, generating such graph would be very dificult, but I would be satisfied with one that didn't take those into consideration..
<mrvn> They would appear in the function passing the function argument to the higher order function.
<mrvn> Which is where the actual dependency occurs so that is ok.
<mrvn> It just wouldn't match a call graph.
<bluestorm_> hm
<bluestorm_> otherwise it could be possible to generate a runtime call graph
<bluestorm_> using some of the profiler internals
<flux> you could simply use gprof
<flux> but really, a static dependency graph would work for me :)
<flux> (specifically, you could use tools that create pretty pictures out of gprof output; just recently one was on the freshmeat frontpage)
the_dormant has joined #ocaml
<mbishop> ayrnieu: Have you used efuns?
Demitar has quit [Read error: 104 (Connection reset by peer)]
Demitar has joined #ocaml
gene9 has joined #ocaml
malune__ has joined #ocaml
the_dormant has quit ["Au revoir"]
the_dormant has joined #ocaml
Ai_Itai has joined #ocaml
gene9 has quit ["Leaving"]
malune_ has quit [Read error: 110 (Connection timed out)]
mnemonic has quit ["leaving"]
mnemonic has joined #ocaml
ygrek has quit []
Demitar has quit [Read error: 110 (Connection timed out)]
dark_light is now known as EliasAmaral
vital303 has joined #ocaml
ayrnieu has quit [Remote closed the connection]
skal has joined #ocaml
moglum has quit []
the_dormant has quit ["Au revoir"]
rickardg` has joined #ocaml
rickardg` has left #ocaml []
Submarine has joined #ocaml
rickardg has quit [Connection timed out]
rickardg has joined #ocaml
rickardg has quit [Client Quit]
<twobitsprite> how do I find out what levels are defined in camlp4 for expr?
skal has quit [Remote closed the connection]
<postalchris> twobitsprite: what do you mean by levels?
<twobitsprite> like EXTEND expr: LEVEL "expr1" ....
<twobitsprite> or [[ e1 = expr LEVEL "simple" ...
<twobitsprite> I see these in the examples, and they're talked about in the docs, but I'm not sure what all the levels are and what they mean
<twobitsprite> n/m
<twobitsprite> I think I found it
bluestorm_ has quit ["Konversation terminated!"]
mnemonic has quit ["leaving"]
esdee has joined #ocaml
Mr_Awesome has joined #ocaml
cjeris has quit [Read error: 104 (Connection reset by peer)]
<esdee> Any idea why this works fine, but fails with "Bad file descriptor" if I uncomment the call to daemon? http://pastebin.ca/492021
m3ga has joined #ocaml