shp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | nohttp://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
fraggle_ has quit [Remote host closed the connection]
q66 has quit [Quit: Quit]
<lasagna> goddamn
<lasagna> I am a terrible typist
fraggle_ has joined #ocaml
<lasagna> ty Qrntz
<Qrntz> np
lasagna is now known as lasagna|sighgym
chambart has quit [Ping timeout: 246 seconds]
lasagna|sighgym is now known as buttpen1s
<darkf> can modules be mutually recursive? (i.e. A references B, and B references A)
emmanuelux has quit [Quit: emmanuelux]
buttpen1s is now known as lasagna|bench
<thelema> darkf: yes, but only within one file
<darkf> aw.
<darkf> thelema: What's a good resource on building generic modules then? I want to create something like an `interface`
<thelema> maybe you want module types: http://caml.inria.fr/pub/docs/manual-ocaml/manual018.html
<darkf> Hm, a bit too terse to tell me how to use them
<thelema> darkf: why do you want interfaces?
<darkf> thelema: Well, I'm writing a parser that depends on the context of an interpreter. The interpreter also uses the parser. I'd like to be able to define multiple backends (interpreter, compiler, ...) and have the parser ask the backend for certain information.
<thelema> ok, so you're thinking in a very OO way. You're certainly welcome to use objects for this kind of design. You won't even need to declare any interfaces, just writ ethe code and ocaml will infer the necessary types.
<darkf> thelema: Well, how else would you suggest I do it? Would the parser taking in a backend module be too much? :p
<thelema> you could use 1st class modules for this... But you're still thinking in terms of combined data + operations in a single value.
<Qrntz> wouldn't functors suffice?
<thelema> think in terms of transformations on data.
<thelema> yes, you could use functors to make the parser and interpreter independent of each other
<darkf> thelema: Well, the parser is just a function (tokenstream -> expr list), but it also depends on the state of the interpreter. I actually don't see how I'm conflating data and manipulation other than the interpreter which is a module with an environment (data) and transformation (`evaluate this`), or what to do about it. :P
testcocoon has quit [Ping timeout: 256 seconds]
<thelema> tokenstream -> interpreter -> expr list
<darkf> then I'd need a module type for interpreter, wouldn't I?
<darkf> or should I just have one type
<thelema> and interpreter could be (expr -> result) - result is int? or some variant type?
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<darkf> Huh, that could work too.
<thelema> if it needs state, that state could be internal to the closure
lolcathost has joined #ocaml
BiDOrD_ has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
testcocoon has joined #ocaml
madroach has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
Yoric has joined #ocaml
pkrnj has joined #ocaml
Playground has joined #ocaml
lolcathost has quit [Read error: Connection reset by peer]
Playground has quit [Client Quit]
Yoric has quit [Ping timeout: 252 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
lolcathost has joined #ocaml
mye has joined #ocaml
testcocoon has quit [Ping timeout: 276 seconds]
lasagna|bench is now known as lasagna
lasagna is now known as bob|doneshowerin
watermind has quit [Quit: Konversation terminated!]
Playground has joined #ocaml
lolcathost has quit [Read error: Connection reset by peer]
mattrepl has quit [Quit: mattrepl]
weie has joined #ocaml
Playground has quit [Read error: Connection reset by peer]
lolcathost has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 248 seconds]
ulfdoz_ is now known as ulfdoz
pkrnj has quit [Quit: Computer has gone to sleep.]
pkrnj has joined #ocaml
pkrnj has quit [Client Quit]
zip has quit [Read error: Connection reset by peer]
gour has joined #ocaml
zip has joined #ocaml
lolcathost has quit [Read error: Connection reset by peer]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
lolcathost has joined #ocaml
mye has quit [Ping timeout: 272 seconds]
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
fantasticsid has joined #ocaml
testcocoon has joined #ocaml
lolcathost has quit [Ping timeout: 272 seconds]
lolcathost has joined #ocaml
Yoric has joined #ocaml
cdidd has joined #ocaml
<mehdid> avsm: Hi. Can you please add a git tag (for example 1.1.1) in ocaml-re's repository?
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 265 seconds]
hto has quit [Ping timeout: 240 seconds]
ulfdoz has quit [Ping timeout: 264 seconds]
fantasti` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
wagle_ is now known as wagle
chambart has joined #ocaml
wuttf has joined #ocaml
<wuttf> Hey all! New to Ocaml
<wuttf> Spent the last 3 weeks learning Haskell but I decided I would give Ocaml a go too. Is there any definitive guide/book/tutorial on Ocaml?
bob|doneshowerin is now known as lasagna
<wuttf> lasagna: Thank you.
<wuttf> On a more subjective note: how come Ocaml users seem so few compared to haskell? One would tought mutability in Ocaml would attract more programmers.
<adrien> we're quieter =)
<wuttf> What do you mean? :)
<wuttf> Less shameless self promotion?
eni has joined #ocaml
<adrien> something like that
<wuttf> That's a good thing. I am a doer rather than a talker too.
<wuttf> I am hoping for a language with Hindley-Milner but occasional in-place destructive updates. Lets see what Ocaml can offer =)
cdidd has quit [Remote host closed the connection]
tane has joined #ocaml
cdidd has joined #ocaml
hto has joined #ocaml
<orbitz> Wheeeee my blogpost made it to reddit, thank you plane ocaml
<gour> wuttf: welcome to ocaml! i was interested for haskell as well and spent some time in #haskell, but it was overwhelming :-)
<darkf> Haskell is too nerdy for me
<orbitz> haskell is a great language in many ways, it just doesn't fulfill the niche I'm intereste in
<gour> darkf: 1337 ?
<gour> orbitz: what is that niche?
<wuttf> Well, I appreciate haskell, but currently I can't live with their coding practices, as I've told them too they are just not suitable for large scale software development.
<wuttf> Even Simon Marlow admitted on Google+ that he often has a hard time reading other people's Haskell code.
<gour> wuttf: i'm quite new with ocaml, but find it as 'practical haskell for real world'
<darkf> I suspect most of OCaml's relative unpopularness is due to it being... well, unpleasant for beginners! You kind of need an extra library (Core/Batteries) to supplement the lacking stdlib, the syntax is very clumsy, and there isn't a lot of literature out there on it.
<gour> xeah, in practice, lot of beauty is lost
<orbitz> gour: Being pragmatic
<gour> orbitz: ahh, good...that's my niche as well ;)
<orbitz> :)
* gour is eager to see RWO book
<darkf> Me too. I hope it comes out this year.
<wuttf> darkf: Clunky syntax? I don't see it. (Yet maybe :)
<darkf> wuttf: Compare it to F# or Haskell. You will see it. (I come from F#, and I hate myself)
cdidd has quit [Ping timeout: 246 seconds]
<orbitz> Ocaml syntax is clumsy? I find it rather light and expressive.
<darkf> Hahahaha, that's great then!
<darkf> Not to most people.
<wuttf> darkf Okay there are the let rec and minor stuff like int * int, are you referring to that?
<gour> at one point haskell was really a buzzword...like a git...but i wonder if many people will stick with it for a long time
<lasagna> ocaml is clumsy compared to haskell, for sure
<lasagna> it depends on where you come from
<lasagna> certainly cleaner than java or C
<lasagna> but I don't even konw C
<lasagna> so
<orbitz> I'm not sure exactly what clumsy means in terms of syntax, but Ocaml syntax is fairly light. The cost of making a new function is tiny compared to C or Java or C++
<darkf> wuttf: No. `let rec` is fine, `int*int` is fine. `let ... in` is not fine, semicolons are not fine, `struct ... end` and `sig ... end` are not fine. Pretty much forcing you to use parentheses around a lot of constructs (ifs, nested matches, asserts) is not fine. It's verbose, ugly, and I mess it up a lot.
<wuttf> I decided to check Ocaml when Haskell required me to thread state with State monad and generate lenses with Template Haskell to update a nested record. Not a big deal but I would rather not go trough that for the throwaway applications I write.
<gour> i agree...it may be that some things are cleaner in haskell, but there are others which are not...so, not a big deal
<orbitz> darkf: i use 'begin' and 'end' over parens in those constructs
<gour> orbitz: are you ex-pascal user?
<gour> :-)
<darkf> wuttf: Worst of all, the compiler's diagnostics are so bad, most of the time I just get `Syntax error.` That's it. Just a line number, and that general message. Me being new means I have to look for a few minutes to see what obscure thing I missed.
<orbitz> No, I just find it clearer
<darkf> orbitz: That works too, but what if you forget it?
<darkf> Why do you even need it? F# doesn't!
sgnb has quit [Read error: Connection reset by peer]
<orbitz> F# has whitespace sensitive syntax
<wuttf> darkf: Challenge accepted! Time to contribute to the Ocaml compiler =)
<darkf> And it's beautiful!
<darkf> wuttf: You do that ;)
<orbitz> I'm sure someone in #F# is bitching about whitespace syntax
<darkf> orbitz: Some have.
<orbitz> darkf: twt will handle almost every complaint you made though
<darkf> wuttf: I'm pretty sure if the OCaml developers/contributers can't fix the diagnostics, I couldn't either!
<darkf> What's twt?
<darkf> orbitz: Amazing!
<orbitz> the diagnostics in the compiler are poor, and it only shows one error at a time. But I haven't found that more painful than using another language yet :)
<wuttf> I gtg breakfast now, thank you for your warm welcome guys.
sgnb has joined #ocaml
<darkf> orbitz: Thanks for the link, that actually looks awesome :)
<orbitz> np
<gour> wuttf: bon appetite ;)
sgnb has quit [Write error: Connection reset by peer]
sgnb has joined #ocaml
Snark_ has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
nimred has quit [Quit: leaving]
xavierm02 has joined #ocaml
nimred has joined #ocaml
nimred has quit [Client Quit]
nimred has joined #ocaml
q66 has joined #ocaml
lolcathost has quit [Read error: Operation timed out]
lolcathost has joined #ocaml
RagingDave has joined #ocaml
<xavierm02> let's say I have this
<xavierm02> type variable = bool * int;;
<xavierm02> type disjunction = variable * variable * variable;;
<xavierm02> type expression = disjunction list;;
<xavierm02> how do I get the compiler to talk to me in terms of expression or disjunction
<xavierm02> when i have type errors
<xavierm02> instead of (bool * int) * (bool * int) * (bool * int) list
<pango> use records instead of tuples
<xavierm02> to get the readable type errors?
<xavierm02> or always?
<pango> declarations like type variable = bool * int just create type aliases
<pango> anything of type variable is really of type bool * int
<xavierm02> k
<xavierm02> ty
eni has quit [Ping timeout: 272 seconds]
<adrien> for cross-compilation support, I've been wondering something:
<adrien> you cross-compile from sytem $foo to system $bar
<adrien> an "ocamlrun" that works on $foo is needed
<adrien> but you also want to create one for $bar
<adrien> moreover, to create one for $foo, you need the output from "./configure"
lolcathost has quit [Ping timeout: 246 seconds]
<adrien> while for the one for $bar, you need the output from "./configure --target $bar"
<adrien> obviously you're going to have a conflict
<adrien> I don't really like the idea of first building the native compiler and on top of that, ./configure --target $bar, and build again
<adrien> a slightly better solution imho is to build the native compiler, install it, use fresh sources, ./configure --target $bar, and build; the process will then use the system "ocamlrun"
<adrien> this means that to build a cross-compiler of ocaml for version X.Y.Z, you will need a native compiler version X.Y.Z on your system; this is basically what is required for fortran and ada cross-compilers in GCC
lasagna has quit [Ping timeout: 246 seconds]
<adrien> yet another solution is to re-define what is the act of creating an ocaml cross-compiler: configure for host $foo and target $bar means that the generated files run on $bar but then it could be decided that "ocamlrun" should run on host and not on target; it's a slight change of semantics which could simplify (you'd then cross-compile a native compiler to get ocamlrun.exe) but I'm not sure it'd help a lot
<adrien> erf, I'm not sure it would be very doable (same issue as before: you need two configurations out of ./configure's output)
<adrien> comments, suggestions, ideas, lost, candies and beer?
* adrien edges towards requiring compiler version X.Y.Z as a native compiler; for windows a native compiler is needed anyway because flexdll is needed and it's part ocaml
lolcathost has joined #ocaml
emmanuelux has joined #ocaml
wuttf has quit [Quit: Page closed]
Snark_ is now known as Snark
wuttf has joined #ocaml
wuttf has quit [Client Quit]
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
mye has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
darkf has quit [Quit: Leaving]
jbrown has quit [Quit: Client exiting]
<adrien> hah: I've finally understood Garrigue's commit which introduced the "ocamlcomp(opt).sh" script
<adrien> at first this script calls "ocamlrun ocamlc/ocamlopt" but after the .opt compilers have been built, it ill call "ocamlc.opt" and "ocamlopt.opt"
<flux> actually I suggested that when we discussed it ;)
<mehdid> dear oasis, silent failures suck, no love, mehdi.
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
<adrien> flux: sorry, I was blinded by the commit message
<adrien> mehdid: there have been some changes recently that could improve that
<mehdid> yeah, but I'm stuck with oasis 0.2 for now :/
<adrien> oh, I had misread: I thought you complained about ocamlbuild
<adrien> but many of the oasis failures come from ocamlbuild
<mehdid> in what I'm experiencing right now, it is (for some reason I didn't identified yet), "ocaml setup.ml -install" installs the documentation only
<mehdid> the library modules aren't installed
<adrien> everything built properly?
<mehdid> (and the doc is even installed in the wrong place)
<mehdid> yep, everything built properly
Anarchos has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Read error: Operation timed out]
mattrepl has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
vpm has quit [Quit: co'o]
chambart has quit [Ping timeout: 246 seconds]
lolcathost has quit [Ping timeout: 255 seconds]
vpm has joined #ocaml
ontologiae has joined #ocaml
<thelema> xavierm02: you can get more readable error messages by using the types you want in annotations.
Yoric has joined #ocaml
mye has quit [Ping timeout: 256 seconds]
Submarine_ has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
<adrien> grah
<adrien> there are two many things to handle when taking care of cross-compilation of ocaml
<adrien> if configure has 100 questions for a native compiler, you'd almost need 100*100 questions for a cross
<thelema> not 200?
<flux> for each question you need to ask each other question?
<thelema> 200 questions, 100*100 combinations
<adrien> heh, maybe more like that, yeah
<adrien> make[1]: Leaving directory `/root/ocaml'
<adrien> bash-4.2# echo $?
<adrien> 0
<adrien> \o/
ulfdoz has joined #ocaml
jamii has joined #ocaml
lolcathost has joined #ocaml
<adrien> I have two remaining issues for my cross-compiler patches ("make world" succeeds): 1- otherlibs/bigarray/libbigarray.clib hardcodes "mmap_unix.o" but it should also allow "mmap_win32.o"
<adrien> 2- otherlibs/bigarray/Makefile does the same but I can't really put a conditional around the definition of COBJS because at the time it is evaluated, there is not enough information to know whether to use mmap_unix or mmap_win32
tlockney has quit [Read error: Operation timed out]
tlockney has joined #ocaml
j2d2j2d2 has quit [Remote host closed the connection]
j2d2j2d2 has joined #ocaml
tac has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
weie has quit [Quit: Leaving...]
lopexx has joined #ocaml
lopexx has quit []
Snark has quit [Quit: Quitte]
xavierm02 has quit [Quit: Leaving]
emmanuel__ has joined #ocaml
emmanuel__ has quit [Read error: Connection reset by peer]
emmanuelux has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
philed has joined #ocaml
emmanuelux has joined #ocaml
gour has quit [Quit: WeeChat 0.3.8]
lasagna has joined #ocaml
Submarine_ has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
Reventloff has quit [Quit: leaving]
lolcathost has quit [Ping timeout: 265 seconds]
lolcathost has joined #ocaml
leoncamel has quit [Ping timeout: 265 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
hongboz has joined #ocaml
<asmanur_> how can I say in a module signature "t has to be a supertype of ..."
<asmanur_> for instance module type S = sig type t constraint t = ... end
<thelema> you could require the existence of a downcast function...
<thelema> val downcast : t -> ...
<thelema> this isn't awesome
<asmanur_> yes
<asmanur_> i thought there would be a way to get rid of that
<thelema> I have the feeling it's not possible.
<asmanur_> ok, thanks!
<thelema> despite ocaml tracking covariance/contravariance, I rarely use such; it's only practical within the world of polymorphic variants and objects, as far as I can tell
<asmanur_> since I have only objects, I may be able to use the syntax class t : u
<asmanur_> i've been slowly using objects in one of my latest projects but everyday I learn new stuff about them
<thelema> asmanur_: there's a lot of subtleties; ocaml's structural typing for objects is not easy to nail down as is required in nominally typed languages like C++ and Java
<asmanur_> yes
<asmanur_> but it is convenient to use
lolcathost has quit [Read error: Operation timed out]
lolcathost has joined #ocaml
RagingDave has quit [Read error: Connection reset by peer]
RagingDave has joined #ocaml
RagingDave has quit [Quit: Ex-Chat]
fayden has quit [Ping timeout: 255 seconds]
tac_ has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
RagingDave has joined #ocaml
PM has quit [Ping timeout: 246 seconds]
PM has joined #ocaml
fayden has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 248 seconds]
q66 has quit [Quit: Quit]
lolcathost has quit [Ping timeout: 246 seconds]
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
sad0ur has joined #ocaml
jamii has quit [Read error: Connection reset by peer]
lolcathost has joined #ocaml