flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
vovkaii has joined #ocaml
Alpounet has quit ["Quitte"]
<kaustuv_> Yes, a curse would definitely explain it.
vovkaii has quit [Read error: 110 (Connection timed out)]
Fulax has quit ["Out of Memory: Killed process [9823] xchat."]
<kaustuv_> the story has hit reddit now: http://www.reddit.com/r/programming/comments/80wgq
<kaustuv_> Tim Rentsch has an amazingly small google footprint.
ched_ has joined #ocaml
ched_ has quit [Client Quit]
ched_ has joined #ocaml
det has quit [Remote closed the connection]
det has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
Mr_Awesome has joined #ocaml
ched_ has quit [Remote closed the connection]
ChristopheT has quit [Remote closed the connection]
slash_ has quit ["leaving"]
jeddhaberstro has joined #ocaml
alexyk has quit []
l_a_m has quit [brown.freenode.net irc.freenode.net]
munga has quit [brown.freenode.net irc.freenode.net]
l_a_m has joined #ocaml
munga has joined #ocaml
m3ga has joined #ocaml
Alpounet has joined #ocaml
Alpounet has quit ["Quitte"]
Alpounet has joined #ocaml
<tsuyoshi> a curse on english ocaml books, anyway
<Alpounet> ?
<tsuyoshi> there are plenty of books in french and japanese
<Alpounet> and you aren't neither French or Japanese ... right ?
<mrvn> Does age really matter for ocaml books? The language hasn't really changed and once you know the basics you can read the online docs for reference to any little changes.
m3ga has quit [Remote closed the connection]
<tsuyoshi> Alpounet: no, but I can read japanese
<tsuyoshi> french I have quite a bit of trouble with
<mrvn> I would rather lean japanese than french. At least then I can watch mangas.
<tsuyoshi> ehh.. I don't know if that's such a good motivation.. virtually all the good stuff is translated to english anyway
<Alpounet> yep
<mrvn> tsuyoshi: guess why I don't know japanese yet
kaustuv_ has quit [Remote closed the connection]
kaustuv_ has joined #ocaml
angerman has joined #ocaml
<mrvn> What happens if caml_alloc_custom fails? Does it return NULL or throw an exception?
<Alpounet> caml_alloc_custom is C, right ?
<mrvn> yes
<Alpounet> NULL, so
angerman has quit [Client Quit]
jeddhaberstro has quit []
<mrvn> Alpounet: must be 0 actually as value is an integer type.
<Alpounet> NULL is used for any type
<Alpounet> it is implementation defined
<mrvn> fuse_stubs.c:170: warning: comparison between pointer and integer
<Alpounet> buts often it's something like (void*)0
<Alpounet> but*
<mrvn> NULL is a pointer and value is an integer
<Alpounet> paste some code, if you want, it will be easier :)
<mrvn> ml_fs = caml_alloc_custom(&caml_fuse_filesystem_ops, sizeof(Filesystem), 0, 1);
<mrvn> if (ml_fs == NULL) goto out;
<mrvn> That gives the warning
<Alpounet> how is ml_fs declared ?
<mrvn> CAMLlocal2(ml_argp, ml_fs);
<Alpounet> it is an int* ?
<mrvn> no, a value.
<mrvn> and: CAMLextern value caml_alloc_custom(struct custom_operations * ops, ...)
<Alpounet> manual doesn't telle anything about checking caml_alloc_custom's return value
<Alpounet> right ?
<mrvn> nope.
<kaustuv_> You're writing a binding for libfuse?
<mrvn> yes
<kaustuv_> cool
Alpounet has quit [Remote closed the connection]
Alpounet has joined #ocaml
mksql has joined #ocaml
<mrvn> minimal bindings are done. Now I need to write a test-fs to see if they actualy work.
<mrvn> or nearly done. Haven't figured out how to make the concurrency work yet.
<Alpounet> :)
Alpounet has quit ["Quitte"]
mksql has left #ocaml []
alexyk has joined #ocaml
vovkaii has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
mksql has joined #ocaml
vovkaii has joined #ocaml
bluestorm has joined #ocaml
meatbag has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
vovkaii has joined #ocaml
mksql has quit []
Alpounet has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
vovkaii has joined #ocaml
Fulax has joined #ocaml
vovkaii has quit [Read error: 60 (Operation timed out)]
olegfink has quit [Remote closed the connection]
olegfink has joined #ocaml
angerman has joined #ocaml
vovkaii has joined #ocaml
Fullma has quit ["Quitte"]
Camarade_Tux has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
marmottine has joined #ocaml
rwmjones_ has quit ["Closed connection"]
slash_ has joined #ocaml
angerman has quit []
vovkaii has joined #ocaml
olegfink has quit [Remote closed the connection]
Alpounet has quit ["Ex-Chat"]
olegfink has joined #ocaml
Alpounet has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
vovkaii has joined #ocaml
ofaurax has joined #ocaml
hkBst has joined #ocaml
vovkaii has quit [Read error: 110 (Connection timed out)]
vovkaii has joined #ocaml
ofaurax has quit [Read error: 60 (Operation timed out)]
<flux> hm, how do I send an SQL command directly to PostgreSQL with PGOCaml? I'd like to have function akin to let within_savepoint dbh name s = PGSQL(dbh) "SAVEPOINT $name"; .. but that won't work
philip_ has joined #ocaml
ofaurax has joined #ocaml
ofaurax has quit [Client Quit]
philip_ has quit [Read error: 110 (Connection timed out)]
jeromedezorro has joined #ocaml
Narrenschiff has joined #ocaml
<mrvn> "I just saw my first ghost." "Yeah, but how did you know where it was?"
Alpounet has quit ["Quitte"]
philip_ has joined #ocaml
Narrenschiff has quit []
<mrvn> "I just saw my first ghost." "Yeah, but how did you know where it was?"
<mrvn> ups
<mrvn> Anyone here know how to set LDFLAGS for an ocamlmakefile?
marmottine has quit ["mv marmotine Laurie"]
marmottine has joined #ocaml
eaburns has joined #ocaml
eaburns has quit [Client Quit]
Alpounet has joined #ocaml
philip_ has quit [Read error: 110 (Connection timed out)]
angerman has joined #ocaml
Cheshire has joined #ocaml
ehird has left #ocaml []
ehird has joined #ocaml
_zack has quit ["Leaving."]
<ehird> How can I put an infix operator in an .mli?
<mrvn> val ($) : unit -> unit ?
<ehird> syntax error
<ehird> :-(
<mrvn> ocamlc -i foo.ml + cut&paste
<mrvn> val ( $ ) : int -> int -> int
<ehird> hmm, with the spaces the syntax error is on the line of the next definition
<mrvn> works here with and without spaces.
<ehird> huh, your example works but not mine
<ehird> hmm, I think I might know why
<Alpounet> otherwise, paste
<ehird> :)
<ehird> just wanted to make sure I wasn't using an entirely incorrect syntax
<ehird> turns out it was an entirely unrelated problem
<Alpounet> ok
Alpounet has quit [Read error: 104 (Connection reset by peer)]
vovkaii has quit [Client Quit]
vuln has joined #ocaml
animist has joined #ocaml
yziquel has joined #ocaml
<yziquel> hi. having some trouble with ocamlbuild. I have the following setup:http://paste.lisp.org/display/76283 What I do not know how to do is to generate the .mli or .inferred.mli file. when i try to do ocamlbuild module1.inferred.mli, there's no ocamlfind wrapping being done by the plugin. how do people usually cope with this?
yziquel is now known as yziquel_
<bluestorm> yziquel_:
<bluestorm> (warning : i have never created ocamlbuild plugins myself)
<bluestorm> flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
<ehird> http://pastebin.com/f12c043e1 (* type-safe printf using functions instead of strings for the format :-) *)
<bluestorm> could you add such a line with "infer_interface" instead of "compile" ?
<bluestorm> ehird: isn't there a paper of Danvy about all that stuff ?
<ehird> I think so
<ehird> I coded something similar in Haskell many months ago, so I mentally copied it, I possibly saw it in a paper first
<bluestorm> iirc there was a few papers on the subject with improvements from one to the other
<bluestorm> if you're interested in the domain, you should check that
<ehird> I think i've read them but I'll give it a google. thanks :)
<ehird> should package this up into something usable
<bluestorm> ehird: couldn't the continuation build a string list, and do the concatenation at make_printf time only ?
<ehird> hmm
<ehird> yes
<bluestorm> that should perform better as the current concatenation-chain would give a quadratic complexity
<rwmjones> hmmm
<bluestorm> (hm, what would be the benefits of using that instead of Printf.printf in OCaml ?)
<rwmjones> the ocaml/book/plagiarism story has entirely disappeared from the front page of reddit.com/r/programming
* rwmjones senses legal action afoot
<ehird> bluestorm: well, printf's a hack.
<ehird> you give it a string. except it's not a string
<bluestorm> yes but
<ehird> also, mine lends itself more to multiline formats
<bluestorm> in practice it's neat and type-safe, so why bother ?
<bluestorm> are there other limitations ?
<ehird> can't define your own format chars
<ehird> http://pastebin.com/f23df2f28 <- multiline formats
<ehird> err, needs "let print_info ()", of course
<yziquel_> bluestorm: thanks. that seems to be a huge improvement. That, howevers, doesn't take care of threads and of syntax extensions. i'll try to work it out...
<bluestorm> well
vuln has quit ["leaving"]
<bluestorm> the syntax extension part is easy : do the same things a few line further
<bluestorm> flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
<bluestorm> and threads, same thing
<bluestorm> flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
<bluestorm> rwmjones: i'm not sure as it's still available through "search reddit"
<rwmjones> the article is still there, it's just gone from the front page
<bluestorm> I think it is an instance of the more general problem "OCaml stories lever last long on reddit"
<bluestorm> s/lever/never/
<ehird> bluestorm: actually, would itbe an improvement?
<ehird> you'd have to reverse the list -then- catenate it
<bluestorm> ehird: well you wouldn't concatenating by folding over the list
<ehird> hm.
<bluestorm> you would compute the sum length and blit the string pieces by pieces
<ehird> true
jeromedezorro has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
<mfp> <bluestorm> I think it is an instance of the more general problem "OCaml stories lever last long on reddit" > that's not it, note how it's +129... a mere +21 article with the same age (16H) is #18
<mrvn> Being able to define ones own format chars would be nice.
<mfp> either there was some legal action, or somebody reported the link
<mfp> (it'd be around #4 otherwise)
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
<ehird> erm
<ehird> doesn't hotness come into it
<ehird> ie how old it is
<ehird> oh hm
<ehird> well
<ehird> it was on the front page
<ehird> i dunno, reddit's algorithm is weird
<Cheshire> bluestorm attribute grammars :)
<bluestorm> hm ?
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
<ehird> bluestorm: are you saying I'd built like:
<ehird> sprintf (int % int) 1 2 as ["2","1"]?
<ehird> so that each formatter just has to ::
<mrvn> Maybe a fifo would be better
<ehird> mm
<ehird> i'lltry using Data.Mutable.Queue
<kaustuv> What's the url to the reddit story about that book again?
<mrvn> and maybe keep track of the number of chars in the fifo so you can allocate the string at the end without first summing the length.
<kaustuv> Never mind, google to the rescue
<ehird> mrvn: hmm, isn't taking the length of a string expensive in ocaml?
<mrvn> ehird: it is part of the structure of the string. Not like C strings where you have to find a 0 byte,
<ehird> ah
<ehird> length tagged strings
<ehird> should be easy then
<mrvn> A string is just a block of memory of known length.
<mrvn> block of chars
mytoz has left #ocaml []
<bluestorm> i'm considering a new "<--" keyword for my comprehension extension, for single values
<bluestorm> as a generator, "a <-- foo" would be equivalent to "a <- Enum.singleton foo"
<bluestorm> hm, I should check that it doesn't conflict with pa_monad
<bluestorm> but what do you think ? do you see a more appropriate (meaningful) symbol ?
<bluestorm> maybe <-= ?
meatbag has quit ["JESUS CHRIST, IT'S A LION! GET IN THE CAR!"]
_zack has joined #ocaml
<bluestorm> (of course that would be transformed into a simple let .. in )
<bluestorm> we could also have a Val or Single container with type 'a t = 'a
<bluestorm> less efficient but more uniform solution, and possibly useful in other situations
alexyk has joined #ocaml
Tux__ has joined #ocaml
Camarade_Tux has quit [Read error: 60 (Operation timed out)]
bzzbzz has joined #ocaml
slash_ has quit ["leaving"]
slash_ has joined #ocaml
<flux> bluestorm, so you use that often?
alexyk has quit []
<bluestorm> well
<bluestorm> i haven't used comprehensions themselves that often so far :]
<bluestorm> but now that i'm using them, it seems useful, yes
kaustuv_` has joined #ocaml
<bluestorm> do you now a good ocaml pastebin ?
<bluestorm> +k
<hcarty> bluestorm: codepad.org or ocaml.pastebin.com
<flux> apparently the ocaml book issue has been resolved and it is possible to click it from amazon on monday with good conscience :)
<ehird> What do the '_a types even mean? I can't find it in the manual
<kaustuv> flux: He claims to be a coauthor even though Jason's preface says "this book grew out of course notes".
<mfp> bluestorm: why new syntax for Enum.singleton? Are there that many structs with such a func? (PSet, Set, what else?)
<flux> kaustuv, but apparently he has been involved a lot in writing the material..
<flux> ``"The Objective Caml Programming Language" is derived from an earlier unpublished joint work by Jason Hickey and Tim Rentsch; if you look in the Preface in Rentsch's book you will see an attribution to this effect, mentioning Jason Hickey by name. Dr. Hickey has been aware of plans to publish a separate book based on their earlier joint work, and has asked only that he be given an attribution, which of course we were happy to do.''
<flux> (I'm quoting what rwmjones quoted on reddit)
<rwmjones> flux, that was a quote from caml-list :-)
<rwmjones> I just copied & pasted it ...
<flux> yes, just reading that too :)
<flux> (wish gnus wasn't so slow with semi-large mailboxes)
<kaustuv> Well, I remain suspicious given the contents of Jason's mail to the caml-list and the text of the preface in his draft of January 2008. I guess I'll wait for Jason to confirm Tim's version of the story.
<flux> argh, tim rentsch is a top-poster, I wonder if I should reconsider :/
<flux> ;)
<bluestorm> there are a few "project euler" problems in the Batteries examples (of the batteries source tree), and i've tried to rewrite some of them (because it's fun) : http://ocaml.pastebin.com/m6ab8567e what do you think ?
<bluestorm> (i haven't read the problem description either, only reworked the present source code)
prime2 has joined #ocaml
<kaustuv> Is it too late to suggest that the right delimiter for comprehensions be ?] ?
sgnb` has joined #ocaml
<bluestorm> no it isn't
sgnb has quit [Read error: 104 (Connection reset by peer)]
kaustuv_ has quit [Read error: 110 (Connection timed out)]
<bluestorm> do you think the gained symmetry is worth one more token ?
<kaustuv> It's more consistency with [| |], [< >], etc. than symmetry. Principle of Least Astonishment and the rest
<bluestorm> (I chose not to do so in the first place because i supposed comprehensions would be used to write small, one-line pieces of code, and thus should be as light as possible)
<flux> I sort of like the asymmetry. also it's very different from normal lists or arrays.
Fulax has quit ["Out of Memory: Killed process [9823] xchat."]
<kaustuv> bluestorm: your project Euler examples seems to contradict your expectation that they would be one liners
<flux> technically it could help give better error messages should you forget to close a ] inside the expression, though
<flux> and indeed, if their scope grows, you need to rely on the editor to see the proper scope
Tux__ is now known as Camarade_Tux
Amorphous has quit [Connection reset by peer]
angerman has quit []
yziquel_ has quit ["http://www.mibbit.com ajax IRC Client"]
Amorphous has joined #ocaml
Cheshire has quit [Read error: 113 (No route to host)]
Cheshire has joined #ocaml
Associat0r has joined #ocaml
_zack has quit [Read error: 113 (No route to host)]
alexyk has joined #ocaml
ttamttam has joined #ocaml
Associat0r has quit []
jonafan_ has joined #ocaml
_zack has joined #ocaml
<mfp> bluestorm: would it make sense to accept both ?] and ] ? ([ and ] are matched so it would not interfere with lists or such)
<ehird> mfp: that'd just be confusing
<ehird> since people will eventually decide on just one, probably
jonafan has quit [Read error: 110 (Connection timed out)]
<ski__> ehird : probably '_a is an uninstantiated type
mfp has quit [Read error: 104 (Connection reset by peer)]
Snark has joined #ocaml
Snark has quit [Read error: 104 (Connection reset by peer)]
<ski__> i.e. if you get
<ski__> val foo : '_a list -> barf = <fun>
<ski__> then, `foo' is *not* polymorphic, it's just that the type-checker hasn't yet decided what concrete type '_a should actually be
<ehird> but there's no reason my function shouldn't be polymorphic
<ehird> hmm
<ehird> ah, wait
<ehird> I think I know why
<ski__> as soon as you call `foo', on e.g. an integer list, the `_a will be instantiated to `int' so that you get
<ski__> val foo : int list -> barf = <fun>
<ski__> this is as oppossed to either giving a type-error directly, or inventing a useless dummy type to instantiate the '_a with (like SML/NJ does, iirc)
<ski__> probably your operation didn't get polymorphic because of the value restriction (or something similar .. i don't recall the details in O'Caml)
<ski__> for functions, usually it suffices to eta-expand the body of the definition (but be aware that this may change when and how many times side-effects / expensive computations are executed)
<ehird> aha
<ehird> okay
<ehird> :)
<ski__> for non-functions, you are more out of luck, afai recall
<ehird> hmm, I wonder why ocaml configure can't find tk but can find tcl :-(
* ski__ -> sleep
mfp has joined #ocaml
sgnb` has quit [Read error: 104 (Connection reset by peer)]
sgnb`` has joined #ocaml
olegfink has quit [Remote closed the connection]
olegfink has joined #ocaml
marmottine has quit ["mv marmotine Laurie"]
sgnb`` is now known as sgnb
slash_ has quit ["leaving"]
<bluestorm> ehird: a problem in the configure, it's limited to 8.[34] or something like that
<bluestorm> you can solve it by hacking into the script, or disabling Tk (wich is useless anyway)
<ehird> ah, nope, it works fine
<ehird> the problem was
<ehird> I had -cc 'gcc -m64'
<ehird> and you can't link tk with 64-bit
<bluestorm> ah.
<ehird> but yeah, tk probably is useless isn't it
<ehird> hmm
<ehird> I wonder if opengl works with 64 bit
<ehird> yep
<ehird> ok, I'll just drop tk
bohanlon has quit ["I fear that I must depart for now."]
bohanlon has joined #ocaml
<ehird> Are the ocaml*.opt compilers widely used, or do most use the bytecode versions?
alexyk has quit []
ttamttam has left #ocaml []
<Camarade_Tux> *opt compilers are used quite often
<ehird> I didn't compile them when building ocaml, should I have?
alexyk has joined #ocaml
vuln has joined #ocaml
<jlouis_> ehird: depends how much you are after speed
<ehird> Meh, I'll build them anyway. It's only a few meg on disk.
<jlouis_> the native opt-compilers are considerably faster
<jlouis_> but I actually like to use the bytecode compilers as well
<mrvn> ocaml code builds so fast it hardly matters to me.
_zack has quit ["Leaving."]
verte has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux> I find opt compilers matter mostly for redistributing
<Camarade_Tux> depending on the ocaml bytecode interpreter can be quite annoying
chupish has quit ["http://www.mibbit.com ajax IRC Client"]
<ehird> oh, I don't mean ocamlopt
<ehird> I mean ocamlc.opt and ocamlopt.opt
<Camarade_Tux> ah, ok
<Camarade_Tux> then it's meh ;)
alexyk has quit []
Cheshire has quit ["Leaving"]