ChanServ changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml
malc has joined #ocaml
malc has quit ["no reason"]
Yurik has joined #ocaml
<Yurik> re
<Yurik> anybody here?
Begbie has joined #ocaml
<Yurik> Begbie: hi
<Begbie> Yurik: hello
<Yurik> Begbie: have you any experience with Caml<->C coding? I've faced w/ problem
<Begbie> Yurik: sorry, but I haven't ...
Yurik has quit ["÷ÙÛÅÌ ÉÚ XChat"]
Yurik has joined #ocaml
<Yurik> re
Yurik has quit [Read error: 110 (Connection timed out)]
Yurik has joined #ocaml
<Yurik> re
skylan has quit ["Reconnecting"]
skylan has joined #ocaml
<Yurik> skylan: hi
<skylan> Hello Yurik.
gl has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
zack has joined #ocaml
xtrm has joined #ocaml
<xtrm> "Hello world\n
<mr_bubbs> :>
engstad has joined #ocaml
skylan has quit [Read error: 110 (Connection timed out)]
mrvn_ has joined #ocaml
lam has quit ["Lost terminal"]
mrvn has quit [Read error: 110 (Connection timed out)]
zack is now known as zack|away
as has joined #ocaml
as has quit [Client Quit]
zack|away is now known as away
away is now known as zack
malc has joined #ocaml
zack has quit ["Client Exiting"]
cleverdra has joined #ocaml
malc has quit [Read error: 110 (Connection timed out)]
nerdlor has joined #ocaml
Dalroth has joined #ocaml
zack has joined #ocaml
zack is now known as zack|away
merriam has quit [card.freenode.net irc.freenode.net]
engstad has quit [Read error: 113 (No route to host)]
merriam has joined #ocaml
Yurik has joined #ocaml
Hampus has joined #ocaml
<Yurik> re
* Yurik is developing OCamlGettext... it will be ready soon
graydon has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
zack|away has quit [card.freenode.net irc.freenode.net]
gl has quit [card.freenode.net irc.freenode.net]
Dybbuk has quit [card.freenode.net irc.freenode.net]
mr_bubbs has quit [card.freenode.net irc.freenode.net]
xtrm has quit [card.freenode.net irc.freenode.net]
cleverdra has quit [card.freenode.net irc.freenode.net]
mrvn_ has quit [card.freenode.net irc.freenode.net]
pnou has quit [card.freenode.net irc.freenode.net]
whee has quit [card.freenode.net irc.freenode.net]
Segora has quit [card.freenode.net irc.freenode.net]
emu has quit [card.freenode.net irc.freenode.net]
smkl has quit [card.freenode.net irc.freenode.net]
mr_bubbs has joined #ocaml
Dybbuk has joined #ocaml
gl has joined #ocaml
xtrm has joined #ocaml
zack|away has joined #ocaml
xtrm has quit [card.freenode.net irc.freenode.net]
Dybbuk has quit [card.freenode.net irc.freenode.net]
mr_bubbs has quit [card.freenode.net irc.freenode.net]
zack|away has quit [card.freenode.net irc.freenode.net]
gl has quit [card.freenode.net irc.freenode.net]
nerdlor has quit [Remote closed the connection]
xtrm has joined #ocaml
gl has joined #ocaml
Dybbuk has joined #ocaml
mr_bubbs has joined #ocaml
cleverdra has joined #ocaml
mrvn_ has joined #ocaml
whee has joined #ocaml
Segora has joined #ocaml
smkl has joined #ocaml
pnou has joined #ocaml
emu has joined #ocaml
smklsmkl has joined #ocaml
smkl has quit [Killed (carroll.freenode.net (brunner.freenode.net <- dahl.freenode.net))]
Segora has quit [Killed (carroll.freenode.net (brunner.freenode.net <- dahl.freenode.net))]
mr_bubbs has quit [card.freenode.net irc.freenode.net]
Dybbuk has quit [card.freenode.net irc.freenode.net]
gl has quit [card.freenode.net irc.freenode.net]
xtrm has quit [card.freenode.net irc.freenode.net]
pnou has quit [card.freenode.net irc.freenode.net]
whee has quit [card.freenode.net irc.freenode.net]
mrvn_ has quit [card.freenode.net irc.freenode.net]
cleverdra has quit [card.freenode.net irc.freenode.net]
emu has quit [card.freenode.net irc.freenode.net]
emu has joined #ocaml
pnou has joined #ocaml
Segora has joined #ocaml
whee has joined #ocaml
mrvn_ has joined #ocaml
cleverdra has joined #ocaml
xtrm has joined #ocaml
gl has joined #ocaml
Dybbuk has joined #ocaml
mr_bubbs has joined #ocaml
merriam has quit [card.freenode.net irc.freenode.net]
merriam has joined #ocaml
cleverdra has quit [card.freenode.net irc.freenode.net]
mrvn_ has quit [card.freenode.net irc.freenode.net]
whee has quit [card.freenode.net irc.freenode.net]
pnou has quit [card.freenode.net irc.freenode.net]
Segora has quit [card.freenode.net irc.freenode.net]
emu has quit [card.freenode.net irc.freenode.net]
emu has joined #ocaml
pnou has joined #ocaml
Segora has joined #ocaml
whee has joined #ocaml
mrvn_ has joined #ocaml
cleverdra has joined #ocaml
mrvn_ has quit [card.freenode.net irc.freenode.net]
pnou has quit [card.freenode.net irc.freenode.net]
cleverdra has quit [card.freenode.net irc.freenode.net]
whee has quit [card.freenode.net irc.freenode.net]
Segora has quit [card.freenode.net irc.freenode.net]
emu has quit [card.freenode.net irc.freenode.net]
cleverdra has joined #ocaml
mrvn_ has joined #ocaml
whee has joined #ocaml
Segora has joined #ocaml
pnou has joined #ocaml
emu has joined #ocaml
graydon has quit []
<Hampus> Why should I use O'Caml instead of Haskell?
<cleverdra> because O'Caml makes it easier to do imperative programming and mix imperative/functional styles; because O'Caml has a more powerful module system; because O'Caml has an object system; because O'Caml has interpret/bytecode/native-code on all (or many, with native-code) platforms; because O'Caml has modifiable syntax through camlp4
<cleverdra> There are at least two Haskell object systems; Haskell's module system is (so I hear) nearly as powerful but easier to use.
<cleverdra> also going the other way: O'Caml's type system is slightly weaker; it lacks parametric polymorphism and its weak types make certain correctly-typed programs fail the type-checker (but such programs can always be modified to work).
smklsmkl is now known as smkl
<mr_bubbs> cleverdra: I'd call that a pretty good answer
* cleverdra shrugs.
<cleverdra> Hampus - O'Caml is generally considered to be capable of producing extremely efficient programs.
<Hampus> cleverdra: Fast programs aren't everything... Fast developmen cycle with few bugs are more essential...
<cleverdra> Hampus - of course. Isn't it wonderful that O'Caml gives you both?
<Hampus> I've just started to look into O'Caml, but I instantly missed haskell's classes, they make life so easy.
<cleverdra> instance Show Foo where ... yes, those are nifty.
<Hampus> Yepp, they make it very easy to write code that can be reused.
<Hampus> The biggest "why" I've found are O'Camls "name-scope", is there any good reason that I have to use rec, and &co? Do they affect more than visibility of the names?
<cleverdra> err, &co?
<Hampus> "and such things", I just asumed that I have not seen them all...
<cleverdra> Yes, I know that you meant, but I don't know what you're referring to.
<Hampus> Neither do I, as I said, i just assumed there would be more of them... But why do O'Caml have those two (and, rec)?
<cleverdra> 'and' allows you to define variables 'in parallel'; 'rec' allows you to define variables that depend on other (pre-defined) variables of the same name (that is, the absence of 'rec' allows this)
<cleverdra> s/variables/bindings/g
<Hampus> Yes, but why can't you do it without those words? It works "everywhere" else...
<Hampus> ... in other languages
<cleverdra> an example use of 'and': if you define binding b1 that depends on binding b2 and a new binding b2', using 'and' to define b1 and b2' in parallel assures you that b1 uses b2 and not b2'
<cleverdra> Hampus - err, other languages by default only allow one or the other.
<cleverdra> Hampus - re 'rec'; other languages likewise have special cases comparable to 'and' or they have nothing analoguous.
<cleverdra> (a,b) = b,a
<cleverdra> let a=b and b=a
<cleverdra> compare to: let a=b in let b=a
<Hampus> What do you mean by (a,b) = b,a? In haskell i can write (a, b) = some_function a
<cleverdra> Hampus - I'm referring to various languages, but Python is one of them.
<cleverdra> let (a,b) = (b,a) -- in Haskell
<cleverdra> well, GHCi didn't like that.
<Hampus> That's because my example isn't a full working example, you must have something like "let (a, b) = some_function a in some_expr ", and of course the function some_function must be lazy in the right kind of way...
<cleverdra> (I was referring to my code)
<Hampus> GHCi (and hugs) does not work as most interactive interpreters, niether allows anything but expressions...
<cleverdra> A bigger 'why' that bothers me is (*) -- a block comment that looks like a curried function.
* cleverdra despises block comments, anyway.
<Hampus> Thats really one thing i like :) They look nice...
<cleverdra> Hampus - yes, I know that (but GHCi *does* allow definitions through 'let' and <-)
<Hampus> yes but "let ... in ..." is an expression...
<cleverdra> Sorry, I thought you didn't realize that.
<Hampus> Oh, I've got some knowledge about fp, just not about O'Caml :)
<Hampus> Your example "let (a,b) = (b,a)" isn't a full expression though since it lacks the "in expr" part (lets without in are only allowed in do-expressions)
<cleverdra> ah, OK.
<Hampus> It is however illegal anyways, since "nothing" in Haskell is mutable...
<cleverdra> Overshadowing bindings is not mutating bindings.
<cleverdra> err, mutating values.
<Hampus> No, but thats not what you're doing (at least not in Haskell).
<cleverdra> That's certainly what I'm doing in O'Caml and in the Python/misc example.
<Hampus> (a, b) = b,a in python changes the values, doesn't do anything with any bindings...?
<cleverdra> I don't see how you can arrive at that, but OK.
<Hampus> what would you say happens in the python case?
<cleverdra> I would say would I said, or say that what really happens is that some hidden dictionary is altered -- the effect is the same.
<cleverdra> what I said.
<Hampus> Python isn't functional so why should it behave like that?
<cleverdra> I'm sorry, I don't care to continue this conversation.
<Hampus> then don't... but it would be nice if you really could tell me about rec/let and give me some (good) examples (in ocaml).
<cleverdra> Haven't I? rec: other languages either have an analogue to this keyword or only allow you to do one of A) define bindings in terms of themselves, B) define bindings in terms of bindings-with-the-same-name; and: other languages either provide an analogue to this keyword or do not allow you to define bindings 'in parallel'. I don't understand why you have a big questionmark over either of these, but I'm interested in why you have it.
<Hampus> I say that "rec" is for defining recursive functions, and that you can do in many languages without any extra keyword. I then ask what else can I do (example please).
<Hampus> The very same for "and" (e.g. data E = E A ; data A = A Int | B E is no problem in haskell, in O'caml you need "and").
<cleverdra> Yes it does, and yes they do; please read the entirety of my description of 'rec' -- you seem to be not understanding the point I make there.
<cleverdra> Hampus - yes, those are mutually recursive. O'Caml of that without 'and' may have different semantics. The Haskell has no alternative.
<Hampus> well, give me an example, please, where there is a semantic difference with and without "and"! I beg you!
<cleverdra> Hampus - a 'semantic difference' would exist when there are multiple bindings of the same name.
<Hampus> yes, and that says nothing (as you probably should have understood by now). Theory is nice, but practice is what we live in. Real code is good...
<cleverdra> a + b = b + a
<cleverdra> "Theory is nice, but..."
<cleverdra> This is anothing conversation I do not care to continue to participate in.
<Hampus> and still that isn't an example since it is just a snippet and hasn't got any _and_ in it (which is what we are talking about, right?)
<whee> I don't understand the question
<whee> heh
<whee> I'm getting ready to learn haskell myself, but I don't think it'll replace ocaml. Having the ability to do things imperitively helps a lot in 'real world' coding
<whee> regardless of whether you can do without it, it's nice to have the option
<Hampus> Yes, it is, and thats why I'm looking into O'Caml... However if in Haskell you have some parts that are slow and takes lots of memory you can use the FFI to speed things up and in some relly tough situations you can call C...
<whee> well you can do the same thing in any language
<Hampus> yes (well almost all...) but you want to use haskell most of the time...
<cleverdra> whee - Haskell is quite capable of imperative programming -- but not of certain imperative idioms (printf-style debugging =)
<whee> right, but it doesnt lend itself to doing it that way easily
<Hampus> You can always be a naughty boy and use ghc's extension "unsafePerformIO" :)
<cleverdra> Hampus - yes =)
<cleverdra> globalVariable = unsafePerformIO newEmptyMutVar
<Hampus> But with Haskell you do seldom need to debug (well...). Using QuickCheck you can catch many errors.
<Hampus> btw. how good is the O'Caml compiler (native of course) compared to c-compilers?
<whee> extremely good
<whee> it has a tendency to have speed on par with C when natively compiled
<whee> that's actually the only reason I learned O'Caml before Haskell, I was interested in speed
<cleverdra> You can look at the Great Language Shootout -- if such things impress you, you'll like how O'Caml sometimes beats gcc.
<whee> but now I want to pick up haskell because I'm getting interested in more of the other functional concepts
<Hampus> Speed's the only reason I'm considering any other language than haskell...
<Hampus> But most of the time ghc gives enough speed. Quick development is much more important (as I've said)
<Hampus> Is there any way to overload operators in O'Caml?
<whee> no overloading in ocaml
<Hampus> You can't get it all...
<whee> no overloading. heh
<whee> there's a variant of ocaml (g'caml) that has overloading, but it's based on an old ocaml and I don't know if it'd get into the main tree
<cleverdra> Hampus - O'Caml has special arithmetic operators for floats.
<cleverdra> hm, goodbye now.
cleverdra has quit ["Leaving"]
<Hampus> Well, one can only hope. Minor variations of a large language has a tendency to disappear, however nifty I think...
<whee> I don't thinkoverloading would make it anyway
<whee> it can get to be confusing
<whee> plus I think it adds more complexity to the type checker that they don't want to do
<Hampus> It can make things more reusable and much clearer... It's really not that hard/confusing to use. Learn haskell and see the light :)
<whee> heh
<whee> I'd be learning haskell if I could get the thing to compile in under a day
<whee> chasing errors around under OS X :\
<Hampus> Well it's late over here, time to sleep... I'll be back, be sure :) (I want a mac, now!)
Hampus has left #ocaml []
gl has quit [Read error: 110 (Connection timed out)]
karryall has joined #ocaml
malc has joined #ocaml
Yurik has joined #ocaml
<Yurik> re
<Yurik> anybody here?
Yurik_ has joined #ocaml
<Yurik_> if somebody still there?
<whee> yes?
<karryall> yup ?
<Yurik_> i've a question
<Yurik_> i'm trying to build some library using ocamlfind and have 'stew' required
<Yurik_> but it says that bigarray.cmxa or unix.cmxa are not compilation units descriptions
<Yurik_> and I see no way to fix it :((
malc has quit [Read error: 110 (Connection timed out)]
<whee> hrmf I have no experience with ocamlfind :|
<Yurik_> in fact, as I understand, this error is raised by ocamlopt
<karryall> when do you get this message ?
<karryall> when compiling stew ?
<Yurik_> no, when compiling my package with -package stew
<Yurik_> -linkpkg
<karryall> I think I had this problem once
<Yurik_> and do you remember solution?
<karryall> no :)
<karryall> but I found one
<karryall> try recompiling stew
<Yurik_> hm
<Yurik_> one minute..
<karryall> I think you get this kind of errors when using .cmxa compiled with an older compiler
<karryall> or something
<Yurik_> but these cmxa's are from ocaml distribution (unix.cmxa and bigarray.cmxa)
<Yurik_> rebuilt stew, reinstalled. problem do not disappear
<Yurik_> pity :( I have ready OCamlGettext, and just use a bit of Stew...
<Yurik_> to not to reinvent wheel
<karryall> try ocamlfind with -verbose to see how it calls ocamlopt
<Yurik_> i did
Yurik has quit [Read error: 104 (Connection reset by peer)]
<Yurik_> nothing strange, as I can see
<Yurik_> most strange thing is that it seems that bytecode compiles ok, so I already have bytecode OCamlGettext
Yurik_ is now known as Yurik
<karryall> you can get this error when you call ocamlopt with -a (build library buil) and feed it with some .cmxa
<Yurik> yes, i'm doing -a
<karryall> and that's bad, it should only get .cmx files
<Yurik> bah
<Yurik> so how can I use ocamlfind ocamlopt ? :(
<karryall> try with -verbose and remove the .cmxa from the command line
<Yurik> and I will get no unix and bigarray module, right
<Yurik> ?
<karryall> you have to specify those when linking your program