<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" :)