<Defcon7>
/usr/lib/ocaml/mysql/mysql.cmi is not a compiled interface
<Defcon7>
why that :?
<Smerdyakov>
It's gremlins.
<Defcon7>
haha probably
<Defcon7>
you have to say something more useful ?
<Defcon7>
:P
<Smerdyakov>
It's Class A gremlins.
<Defcon7>
this is really useful
<Defcon7>
you are useful.
<Smerdyakov>
I am useful.
Kinners has left #ocaml []
<Defcon7>
someone knows why what error ?
<Defcon7>
that.
wax has joined #ocaml
Riastradh has quit [Read error: 110 (Connection timed out)]
<smkl>
Defcon7: your sql library and compiler have incompatible versions
lus|wazze has joined #ocaml
srv has joined #ocaml
mattam_ has joined #ocaml
gim has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
async has joined #ocaml
buggs|afk is now known as buggs
mattam_ is now known as mattam
karryall has joined #ocaml
Herrchen_ is now known as Herrchen
maihem has joined #ocaml
srv has quit ["leaving"]
ddaa has joined #ocaml
mimosa has joined #ocaml
Demitar has quit [Read error: 54 (Connection reset by peer)]
Demitar has joined #ocaml
maihem has quit ["Client exiting"]
srv has joined #ocaml
owll has joined #ocaml
owll has left #ocaml []
Riastradh has joined #ocaml
maihem has joined #ocaml
maihem has quit ["Client exiting"]
__DL__ has joined #ocaml
owll has joined #ocaml
carm has joined #ocaml
owll has left #ocaml []
phubuh has joined #ocaml
<carm>
hello all
noss has joined #ocaml
ddaa has quit ["Client exiting"]
malc has joined #ocaml
<carm>
anyone here?
<Demitar>
carm, apparently 41 people, I suppose that counts as "anyone".
<carm>
good point.
<carm>
I meant "at the keyboard"
<carm>
Can I discuss a topic with you briefly Demitar?
<Demitar>
I can't tell you if you'll get a useful answer unless I know the topic. :) Note that asking to ask is generally useless on irc. ;-)
<carm>
I know this, I just have a general question. How do you like OCAML, have you made any big projects on it yet?
<Maddas_>
carm: While I have never made any big projects in it (or any other language, for that matter), I like it a lot.
<malc>
OCaml is bloody abomination, and anyone who makes any projects with it, leave alone, big is insane
<Maddas_>
:-)
<carm>
I just started using (formerly a big SML fan), and I like it alot too. I've almost finished a network based texas holdem game with it
<Demitar>
carm, I love ocaml, the type system is the best part imo. ;-) 10k loc easily gets unwieldy in python once you start to refactor types.
<carm>
I also interfaced ocaml with the poker evaluator library written in C. I like how you can write "wrappers" into C.
<Maddas_>
malc: I like that rant though, gotta remember that one.
<malc>
Maddas_: glad to be of service
<carm>
I love OCAML thus far, but I have run into 2 problems. 1 (theoretical): Classes or Modules?
<Smerdyakov>
Modules when you can. Classes when you can't.
<mattam>
depends on culture too
<carm>
my code has been teetering between the two of them. Writing a poker server / client is very naturally object orientated.
<Smerdyakov>
carm, how so?
<carm>
Smerdyakov: well the game itself is a really a mutable state.
<Smerdyakov>
Mutable state isn't OO!
<Smerdyakov>
It's just imperativity!
<carm>
Smerdyakov: mutable state and OO are quite compatible however.
<carm>
Think of all the mutable fields a texas holdem game requires
<mattam>
OO in ocaml is both functional and imperative - friendly
<carm>
all those fields are not something I want to always pass along functionally
<Smerdyakov>
Good thing mutable fields of class obejcts aren't the only imperative features OCaml provides!
<carm>
Smerdyakov: collectively, how would one represent a group of mutable related fields, and pass this data easily to other functions?
<Demitar>
carm, type foo = { mutable bar : int; }
<Smerdyakov>
An abstract type.
<mattam>
Smerdyakov: ?
<carm>
Demitar: thats like a glorified struct in C. why not use an object? have some cute methods to change the fields?
<Smerdyakov>
You use whatever implementation you want (probably a record), but you only allow one module to know what it really is.
<Smerdyakov>
That module has the traditional accessor and mutator methods that you think of as being associated with "OO."
<mattam>
oh yeah
<carm>
Smerdyakov: I still dont see how everything would come together as nicely as it would OO.
<noss>
Someone should implement a CLOS like OO for ML. I'm not voluntary.
<karryall>
carm: it's just a matter of writing "operation obj args" instead of "obj#operation args"
<carm>
karryall: well thats merely the syntactical difference.
<karryall>
that's the point : unless you need row polymophism and/or inheritance, the difference is almost only syntaxical
<carm>
karryall: row polymorphism?
<carm>
noss: CLOS?
<noss>
common lisp object system.
<carm>
ahh
<karryall>
when you have several classes that have methods in common, you can write polymorphic methods that use only these methods
<carm>
well anyway, I have some modules, but primarly it is object oriented, for the better or worse. Its not really that I prefer either, but the OO approach jumped on me faster, thats for sure.
<carm>
karryall: thanks
<Maddas_>
Gotta love freedom of choice
<carm>
could someone point me out to an example of a simple class, and its module analog?
<carm>
Maddas_: certainly one of the beauties of ocaml.
<Demitar>
carm, iirc the ocaml book lists some examples.
<karryall>
carm: you change all attributes of the class into a record with fields
<carm>
Demitar: you referring to the ocaml manual?
<karryall>
carm: and then the method to functions taking the record as first argument
<carm>
or the o'reilly book?
<Demitar>
carm, the o'reilly book.
<Smerdyakov>
carm, one thing with using OO is that you use a method dispatch table at runtime, which is nice to avoid if you can.
<Smerdyakov>
carm, if you use no inheritance/subclassing, then this really is superfluous.
<carm>
Smerdyakov: how much overhead are we talking about, really
<Smerdyakov>
Not much. Just not as clean as it could be, conceptually. :D
<Demitar>
Smerdyakov, the only hitch with modules is that typing can become tedious, and with oo they type errors can be hard to read.
<carm>
Demitar: well I know from ML the virtues and vices of the type system.
<Smerdyakov>
Demitar, I've not found typing to be "tedious" with modules.
<carm>
hehe I sense an argument
<Demitar>
Smerdyakov, I often remember I need a parenthesis to evaluate a function correctly too late and need to move back a bit to add the '('. :-)
<Smerdyakov>
OK....
<Demitar>
carm, well, it wouldn't be the first time this specific argument comes up. :) But we're all happy doing things our own way. :
<carm>
Demitar: yeah I recall reading about the overhead with classes, but tihs project of mine regardless has a made a great learning experience with OCAML.
<carm>
karryall: ok I think I see the translation. However, it seems uglier to me
<Demitar>
Also consider (String.sub (Buffer.contents (List.hd foo) ...) vs foo#hd#contents#sub ... you type the way you think in the second case. Now I do usually prefer modules because of other benefits but it can get tedious. :-)
<carm>
karryall: on the other hand, my code contains imperative / functional / OO in a crazy mix
<carm>
Demitar: I'd like to believe that program should sort of lend itself well to a particular approach
<karryall>
carm: sure, you cannot always do this "translation"
<carm>
karryall: particularly with inheritance?
<Demitar>
Well partial function applications get easily get messy with objects on the other hand.
<karryall>
carm: anyway if it works fine the way you wrote it, there's no need to rewrite everything
<carm>
Demitar: this is true, but I have no need for that in this project.
<karryall>
carm: yes, you do some inheritance with modules, up to a point
<noss>
How often do you people use partial evaluation?
<carm>
ok, well I guess we could have philosophical arguments on this all day, but I think I've heard enough.
<karryall>
I'm afraid it will soon get heavy
<Smerdyakov>
noss, can you be more specific? Does any use of a curried function count?
<Demitar>
noss, quite often, especially when iterating lists.
<carm>
Demitar: Its a very powerful technique- to create a new function just by passing an argument to the orginal.
<noss>
Smerdyakov: Well, my background is with langauges that doesnt have currying. I find the examples of its use elegant but I do not see such frequent use of it for my plain code.
<Smerdyakov>
noss, well, for instance (List.map someFunction) can be passed to another function that operates on lists
<Maddas_>
Same here, especially when defining operations on matrices or such
<noss>
I just wonder if ill learn to see where i can use it, or if it is more of a theoretical feature.
<noss>
Well, I could use closures to archive the same thing.
<Smerdyakov>
noss, you could, but it takes more code to get the same effect. (Not that currying isn't creating closures already)
<Maddas_>
noss: It always takes getting used to features you got around without before - same like when you see OO the first time, you might not see them as useful
<Smerdyakov>
noss, imagine a 15 argument function you want to specialize based on a given first argument.
<noss>
smeardyakov: on the other hand i wouldnt have to think about the order of my argument so it would be of maximal use when curried.
<Smerdyakov>
noss, you'll have to pattern match every one of the remaining 14 arguments without currying. :D
<carm>
one thing I have realized through experience is that records get real ugly when they are too big. Can't remember order of parameters
<Smerdyakov>
carm, order and records? How do you mean?
<malc>
Smerdyakov: do you realize that function of 15 args tells us a lot about your quality as a programmer, or lack thereof
<malc>
sigh
<Smerdyakov>
malc, sure, but 3 args is reasonable.
<carm>
Smerdyakov: well I mean record in the ML sense, ie. (int * bool * char) is a record of size 3
<Maddas_>
let sum = List.fold_right (+) 0
<Smerdyakov>
malc, the point is that the amount of finger-typing work grows proportionately to the number of arguments.
<Smerdyakov>
malc, whereas currying allows you to specialize one argument with constant finger-typing.
<malc>
Smerdyakov: heresy
<malc>
go tell that to SML crowd
<Demitar>
malc, laziness is probably closer to the truth than quality. :-)
<malc>
they will laugh at you, and probably spank a bit
<Smerdyakov>
Is malc usually here?
<carm>
malc: haha this is great.
<Maddas_>
Oh, so currying is O(1) :-)
<malc>
Demitar: laz_y_ness is an invention of evil peyton johnes and kun
<malc>
and maybe the guys who did miranda
<malc>
should be outlawed
<carm>
malc: if you didn't believe in laziness, you would only use assembly.
<carm>
malc: or possibly a turing machine implementation like brainfuck
<malc>
carm: come to think of it, i do only use assembly
<malc>
i much prefer intercal thank you very much
<Herrchen>
intercal has this comefrom statement, doesn't it?
<Defcon7>
yup but dont know if its used in the mldonkey client or in a tool distribuited with it
<Defcon7>
i have to verify
maihem has joined #ocaml
noss has quit ["Client exiting"]
srv has quit ["leaving"]
karryall has quit ["home"]
<Defcon7>
im installing cdk2 from ocaml.org
<Defcon7>
how i can enable lablgl ?
<Defcon7>
(when doing ./configure)
__DL__ has quit [Remote closed the connection]
lus|wazze has quit ["If we don't believe in freedom of expression for people we despise, we don't believe in it at all -- Noam Chomsky"]
buggs|afk has quit [Read error: 110 (Connection timed out)]
Vincenz has joined #ocaml
buggs has joined #ocaml
eternite has joined #ocaml
<eternite>
Hello evrybody!
<Riastradh>
HI!
<Demitar>
Greetings eternite.
Hipo has quit ["Kiki. :-)"]
<mellum>
Okay, maybe this time... Does anybody know why Ocaml has no call/cc? Implementation too difficult? Lack of percieved usefulness?
<mimosa>
I think that you have a very similar mechanism with exceptions no ?
<mellum>
Well, continuations seem more flexible... and SML/NJ has them
maihem has quit [Read error: 104 (Connection reset by peer)]
<mattam>
would be nice to have them i think
<mattam>
so maybe it's just a matter of dev. choice
<mimosa>
mellum: what can you do whith callcc that you cannot do with exceptions ?
<Riastradh>
mimosa, re-enter.
systems has joined #ocaml
<mimosa>
mmm yes
<mimosa>
thanks
<Riastradh>
Exceptions are a subset of continuations.
<mellum>
Riastradh: well, not really
<mellum>
Riastradh: in fact, in a pure, typed language, exceptions are strictly more powerful :)
<Riastradh>
??
<mellum>
If you add exceptions to a typed lambda calculus, you get a turing-complete language, but not if you add continuations
<mellum>
however, real languages have explicit recursion, so that doesn'r really apply
<Riastradh>
The Lambda-Calculus is _already_ Turing-complete.
<mellum>
Riastradh: not the typed onw
<Riastradh>
Oh.
<mellum>
So comparing the "power" of exceptions and continuations os somewhat difficult
* Riastradh
isn't quite sure what he meant when he said 'subset.'
<mellum>
Well, you can usually replace use of exceptions in real languages with use of contionations, without changing a lot of code, maybe even using macros. But formalizing that statement doesn't seem possible.
* Riastradh
thinks someone must have been using nitrous nearby for a few moments when he said that.
<phubuh>
hey, this channel is active!
<mellum>
Sorry, did I break some vow of silence?
<phubuh>
unfortunately.
<Riastradh>
Now we'll have to kill you.
<mellum>
You'll never get me! Bwahahahaha!!
<Riastradh>
Would you prefer death by being beaten over the kneecaps with Zippy dolls, or being killed with the...Comfy Chair?!!?
systems has quit ["Client Exiting"]
<mellum>
What is this, some kind of Spanish Inquisition?
<Riastradh>
NOOOOOOBODY EXPECTS THE SPANISH INQUISITION! Our chief weapon is surprise.
<Riastradh>
...er, and fear.
Xolution has joined #ocaml
<Xolution>
Hey, how can I do something like this:
<Xolution>
let foo () =
<Xolution>
bar ()
<Xolution>
and bar () =
<Xolution>
"blah";;
<Xolution>
?
<Xolution>
nm
<Xolution>
let rec ...
<Xolution>
fixes it
<Defcon7>
let rec foo () = let bar = blah in foo ();;
<Defcon7>
i think
<Defcon7>
this is a loop
<Defcon7>
if whats u mean
<Defcon7>
if it is what you wanted.
Demitar has quit [Read error: 104 (Connection reset by peer)]
<eternite>
by
eternite has quit ["Arlg connection crash!"]
malc has joined #ocaml
Xolution has quit [Read error: 110 (Connection timed out)]