mfp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
pimmhogeling has quit [Ping timeout: 272 seconds]
fabjan has quit [Remote host closed the connection]
slash_ has quit [Quit: leaving]
Yoric has quit [Ping timeout: 248 seconds]
seanmcl has joined #ocaml
derdon has quit [Quit: derdon]
tmaedaZ is now known as tmaeda
Modius has joined #ocaml
Modius_ has joined #ocaml
Modius has quit [Ping timeout: 252 seconds]
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
thrasibule has joined #ocaml
Modius_ has quit [Quit: I'm big in Japan]
Modius has joined #ocaml
<elehack> Any Lwt gurus in here?
seanmcl has quit [Quit: seanmcl]
<EliasAmaral> i am no guru, but ask your question ^^
<EliasAmaral> you might learn something (or myself)
<elehack> The documentation for bind says that the result of a thread can be bound several times.
<elehack> Suppose I have a thread A, and bind to it twice, resulting first in B followed by C.
<elehack> Suppose I then bind a function to B, resulting in D.
<elehack> Does the B->D function run before the B->C function, even if D sleeps?
<elehack> More concretely - if A is the thread resulting from opening a file, and I bind it twice, resulting in threads B and C, each of which does some I/O.
<EliasAmaral> i don't know what is lwt.. but, from the page..
<elehack> I want to know if all of B's I/O will be done before C's.
<EliasAmaral> doesn't lwt have a synchronization mechanism?
<EliasAmaral> it looks like that you shouldn't rely on this behavior
<elehack> that's what I'm fearing.
<EliasAmaral> because it seems confusing: it's not stated clearly in your program that B happens before C
<elehack> Yes, Lwt has a synchronization mechanism, but I'm trying to build a functorized library that can have Lwt as just one backend... and want to minimize the operations the backend module must provide.
<elehack> yeah, that's what I'm fearing.
<EliasAmaral> hmm o.o and why you would need to configure this? @.@
<elehack> PG'OCaml seems to depend on that kind of implicit synchronization, but I don't know if that's intentional or accidental.
<EliasAmaral> configure this = change between concurrency engines
<elehack> To be able to run without Lwt, e.g. in a single-threaded command line app, or in a multithreaded ocamlnet multiplexer.
<EliasAmaral> hm
<EliasAmaral> but you can run lwt in a single-threaded command. the overhead isn't acceptable?
<elehack> The overhead probably isn't a problem.
<elehack> But if I can provide an interface that allows direct coding w/o Lwt, it can simplify things for such cases (a little).
<elehack> In the single-threaded command, it probably isn't too much work to just run Lwt.run though.
<EliasAmaral> hmmm.. i am reading: binding means finalizing a lazy value, right?
<elehack> not quite, or at least that isn't the mental model I use for it.
<elehack> it means setting up another node in a data flow graph, to receive a value whenever it's available.
<EliasAmaral> if your concurrent model is cooperative, if bind something you probably can assume it will return before any other thread run
<EliasAmaral> but this 'It means that the computation may not be terminated.'
<EliasAmaral> it's a description of a lazy value, but with a message-passing paradigm
<EliasAmaral> (like hmm.. channels from Event o.o)
<EliasAmaral> but channels from event don't describe computations, it's really different
<EliasAmaral> ... ok, i don't understand that bind
<EliasAmaral> it transforms the "lazy" value on another
<elehack> are you familiar with monadic programming?
<EliasAmaral> hmm but the function itself can access the computed value
<EliasAmaral> no, i am not :(
<elehack> Lwt's API is monadic; bind is the monad bind operator.
<EliasAmaral> yeah i recognize >>= from haskell, never really understood that stuff
<EliasAmaral> .-.
<elehack> it's kinda weird. took me quite a while to get it.
<EliasAmaral> but i think that, since it is cooperative.. and ocaml isn't really parallel,
<EliasAmaral> you can assume that nothing happens in the middle of a bind
<elehack> quite likely. although that probably wreaks havoc on the abstraction.
<elehack> and I don't know what all happens in the event loop :-S
<EliasAmaral> and if a bind X happens before Y, the side effects of X will happen atomically, and then the side effects of Y will happen etc
<elehack> yes.
<elehack> but the bind X can suspend, returning control to the main event loop... which then might run Y anyway.
<EliasAmaral> i think that haskell don't have this problem because evaluating functions can't have side effects
<elehack> yeah
<elehack> although the I/O I'm concerned about is monadic as well.
<EliasAmaral> hmmm. but it's the duty of X suspending itself, right? and then give up atomicity
<elehack> yes
Drk-Sd has joined #ocaml
<elehack> EliasAmaral: thanks for helping me think through stuff... I may just use Lwt, provide some convenience APIs for single-threaded programs, and wish all comers good luck if they want to use it in a multithreaded environment.
<elehack> and forget this functorization.
<EliasAmaral> ... hmm o.o why couldn't you use lwt in a single-thread app?
<elehack> you can. The convenience APIs would just do the Lwt_main.run call for the client, so that the client can pretend that it's just a single sycnhronous call.
<EliasAmaral> ah.
Drk-Sd has quit [Quit: {'EXIT', Drk-Sd, "bye"}]
elehack has quit [Quit: Goodbye...]
yakischloba has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
thrasibule has quit [Ping timeout: 252 seconds]
Modius has quit [Quit: I'm big in Japan]
Modius has joined #ocaml
Amorphous has quit [Ping timeout: 256 seconds]
Modius has quit [Quit: I'm big in Japan]
Amorphous has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
Drk-Sd has joined #ocaml
yakischloba has quit [Quit: Leaving.]
yakischloba has joined #ocaml
Drk-Sd has quit [Quit: {'EXIT', Drk-Sd, "bye"}]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Modius has joined #ocaml
yakischloba has quit [Quit: Leaving.]
fabjan has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
<Camarade_Tux> gildor: hi, am I wrong or is there no "split_path" in ocaml-fileutils? I'm looking for a function that would return [ "a"; "b"; "c" ] when given "/a/b/c" (my concern was windows compatibility but it should actually be ok)
Modius has quit [Quit: I'm big in Japan]
MissPiggy has quit [Quit: Lost terminal]
<Camarade_Tux> anyone on windows? what do [ Filename.basename "c:" ] and [ Filename.dirname "c:" ] return?
<flux> I wonder if pgocaml actually binds the same value twice and expects (or expects not) that the left-hand side being executed twice
pimmhogeling has joined #ocaml
slash_ has joined #ocaml
pimmhogeling has quit [Read error: Connection reset by peer]
ikaros has joined #ocaml
<flux> hah, F# is being roasted in /. comments. there's an article about don syme's interview: http://www.simple-talk.com/opinion/geek-of-the-week/don-syme-geek-of-the-week/ . pretty sure ~nobody of the commenters knows anything about the language, though :).
Yoric has joined #ocaml
Submarine has quit [Read error: Connection reset by peer]
seanmcl has joined #ocaml
seanmcl has quit [Quit: seanmcl]
ikaros has quit [Quit: Leave the magic to Houdini]
Smerdyakov has joined #ocaml
boscop has joined #ocaml
<maskd> flux: at least they know it's not fortran
<flux> maskd, :)
<flux> bah, even ocsigen's xhtml syntax extension has strict limits on attributes - and of course it doesn't know them all
<flux> but maybe ocamlduce's support works better. I've never tried it before, though..
<Yoric> Is there someone around here with a Linux distro at hand?
<flux> yes
<Yoric> I need something checked but I don't have any Linux in front of me :)
<Smerdyakov> Yoric, details?
<Yoric> Smerdyakov: disk space required for installing apache, php, postgresql
<Yoric> (the kind of thing for which I'd rather use apt-get than count manually)
<Smerdyakov> Yoric, I have at least Apache and Postgres installed. What do you want me to run to measure?
<Smerdyakov> Oh, and BTW, it's not too hard to get a good measurement on any OS. The only issue would be figuring out how to extract from a .deb package, for instance.
<Yoric> Well, I was counting on an "apt-get install apache2 php5 postgresql" but that won't work if it's already installed.
<Smerdyakov> The total size of the files inside would probably provide a good upper bound.
<Yoric> Well, the only issue is dependencies.
<Yoric> s/only/main/
<Smerdyakov> Here's a suggestion: create a new Linode to measure this, then cancel it right away. :)
<Yoric> :)
<Camarade_Tux> 8.2MB on slackware for httpd and 22MB for php
<Yoric> Thanks
<Camarade_Tux> (and since slackware doesn't use split packages...)
<Smerdyakov> ...or create a new EC2 server. They're more oriented toward this rapid up-and-down approach.
<flux> 22M for php?!
<Camarade_Tux> vbox or qemu ;-)
<flux> that includes documentation or something?
<Camarade_Tux> yes ;-)
<Smerdyakov> Yoric, BTW, are you going to try to compare the footprint of OPA to some other footprint that includes Postgres? Does OPA implement a relational database interface?
<flux> as I understood OPA doesn't do relational db?
<flux> but some newfangled document-oriented db perhaps?
<Camarade_Tux> but actually: 7.7MB in usr/bin and 11MB in usr/lib
<Camarade_Tux> (for php)
<Camarade_Tux> so documentation isn't the reason it's so big
<flux> camarade_tux, well, I don't have php5 installed and when I do apt-get install php5 it wants to install some apache stuff and php and it is 7M in total..
<flux> (installed size, not downloaded)
<Yoric> Smerdyakov: not relational, no.
<Yoric> Smerdyakov: although we're probably going to include some relational libraries for people who need them.
<Smerdyakov> Yoric, then it doesn't seem like a very accurate comparison.
<Smerdyakov> Yoric, I can't think of a serious web application where accessing some data through the relational abstraction isn't clearly warranted.
<Yoric> Smerdyakov: well, I guess we're not working on the same kind of applications.
<Smerdyakov> Yoric, you don't work on applications where you want to, say, join three different kinds of records based on shared keys?
<Yoric> Smerdyakov: where I'm at, graphs are much more suited.
<Camarade_Tux> flux: I have a 4MB /usr/lib/httpd/php5/libphp5.so and two 3.9MB files: /usr/bin/php and /usr/bin/php-cgi
<Yoric> Smerdyakov: why join them when you can just dereference?
<Camarade_Tux> both bins are probably very similar and debian may only include one but it already reaches 8MB here
<Smerdyakov> Yoric, say because you have filtering conditions, ordering rules, etc., that draw on columns of all three tables.
<Yoric> Well, that's what fold, filter, etc. are for :)
<Smerdyakov> The code will be harder to write and maintain than with SQL.
<Smerdyakov> And the performance will probably be much worse, for the foreseeable future.
<Smerdyakov> I don't think you have the manpower/motivation to compete with the performance of Postgres.
<Yoric> Well, again, depends on the application.
<Yoric> Most web applications I see actually require an ORM.
<Smerdyakov> I'm going to postulate that this holds for any application that does a three-way join with a filtering condition that mentions all three tables.
<flux> smerdyakov, yet many indeed manage with ORMs without database queries.. maybe they don't know better, but perhaps it's manageable :)
<Smerdyakov> In what sense does a web application _require_ an ORM?
<Smerdyakov> I think it's just people choosing the wrong abstraction.
<Yoric> ORMs typically have very bad performance and bad track records in terms of maintability.
<Smerdyakov> For the same reason they think OO is great. :)
<Yoric> :)
<Smerdyakov> In Ur/Web, I program directly with SQL. It works really well for me.
<Yoric> Let me rephrase: most web applications I've seen use relational databases to store data which is inherently not relational.
<Smerdyakov> Yup. They're doing it wrong and missing out on benefits that OPA will miss out on, too.
<Yoric> Which *is* choosing the wrong abstraction.
<Smerdyakov> Namely, decoupling schema and implementation as data structures
<Yoric> Well, anyway, I have a paper to complete.
<Yoric> I remain convinced that using the same type system and data structures on disk and in memory is the right solution for most applications.
<flux> actually I have a module (at work) that sort of emulates one use-case of relational db's with functional indices
<flux> it was nice, adding new objects to the container and then retrieving the list of objects that were for connected devices without any iteration
<flux> but I suppose the model yoric might have some sort of functional indices as well
<Yoric> of course
<Yoric> (if I understand what you mean, that is)
<Yoric> Still, getting back to that paper.
<flux> :)
<Smerdyakov> Yoric, I agree with you, and I think the relational model is appropriate for both. :)
<Camarade_Tux> and 36MB/37MB for postgresql here (still slackware)
<Smerdyakov> 37 MB well spent :)
<Smerdyakov> IMO, a better comparison for OPA is SQLite.
<Camarade_Tux> 870KB here, but it's a bit hard to compare since many apps directly include sqlite's source
<Yoric> Smerdyakov: that's an interesting choice.
<Yoric> (I meant using relational model in memory)
<Smerdyakov> Ur/Web supports arbitrary function-free ML-style values in database columns.
<Yoric> If you pursue that idea, I'd be interested to see the results.
<Smerdyakov> Best of both worlds. :)
<Yoric> Not quite sure :)
<Smerdyakov> And, of course, it's the semantics of the language that matters to me the most, and there you don't need to draw any distinction between "memory" and "disk."
<Smerdyakov> Your DBMS's cache is essentially "the heap."
<Yoric> As for SQLite, let's just say that last time I checked, SQLite didn't have a distributed database, replication, maximal sharing, incremental backups, etc.
<Yoric> Smerdyakov: exactly. That's why we don't draw any distinction. A list is a list, no matter where it is.
<Yoric> Still, as mentioned, paper :)
det has quit [Read error: Connection reset by peer]
det has joined #ocaml
<flux> hmph, ocamlduce isn't what I want, as it doesn't let me write html like html
<Yoric> det: thanks
<Smerdyakov> flux, duuuuuude, Ur/Web!
<Yoric> flux: or, of course, Ocsigen or, even better, OPA :)
<flux> smerdyakov, well, this doesn't even touch the disk! http://masyn.org/chat/
<Smerdyakov> flux, who cares?
<det> flux, I've seen ./ commenters be kind to Ocaml in the past, maybe the MS angle is souring their view of F# ?
<Smerdyakov> The semantics of Ur/Web don't involve "disk," and I don't expect you'd find performance problems related to usage of disk.
<flux> I care, I want to implement some funky background processing :)
<flux> (sentences not related)
<Smerdyakov> flux, "funky background processing"?
<flux> (except in a sence that shared data doesn't need to be collected by me to a db in between iterations)
<flux> smerdyakov, it seems to be in Ur/Web if I want to implement a service in terms of a program that doesn't put itself into database between requests, I need to implement the service in some other language and then use Ur/Web to interface with it
<flux> smerdyakov, let's say I wanted to implement AjaxTerm. it keeps a pty open during its lifetime.
<flux> or how about other persistent connections to external resources?
<flux> say, to an IRC server
<flux> or can you put a connection to a database?
<Smerdyakov> flux, you can do all this with the FFI.
<flux> and I can do all this without FFI now :)
<Smerdyakov> And you do it in a language with a 1980's type system....
<flux> the ajaxterm I'm referring to is implemened in python and javascript, so arguably it can be done without any type system..
<Camarade_Tux> anyterm is better ;-)
<det> Python still has a type system :-)
derdon has joined #ocaml
<Smerdyakov> That doesn't mean the type system isn't very helpful.
<flux> det, it is not a type system in the sense type theory refers to a type system. in the type-theory sense there is only one type (the universal type), and in run time values are tagged to contain different kind of values.
ulfdoz_ has quit [Quit: Reconnecting]
ulfdoz has joined #ocaml
<flux> heh, I had written <foo "bar"="baz"> instead of <foo bar="baz">, understandably the language wasn't very understanding..
<flux> +extension
<Smerdyakov> flux, have you looked at the Ur/Web chat demo?
<flux> no
<flux> you need better google presence, ur/web chat demo didn't find it :)
bind_return has joined #ocaml
<Smerdyakov> I need to fix the links to the source code. It'll be a few minutes.
<flux> for some reason firebug doesn't work properly with that
<flux> but it works :)
<Smerdyakov> You're trying to reverse engineer it, instead of waiting for the source links to reappear? :)
<flux> well I wanted to get a rough idea how it works, and I'm guessing the ur/web source would tell that :)
<Smerdyakov> Yup, and Firebug won't help you get that source.
<flux> works as in how it uses javascript. for example, no polling.
<flux> in some sense atleast
<Smerdyakov> Well, of course there's no polling. :P
<Smerdyakov> Use some network monitoring tool for that.
boscop_ has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
boscop_ has joined #ocaml
<flux> smerdyakov, I got an alert("bla error querying 502(?) bla") from Ur/Web, not a good user experience :)
<Smerdyakov> *yawn*
<Smerdyakov> Obviously easy to fix compared to the inexpressiveness of OCaml.
<Smerdyakov> OK, source links are back.
boscop has quit [Ping timeout: 276 seconds]
Anarchos has joined #ocaml
Drk-Sd has joined #ocaml
Anarchos has quit [Ping timeout: 265 seconds]
<flux> soo, does anyone have an idea if tuareg-mode could be (easily ;)) changed to accommodate for <<quotations>>?
<flux> one desired feature could be to disable indentation between those tokens and not get confused about open parens inside them
<Smerdyakov> flux, did you see the chat source code?
<flux> I did a cursory glance
<Smerdyakov> Much cleaner than what you can do in OCaml without building your own new library of some kind, right?
Drk-Sd has quit [Quit: {'EXIT', Drk-Sd, "bye"}]
Modius has joined #ocaml
mfp has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 246 seconds]
mfp has joined #ocaml
ulfdoz has joined #ocaml
mjonsson has quit [Read error: Connection reset by peer]
mjonsson has joined #ocaml
Drk-Sd has joined #ocaml
suricator has joined #ocaml
<suricator> hi guys... anyone familiar with godi and godi-ocaml- xml-rpc?
<suricator> I am trying to run simple examples of xml-rpc calls in ocaml (with godi) but i'm having compilation problems. Any help would be really good...
<Camarade_Tux> suricator: which compilation problem? any precise error? and how do you try to compile?
<suricator> thanks camarade... i'll give more details... :)
<suricator> i have installed (1) godi and (2) godi-ocaml-xml-rpc package.
<suricator> i was trying to run an example which uses three files: "add.ml", "add_httpd_ml" and "add_test.ml".
<suricator> i compile it fine with the command: ocamlfind ocamlc -c add.mli add.ml add_httpd.ml add_test.ml -package xmlrpc
<suricator> this generates cmi and cmo files for all three files which is great.
<suricator> but then, when i try to produce a native executable with: ocamlfind ocamlc add.cmo add_httpd.cmo add_test.cmo -package "xmlrpc pxp" -linkpkg
<suricator> it complaints that
<suricator> File "_none_", line 1, characters 0-1:
<suricator> Error: Error on dynamically loaded library: dllnetsys.so: dlopen(dllnetsys.so, 138): image not found
<suricator> i am not very experienced with compilation with several files, i may be doing some trivial mistake
<suricator> any ideas?
<Camarade_Tux> oh, try with: -package xmlrpc,pxp
<Camarade_Tux> not "xmlrpc pxp"
<Camarade_Tux> or -package xmlrpc -package pxp
mutew has joined #ocaml
<suricator> same error
<suricator> :(
<suricator> i don't understand what's happening...
Submarine has joined #ocaml
<Camarade_Tux> you could try to add -verbose to the ocamlfind's call
<Camarade_Tux> and
TaXules has quit [Ping timeout: 256 seconds]
<suricator> i tried it... it gave me a huge list of all the libraries passed with the -I argument to the ocamlc command... but the error information is the same
thrasibule has joined #ocaml
suricator has quit [Quit: suricator]
TaXules has joined #ocaml
mfp has quit [Quit: Leaving]
mfp has joined #ocaml
suricator has joined #ocaml
Drk-Sd has quit [Quit: hmm]
mfp has quit [Quit: Leaving]
mfp has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
thrasibule has quit [Ping timeout: 260 seconds]
Associat0r has joined #ocaml
Drk-Sd has joined #ocaml
Narrenschiff has joined #ocaml
Snark has joined #ocaml
thrasibule has joined #ocaml
jeddhaberstro has joined #ocaml
suricator has quit [Quit: suricator]
suricator has joined #ocaml
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
Smerdyakov has joined #ocaml
avsm has joined #ocaml
<suricator> Hello... i have compiled an application using ocaml-xmlrpc and i'd like to run it. Does anyone know if ocaml-xmlrpc works with apache? Is apache a good solution?
tmaeda is now known as tmaedaZ
<Camarade_Tux> from what I've seen, it produces a cgi file which should work with apache, now I haven't really understood it all ;-)
<Smerdyakov> Can I recruit anyone here to help test a service I'm building for hosting web applications written in my (kinda-ML-like) Ur/Web language? See #ur and/or http://www.impredicative.com/wiki/index.php/Graftid if interested.
<suricator> tux: ok, thanks... i'll give it a go... still have to solve the compiling issues i mentioned before.
mutew has quit [Quit: leaving]
avsm has quit [Quit: Leaving.]
yakischloba has joined #ocaml
Smerdyakov has quit [Ping timeout: 252 seconds]
avsm has joined #ocaml
Smerdyakov has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 265 seconds]
yakischloba has quit [Quit: Leaving.]
td123 has joined #ocaml
td123 has left #ocaml []
avsm1 has quit [Quit: Leaving.]
Snark has quit [Quit: Ex-Chat]
Yoric has quit [Quit: Yoric]
jeddhaberstro has quit [Quit: jeddhaberstro]
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
Submarine has quit [Quit: Leaving]
Narrenschiff has quit [Quit: Narrenschiff]
derdon has quit [Quit: derdon]
valross has joined #ocaml
Yoric has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
thrasibule has quit [Ping timeout: 260 seconds]
EliasAmaral has quit [Ping timeout: 272 seconds]
EliasAmaral has joined #ocaml
Associat0r has quit [Quit: Associat0r]
Yoric has quit [Ping timeout: 248 seconds]
ulfdoz has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
suricator has quit [Quit: suricator]
ulfdoz has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
EliasAmaral is now known as dark|away
dark|away is now known as dark