mfurr changed the topic of #ocaml to: OCaml 3.08.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/
palomer has quit [Remote closed the connection]
goomba has quit [Read error: 104 (Connection reset by peer)]
Nutssh has joined #ocaml
Walnutssh has joined #ocaml
Nutssh has quit [Read error: 104 (Connection reset by peer)]
Walnutssh is now known as Nutssh
smkl_ has joined #ocaml
<vincenz> GI
<vincenz> HI
jeff2 has quit [Read error: 60 (Operation timed out)]
cognominal has quit [Read error: 60 (Operation timed out)]
__DL__ has quit ["Bye Bye"]
swaplinker has quit [Read error: 54 (Connection reset by peer)]
goomba has joined #ocaml
smkl_ has quit [Read error: 60 (Operation timed out)]
fab_ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
smkl_ has joined #ocaml
Skal has quit ["Client exiting"]
cjohnson has quit [Read error: 54 (Connection reset by peer)]
grirgz has quit [Read error: 110 (Connection timed out)]
mattam has quit [Read error: 110 (Connection timed out)]
smkl_ has quit [Read error: 110 (Connection timed out)]
monochrom has quit ["Few people understand understanding."]
Herrchen has joined #ocaml
smkl_ has joined #ocaml
juhammed has quit [Read error: 110 (Connection timed out)]
Herrchen_ has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
vezenchio has joined #ocaml
smkl_ has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
smkl_ has joined #ocaml
<Snark> slt
<Snark> why does ocamlmklib name the lib dllname.so !?
<Snark> I mean, I was having linking problems... did a ln -s dllname.so libname.so, and voila!
skylan has joined #ocaml
<Snark> oohhh... there's a libname.a that helps...
<Snark> and it avoids to have a dependancy on the stub code...
<Snark> wonderful!
smkl_ has quit [Read error: 110 (Connection timed out)]
<vincenz> I wish ocaml had typeclasses
<mrvn_> what do you mean?
<vincenz> typeclasses
<vincenz> ala haskell
<mrvn_> what do you mean?
<vincenz> ...
<vincenz> your record is broken
<mrvn_> I don't know haskel past hello world so that doesn't help.
<vincenz> type classes means you have classes of types
<vincenz> and you can define operations on them
<vincenz> like +
<vincenz> it could be defined for floats and ints
<mrvn_> polymorphism basically
<vincenz> not quite
<vincenz> restrained polymorphism
<mrvn_> The problem is that you need either code duplication or runtime type information for that.
<pango> what gcaml does, from what I understand
<mrvn_> It would be slower and use more ram
<vincenz> oh
<vincenz> well basically the = operator does it
<vincenz> albeit it in a non orthogonal fashion
<mrvn_> = compares the bit patterns so no type handling required there.
<mrvn_> It's probably inlined too.
<vincenz> another nice thing are their functors
<mrvn_> at least only GC infos, not full types
<mrvn_> You can use `Int in ocaml for polymorphism.
Herrchen has quit ["bye"]
tintin has joined #ocaml
tintin has left #ocaml []
Snark has quit [Read error: 60 (Operation timed out)]
Snark has joined #ocaml
Hadaka has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
__DL__ has joined #ocaml
_JusSx_ has joined #ocaml
<mflux> mrvn_, how would it do any of that, except in the cases when the polymorphism actually gets you something 'new'?
<mflux> that is, how does it matter if the operation of adding two floats is called +. or +
<mflux> of course, you could write more generic functions, which would be slower or bloater than their counterparts
<mflux> but code such as let sum (a : float list) = List.fold_left ( fun a b -> a + b ) 0.0 a should not have any impact on size of performance
<vincenz> aawoo
<Snark> notice that eiffel does polymorphism and strong compile-time checking... but with still a little run-time overhead
<mrvn_> mflux: let foo a b = a + b
<mrvn_> What type does this have?
<mflux> mrvn_, obviously it depends on the input arguments
<mflux> mrvn_, but earlier you needed to do foo_int and foo_double manually
<mflux> is that betteter?
<mflux> ..or 'better'
<mrvn_> fun 'a of (int|float) -> 'a of (int|float) -> 'a of (int|float)
<mrvn_> Something like that.
<mflux> well that isn't quite exactly it I would say
<mflux> I wonder how gocaml displays those
<mflux> oh wait, you used 'a, never mind ;)
<vincenz> haskell uses restrictions
<mrvn_> a, b and the result are codependent. If one has a fixed type they all do.
<vincenz> fun : (TypeClassHAvingPlus a) => a -> a -> a
<vincenz> what mrvn_ said
<vincenz> anyways: mrvn_ you don't need to know the type of foo until it's used
<mflux> at compile time, when it would be called, the proper function could be generated or the generic one used
* vincenz nods
<mrvn_> TypeClassHAvingPlus would be a module or object in ocaml.
<vincenz> I know there are a few limitations to what mflux said
<mflux> if the code is generated, it's still just as much code let foo a b = a + b would be
<mflux> if you use the float version too, then it's more, but you didn't have that version before either
<vincenz> yip
<mflux> something to tell the compiler what you want could be nice, at the moment you can tell about stuff on command line
<mrvn_> The code has to be in the *.ml file. Say you export that function from a module.
<mflux> that just means the compiler mechanism needs to be changed
<mrvn_> *.mlx file
<mrvn_> The problem is that the dependency of the types gets carried into the calling function.
<mrvn_> From there on upwards through the calling structure.
<mrvn_> You can probably easily find a case where that gets more complex exponentially with code size.
<vincenz> mrvn_: either way right now the compiler isn't that grand... for instance it does no cross-module optimizations
<vincenz> mrvn_: you can find cases where compiler gets exponential with code size for more htings, but usually they are atypical
<mrvn_> vincenz: No compiler realy does. Thats what compilation units are for.
<vincenz> mrvn_: there you are wrong
<vincenz> anywho
<vincenz> lablgtk or lablgtk2 or wxocaml?
<mrvn_> vincenz: by the way, ocaml has the option to inline across modules somewhat.
<shrimpx> the way typeclasses work is every function calling say, +, is turned from f x = ... + ... into f d x = ... (d +) ... where the right dictionary d containing the right implementation of + is passed at every call site
<shrimpx> so changing ocaml to do that is quite involved i think =)
<mrvn_> that would also be slow.
<shrimpx> yea it's decent overhead... there are several optimizations that can be applied but still
<mrvn_> You can do interfaces for this easily in ocaml. Just not with + - * /
<shrimpx> but i duno i don't think the fact that + and +. are disparate is a big deal
<mrvn_> I prefer it and I always forget.
<mflux> I think it takes part of the advantages of type inference away
<shrimpx> in haskell, for example, combining floating point and integer arithmetic in one expression can get ultra hairy
<mrvn_> Can you wite int + float?
<shrimpx> but i agree that having print_int, print_string, etc, is unfortunate
<mrvn_> +r
<mflux> great, so you don't need to tell the types of the variables you're adding, but still you need to use a certain operator telling just that
<shrimpx> mrvn_: no
<mrvn_> shrimpx: Printf.printf
<mflux> well, I too think +. in particular isn't that bat, but others are
<shrimpx> mrvn_: oh actually you can
<mflux> but Printf.printf is implemented with some language built-in dark magic?
<mflux> so, it's a kludge ;)
<shrimpx> the whole print_string thing is silly because ML is supposed to do away with type annotations but those are the worst kind of type annotation
<mrvn_> mflux: is does compile time string parsing.
<vincenz> wow
<mrvn_> mflux: You can do the same with CPS annotations and symbols.
<vincenz> this lablgtk2 is cleaner than I thought
<mflux> mrvn_, yes, and what if you wanted to extend that or make another kind of syntax
<vincenz> I had experiences with tk before and it was UGLY
<mflux> mrvn_, hm?
<mrvn_> mflux: then you cp printf.ml and edit.
<mrvn_> mflux: I have a a I/O module that does non-blocking I/O on unix FDs with CPS annotation. Same for input and output.
<mflux> and CPS annotation is.. ?
<mflux> ;)
<mrvn_> write (Int8 $ Int8 $ UInt16 $ String 16)
<mrvn_> fun int -> int -> int -> string -> unit
<mrvn_> CPS == continuation apssing style.
<mrvn_> s/ap/pa/
* shrimpx doesn't get it
<mflux> I infact asked a related question some time ago here, nobody reacted to it though
<mrvn_> The $, Int8, UInt8, ... are CPS style so you can mangle them together.
<mflux> I was trying to something like (foo "?0, ?2, ?1" +% (0, Int) +% (1, Str) +% (2, Float)) 42 "foo" 4.2 to work
<mrvn_> printf with positional arguments?
<mflux> yes
<mrvn_> doesn't printf have that already?
<mflux> hm, no?
<mrvn_> read stdlib/printf.ml
<mflux> anyway the application would be generating sql statements
<mflux> so strings would need to be quoted in database-style automatically
<mflux> I'll take a look at it, it isn't that long though
<mrvn_> I never tried but it shouldn't be to hard to copy printf and modify it to do the quoting.
Naked has joined #ocaml
Naked is now known as Hadaka
pango has joined #ocaml
smimou has joined #ocaml
<vincenz> Anyone work with lablgtk2?
<Snark> vincenz: I'm using it
<vincenz> well I have a small issue with it
<vincenz> my pointer always looks like a clock
<Snark> uh?
<vincenz> my cursor
<vincenz> it always look like a clock
<Snark> you mean your mouse cursor
<vincenz> yes
<Snark> you must have done something to it, because I never saw it change by itself
<vincenz> nope
<vincenz> also...I'm getting type errors on the gtree example
<Snark> which one?
<vincenz> the second one
<Snark> lol
<vincenz> let year_of_birth = model#get iter col_year_born in
<vincenz> This expression has type int GTree.column but is here used with type
<vincenz> string GTree.column
<vincenz> it doesn't understand get is polymorphic
<Snark> in which file shoul I find it?
* vincenz points at the link
* Snark searches on his disk
<Snark> pwd -> /usr/share/doc/liblablgtk2-ocaml-doc/treeview-tutorial_examples
<vincenz> it has no name
pango is now known as pangoafk
<Snark> vincenz: I pasted the source in a file
<Snark> and I have the same error message
<vincenz> yah :/
<Snark> hmmm... it is quite logical
<vincenz> how so?
<Snark> the code calls the get method two times with a "string GTree.column" as last arg
<Snark> so when the third call uses an "int GTree.column", it rightfully complains
<vincenz> so?
<vincenz> it's a polymorphic method
<Snark> at the beginning yes
<Snark> but when ocaml gets a more precise information, it eagerly precises the type
<Snark> I must admit that this is annoying
<Snark> I didn't run into this because I only use strings for now
<Snark> but at some point I'll want pixmaps
<Snark> and that will bite me too!
Skal has joined #ocaml
<vincenz> hmm
<vincenz> popup uses gdkEvent
<vincenz> when I try to compile it it tries to compile the original gdkEvent.ml
<vincenz> any solutions?
<Snark> popup.ml runs fine here
<vincenz> you compile natively?
<Snark> I build popup menus in my pet project, which compiles well both natively and object-code-ly
<vincenz> where do you get gdkEvent from?
<vincenz> what do you need to link in for native compile?
<vincenz> I tried replacing by by cmxa and cmx for lablgtk and gtkInit and I get a bunch of link errors
<vincenz> nm
<Snark> LABLGTK_LIB = -I +lablgtk2 lablgtk.cma
<Snark> $(LIBS:.cma=.cmxa)
<vincenz> for native
<vincenz> that's it?
<Snark> for native I .cma -> .cmxa
<Snark> that and gtkInit.cmx
<Snark> I fighted to get it right this morning
<Snark> and I can now say I'm victorious
<Snark> here is my Makefile.base
<vincenz> got it
<vincenz> I had ocamlopt -thread
<vincenz> nope
<vincenz> still an issue
<vincenz> strangely related to born
<vincenz> not anymore
<vincenz> ok, thnx!
<Snark> perfect :-)
<vincenz> got any examples on how to use lablgtk2 with lablGL?
<Snark> no, sorry
<Snark> but it should work likewise: find the "-I +whatever foo.cma", put it in LIBS_LABLGL, and put it in LIBS, in the right position
madroach has joined #ocaml
<vincenz> yeah
<vincenz> just hoping for a simple example to see how to get started
<vincenz> there should be more ocaml apps
<vincenz> :/
<Snark> there will be, hopefully
<vincenz> cause if you look at haskell, they're really out there trying to get a lot of stuff
<madroach> Hi, I already asked about cross-compiling yesterday. Now I got mingw and the mingw distribution of ocaml. My commandline to compile is:
<vincenz> ocaml is just a bunch of people that use ocaml..no group feeling
<madroach> ocamlopt -verbose -cc i586-mingw32msvc-gcc -o traveller graphics.cmxa traveller.ml
zzorn has joined #ocaml
<madroach> But ld says: Could not find -ldl What's wrong??
<Snark> vincenz: you know, I began using ocaml for that pet project last week
<vincenz> oh
<Snark> madroach: no libdl anywhere?
Herrchen has joined #ocaml
<madroach> I also tried passing -ccopt -L\ /usr/lib. That gave me hundreds of "undefined references".
<madroach> Snark: But shouldn't I use only windows libs?
<Snark> madroach: I don't know
<Snark> libdl is a libc things
madroach has quit ["leaving"]
<vincenz> Uncaught exception: Protocol.TkError("window name starts with an upper-case letter: \"Controls\"")
<vincenz> woah cool
<vincenz> spaceman spiff game in 3D made in ocaml :)
<vincenz> ocaml ROCKS
<vincenz> :D
* vincenz is ready for ICFP :D
mattam has joined #ocaml
grirgz has joined #ocaml
cognominal has joined #ocaml
pangoafk is now known as pango
fab_ has quit [Remote closed the connection]
juhammed has joined #ocaml
cjohnson has joined #ocaml
CosmicRay has joined #ocaml
CosmicRay has quit ["Leaving"]
zzorn is now known as zzorn_food
Submarine has quit ["Leaving"]
Msandin has joined #ocaml
cjohnson has quit ["banana"]
zzorn_food is now known as zzorn
<vincenz> hmm
<vincenz> food
vezenchio has quit ["We learn from history that we learn nothing from history"]
bzzbzz has joined #ocaml
pango has quit ["bbl"]
Herrchen has quit ["bye"]
Herrchen has joined #ocaml
Herrchen has quit [Client Quit]
pango has joined #ocaml
cognominal has quit [Read error: 60 (Operation timed out)]
cognominal has joined #ocaml
CosmicRay has joined #ocaml
cognominal has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
Submarine has joined #ocaml
pango_ has joined #ocaml
pango_ has quit [Read error: 104 (Connection reset by peer)]
pango_ has joined #ocaml
mrvn has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
mrvn_ has quit [Read error: 60 (Operation timed out)]
Msandin has quit [Read error: 60 (Operation timed out)]
zzorn is now known as zzorn_afk
ipr has joined #ocaml
Sonarman has joined #ocaml
Sonarman has quit ["leaving"]
Sonarman has joined #ocaml
Sonarman has quit [Client Quit]
vincenz has quit [Read error: 104 (Connection reset by peer)]
__DL__ has quit [Read error: 104 (Connection reset by peer)]
vincenz has joined #ocaml
Snark has quit ["Leaving"]
Msandin has joined #ocaml
Submarine has quit ["Leaving"]
Snark has joined #ocaml
cognominal has quit [Read error: 60 (Operation timed out)]
Banana has quit [Read error: 110 (Connection timed out)]
Msandin has quit [Read error: 54 (Connection reset by peer)]
monochrom has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
palomer has joined #ocaml
<palomer> is there syntax for producing a record r from r' which only differs in one label?
<mrvn> content?
<mrvn> # type foo = { a:int; b:int; };;
<mrvn> # let foo1 = { a=1; b=1;};;
<mrvn> # let foo2 = { foo1 with b=2; };;
<mrvn> val foo2 : foo = {a = 1; b = 2}
<mrvn> like that?
<palomer> oh my
<palomer> that's very cool
<mrvn> Very if you have large records
<palomer> too bad sml doesn't have it:(
<mellum> can't you make a macro for that?
<palomer> sml has macros?
<mellum> I don't know/
<palomer> nope
* palomer pulls the hair out of sml/nj
dan2 is now known as beta3
beta3 is now known as dan2
Banana has joined #ocaml
vodka-goo has quit ["zZz"]
<_JusSx_> exit
_JusSx_ has quit ["leaving"]