Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
philtor has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
Tianon has quit [Ping timeout: 248 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
elehack has joined #ocaml
jakedouglas has joined #ocaml
jeddhaberstro has joined #ocaml
elehack has quit [Quit: not a typewriter]
jakedouglas has quit [Quit: Leaving.]
mjonsson has joined #ocaml
bzzbzz has quit [Quit: leaving]
ulfdoz has joined #ocaml
bzzbzz has joined #ocaml
valross has quit [Remote host closed the connection]
jeddhaberstro has quit [Quit: jeddhaberstro]
ulfdoz has quit [Ping timeout: 260 seconds]
coucou747 has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
alpounet has quit [Ping timeout: 248 seconds]
alpounet has joined #ocaml
alpounet has quit [Ping timeout: 240 seconds]
coucou747 has quit [Remote host closed the connection]
|marius| has joined #ocaml
jakedouglas has joined #ocaml
alpounet has joined #ocaml
jakedouglas has quit [Client Quit]
ikaros has joined #ocaml
|marius| has quit [Remote host closed the connection]
gildor has quit [Ping timeout: 265 seconds]
gildor has joined #ocaml
despa has quit [Ping timeout: 260 seconds]
chee has quit [Ping timeout: 240 seconds]
Vassia has joined #ocaml
despa has joined #ocaml
Vassia has quit [Ping timeout: 265 seconds]
ftrvxmtrx has joined #ocaml
orbitz_ has joined #ocaml
orbitz has quit [Read error: Connection reset by peer]
ikaros has quit [Quit: Leave the magic to Houdini]
avsm has joined #ocaml
barismetin has joined #ocaml
sepp2k has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
barismet_ has joined #ocaml
barismetin has quit [Read error: Connection reset by peer]
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
ssbr has joined #ocaml
<ssbr>
Hey folks, I've gotten ahead of myself and started learning Ocaml. The reason I started was because, when I learned Scheme I didn't feel like pure functional programming had really gotten to my head. I was programming idiomatically, but it felt the same as coding, say, Python. I get the feeling I don't "get" functional programming. Would Ocaml help? Haskell was the other option but I didn't want to drown myself yet.
fraggle_ has quit [Client Quit]
fraggle_ has joined #ocaml
<jamii>
ssbr: I would recommend haskell or erlang. ocaml is a very practical language but its not much purer than scheme
<ssbr>
Well, it wasn't the lack of purity. I never used any of the imperative features of Scheme actually.
<ssbr>
But, if it should be Erlang or Scheme, I'll learn one of them
<ssbr>
ugh, Erlang or Haskell*
avsm has quit [Ping timeout: 245 seconds]
<jamii>
yeah. haskell with really help you understand the functional paradigm. ocaml will still be here when you need to get shit done
<ssbr>
At the moment I'm looking for a decent Haskell tutorial to get me started, to be honest. You knowing where I stand at the present, would you have any suggestions?
<ssbr>
(I realize this is a bit off-topic!)
<ssbr>
Ah yeah, haha.
<ssbr>
I'm not a believer in OO being the only way. I think in some form it's proven itself decent for simulations and games and the like, but I'm also very interested in alternative formulations for it (I've heard Go is interesting), and of course in complete alternatives for things that are not as directly suitable
<ssbr>
(in fact even for things like games, a very large part of the code isn't stateful or very simulation-oriented at all)
<jamii>
ssbr: i would jump into #haskell and ask around. its been a while since i learned. im not sure what good tutorials are around now
<Associat0r>
Scala is a great language
<Associat0r>
nice blend of OO/FP
<Associat0r>
lots of high abstractions possible with minimal language constructs, at the expense of less type inference and verbosity
<Associat0r>
I don't recommend erlang, it's very domain specific and as a language not really that interesting, it's the fault tolerant distributed stuff + hot code loading that make it interesting
<Associat0r>
Actor model can be done in other languages
<Associat0r>
some platforms also have fault tolerant distributed stuff as addons
<Associat0r>
you shouldn't throw OO out, it fits very well with a layered design like lablgtk illustrates
_andre has joined #ocaml
sdschulz` has joined #ocaml
sdschulze has quit [Ping timeout: 240 seconds]
<th5>
Still, learning some purely functional programming can be really useful. OO definitely doesn't suck as much as all the functional people seem to think though. Plus OCaml's OO is pretty interesting.
<ssbr>
The two can and have coexisted. Both are good.
<ssbr>
(for varying values of good at different places and times. I think it will always depend on what you're doing, there is no silver bullet, etc.)
<jamii>
Associat0r: the libraries may be mostly network oriented but erlang is a pretty general purpose language. you dont have to be doing distributed stuff to make it worthwhile
<jamii>
Associat0r: that presentation isnt *really* about OO, its about notions of time and simultaneity in programming languages. its a really interesting read, i highly recommend it
<Associat0r>
I know but as a language it doesn't offer anything that Ocaml doesn't provide, also it's pervasively dynamically typed
<Associat0r>
jamii: I saw Hickey's stuff before
<Associat0r>
it's good stuff
<jamii>
cool
<jamii>
my experience with erlang is that is has much better support for separation of state
<jamii>
i would generally choose it over ocaml for building stateful, reactive systems
<jamii>
i use ocaml mostly for computational or descriptive problems, like complicated parsers
<jamii>
the dynamic typing in erlang doesnt bother as much as most languages. pattern matching, ADTs, lack of duck typing, type specs etc make it less of an issue than in most dynamic languages
<Associat0r>
performance and static checking are a huge issue for me
<Associat0r>
I'm mainly using F# btw
<Associat0r>
OCaml I mainly use for education
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
oriba has joined #ocaml
barismet_ has quit [Remote host closed the connection]
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
barismetin has joined #ocaml
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 276 seconds]
oriba has quit [Quit: Verlassend]
Associat0r has quit [Quit: Associat0r]
sepp2k has quit [Quit: Leaving.]
metasyntax has joined #ocaml
verte has quit [Quit: ~~~ Crash in JIT!]
orbitz_ has quit [Quit: Reconnecting]
orbitz has joined #ocaml
mjonsson has quit [Ping timeout: 276 seconds]
ccasin has joined #ocaml
Anarchos has joined #ocaml
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 240 seconds]
thieusoai has quit [Quit: Leaving]
xmarteo has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
barismetin has quit [Remote host closed the connection]
|marius| has joined #ocaml
barismetin has joined #ocaml
xmarteo has joined #ocaml
|marius| has quit [Remote host closed the connection]
jakedouglas has joined #ocaml
ulfdoz has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
oriba has joined #ocaml
|marius| has joined #ocaml
oriba has quit [Quit: Verlassend]
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
ftrvxmtrx has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 265 seconds]
boscop_ has left #ocaml []
boscop has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
avsm has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
jonrafkind has joined #ocaml
chee has joined #ocaml
<jonrafkind>
is it possible to achieve method overloading? basically I want to write a generic printer for printf so that I don't have to know the type of an object just to print it
<jonrafkind>
maybe is it possible to pattern match on the type of a variable?
<ccasin>
not in ocaml (unless there are some magic extensions I don't know about)
<ccasin>
this would violate parametricity
<ccasin>
which basically just says you can't inspect type variables
<mfp>
jonrafkind: if you're using objects, you can have a method of type 'self -> string, though
<jonrafkind>
right, im just using plain datatypes (int, string, etc.)
<jonrafkind>
and some record types too
<ccasin>
the standard way to get this sort of type-class style overloading in ocaml is to use functors
<ccasin>
that is, define a new module type, it has one type parameter and just contains a print function for that parameter
<ccasin>
then, make your current module take in one of those modules as an argument for the type in question
<ccasin>
it's kind of a hassle though, and you still have to implement print for each specific type
<jonrafkind>
what do you mean by " then, make your current module take in one of those modules as an argument for the type in question"
<mfp>
jonrafkind: if it's for debugging, there are a couple functions around that dump the internal representation (no type info is kept at runtime)
<jonrafkind>
oh ok, whats an example of that function
<ccasin>
I mean that your current module should be parameterized by a type variable and another module that implements print for that type variable
<mfp>
extlib's Std.dump IIRC
<mfp>
also in batteries
<mfp>
(just checked)
<ccasin>
as I say, it's not super convenient, esp. if you want to do this at several types inside the same module
<jonrafkind>
yes I would like several types in the same module
<jonrafkind>
ok ill try to use one of these dumping functions
<ccasin>
yeah, ocaml just isn't equipped to do that sort of overloading. but maybe mfp's hack will with for your case
<ccasin>
*work for
|marius| has joined #ocaml
<mfp>
batteries has got a syntax extension that allows things like Printf.printf p"You got a %card" card
th5 has quit [Quit: th5]
Associat0r has joined #ocaml
barismetin has quit [Remote host closed the connection]
Tianon has quit [Ping timeout: 252 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
jeddhaberstro has joined #ocaml
Anarchos has joined #ocaml
avsm has quit [Quit: Leaving.]
|marius| has quit [Remote host closed the connection]
jonrafkind has left #ocaml []
RyanRN has joined #ocaml
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
RyanRN has quit [Remote host closed the connection]
sdschulz` has left #ocaml []
rexim has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
jakedouglas has joined #ocaml
sdschulze has joined #ocaml
rexim has quit [Remote host closed the connection]
sepp2k has joined #ocaml
sepp2k has quit [Quit: Leaving.]
iratsu has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
_andre has quit [Quit: leaving]
bzzbzz has quit [Quit: leaving]
ulfdoz has quit [Ping timeout: 260 seconds]
ccasin has quit [Quit: Leaving]
jeddhaberstro has quit [Quit: jeddhaberstro]
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
xmarteo has quit [Quit: Debian GNU/Hurd is Good.]
<jonafan>
well i wrote an array monad
|marius| has quit [Read error: Connection reset by peer]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
fraggle_ has joined #ocaml
valross has joined #ocaml
coucou747 has joined #ocaml
chee has quit [Ping timeout: 276 seconds]
philtor has joined #ocaml
coucou747 has quit [Remote host closed the connection]