flux__ changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
er has joined #ocaml
<er> (reposting a previous question)
<er> is there a way to do IPC in OCaml?
<mikeX> a bit of a silly question, but would this be considered bad style/confusing: http://pastebin.com/740417
shawn_ has joined #ocaml
saf02oitgawsg-2 has joined #ocaml
saf02oitgawsg-3- has joined #ocaml
saf02oitgawsg-3- has quit [Excess Flood]
er has quit []
saf02oitgawsg-2 has quit [Client Quit]
saf02oitgawsg02 has joined #ocaml
saf02oitgawsg02 has quit [Remote closed the connection]
CosmicRay has joined #ocaml
khaladan has quit [" HydraIRC -> http://www.hydrairc.com <- Leading Edge IRC"]
er has joined #ocaml
er has quit []
er has joined #ocaml
chessguy has joined #ocaml
mikeX has quit ["zz"]
CosmicRay has quit ["Client exiting"]
chessguy has quit [" Try HydraIRC -> http://www.hydrairc.com <-"]
er has quit []
er has joined #ocaml
cyyoung has quit ["Leaving"]
jcreigh has joined #ocaml
jcreigh has quit [Read error: 110 (Connection timed out)]
er has quit []
shawn_ is now known as shawn
Smerdyakov has quit ["Leaving"]
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
piggybox has left #ocaml []
<flux__> now, one can write:
<flux__> class a = object method foo = () end class b = object inherit a method bar = () end let foo (a : a) = () let bar (a : < foo : unit; .. >) = ()
<flux__> and make a call like foo (new a)
<flux__> foo (new b) will fail
<flux__> bar (new a) and bar (new b) both succeed
<flux__> is there a way to write a function that takes 'all of a plus ..'?
Submarine has joined #ocaml
<flux__> without spelling out all the methods
Sir_Diddymus has joined #ocaml
<pango> foo (new b :> a) works
<flux__> well, yes
<flux__> but my point was to make that trick to the function definition
<flux__> if one is not going to make an alias (let a' = (a :> a)), which can be confusing to the reader, calling function always with foo (z :> a) .. seems a bit taxing and redundant :)
<flux__> and the type system itself appears to allow functions that can take objects with more methods than required
<flux__> it is just that for some reason that isn't the default
<flux__> performance reasons maybe?
__DL__ has joined #ocaml
<flux__> actually I was hoping for some syntax like let z (a : < #a; .. >) = () but that doesn't work :)
<pango> let z (a : < foo: _; .. >) = ()
<flux__> hey, that's nice
<flux__> now I need to iterate only the methods I use which is much less of a bother :)
<flux__> thanks!
<flux__> and for the .mli I can still use the interface generator of ocamlc
_jol_ has joined #ocaml
Tachyon76 has joined #ocaml
smimou has joined #ocaml
_jol_ has quit ["leaving"]
__DL__ has quit [Remote closed the connection]
<ski> flux__ : 'let foo (a : #a) = ()' ?
<ski> you want to enforce that the methods in 'a' is present (with right types), but don't disallow there being more methods present (and visible, instead of explicitely hidden with ':> a' in each call) ?
Submarine has quit ["Leaving"]
Submarine has joined #ocaml
Narrenschiff has joined #ocaml
pango is now known as pangoafk
pangoafk is now known as pango
bluestorm has joined #ocaml
_jol_ has joined #ocaml
_jol_ has quit ["leaving"]
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Submarine has quit [Killed by Idoru. (Sorry, tor connections to freenode are temporarily blocked due to abuse.)]
descender has quit ["Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good e]
dbueno has joined #ocaml
<dbueno> I have a file Foo.mli for which I'd like to write multiple implementations. If I wrote Foo1.ml, is there something I can put in it to make ocamlc know that it should conform to the Foo.mli module type?
er has joined #ocaml
<dylan> well, if you used a functor...
<dbueno> dylan: without creating a nested module... (I'm coming from SML/NJ-land)
zagzig has joined #ocaml
er has quit []
Submarine has joined #ocaml
mikeX has joined #ocaml
er has joined #ocaml
er has quit []
<pango> a symlink :)
<pango> I was thinking of using "include", but don't see how to make it work with 'separate compilation modules'
<pango> dbueno: maybe like this: define your common module signature somewhere, say in signature.ml:
<pango> module type FooSig = sig ... end
<pango> then in foo.mli and foo1.mli, just put 'include Signature.FooSig'
Smerdyakov has joined #ocaml
er has joined #ocaml
er has quit [Client Quit]
Schmurtz has joined #ocaml
er has joined #ocaml
<Smerdyakov> Anyone submitting to the ML workshop this year?
<dbueno> pango: I wasn't aware of include; thanks.
descender has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
mattam has joined #ocaml
bluestorm has quit [Read error: 113 (No route to host)]
bluestorm has joined #ocaml
_jol_ has joined #ocaml
Revision17 has joined #ocaml
pango is now known as pangoafk
mikeX has quit ["later"]
pangoafk is now known as pango
dbueno has quit ["Leaving"]
Sir_Diddymus has quit [Read error: 110 (Connection timed out)]
er has quit []
er has joined #ocaml
bluestorm has quit [Remote closed the connection]
Revision17 has quit [Read error: 104 (Connection reset by peer)]
finelemon has joined #ocaml
Schmurtz has quit ["Plouf !"]
Revision17 has joined #ocaml
_jol_ has quit ["co'o"]
finelemo1 has quit [Read error: 110 (Connection timed out)]
finelemo1 has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
bluestorm has joined #ocaml
mikeX has joined #ocaml
<flux__> ski, thanks, that's exactly what I was looking for, but the syntax was something I missed
<ski> np
er has quit []
cyyoung has joined #ocaml
cyyoung has quit ["Leaving"]
cyyoung has joined #ocaml
Narrenschiff has quit [Read error: 104 (Connection reset by peer)]
er has joined #ocaml
cyyoung has quit ["Leaving"]
zagzig has left #ocaml []
<er> is there a way to communicate b/w processes in ocaml?
<er> eg. by defining a memory region that's shared between processes?
<Submarine> not directly
<Submarine> you can use threads, though
<smimou> but it will be useless on an SMP...
<Submarine> yes
<er> there's a REALLY nice function in the Unix library called "establish_server"
<er> which lets you implement a concurrent TCP server in 3 lines of code
<er> but the problem is that there's no way of sharing state across connections
<dylan> I find using a postgres database a nice way around that.
<dylan> Not a very... efficient way, but, ahem...
<er> hm. hold on, what would happen if the connection-handling function were to be a closure with a ref argument...
<dylan> nothing, processes live in different address spaces.
<er> right
<er> *grumble*
<er> and there's no mmap in the Unix library
<dylan> use a database for shared state? :)
<flux__> you could have a process that marshals messages in and out..
<flux__> but it will not be trivial
<pango> there's a mmap module in the cdk
<er> flux__: that's my ad-hoc solution
<Submarine> well... mmap is difficult to use with caml
<Submarine> the parallel version of Astrée is a bit dodgy
<flux__> establish_connection, as it is, is not very easy to use for real servers
<er> pango: thanks for the info. *looking*
<flux__> maybe if there was an easy-to-use message passing primitive that would work between processes, something like the Event-module
<Submarine> marshalling...
<flux__> well, writing a process that uses non-blocking in_channel/out_channel and marshalling can be a challenge..
<er> flux__: it's not a "real" server that has to do anything fancy
<er> it just provides an interface to non-caml applications
<er> and there's no reason to force those applications to be on the same machine, so TCP was a natural option
shawn has quit ["This computer has gone to sleep"]
ski has quit [Nick collision from services.]
ski has joined #ocaml
<er> interesting. the cdk installer insists on compiling ocaml from scratch
<pango> cdk hasn't been updated in ages, I wouldn't trust it too much ;)
Tachyon76 has quit ["Leaving"]
<er> pango: i'm trying to use the mmap files individually
<er> hm anyone know where gc.h can be found?
Bigb[a]ng is now known as Bigbang
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
<pango> friends slot seems to work...
<pango> oups -ECHAN
<ulfdoz> however, we congratulate. :)
mikeX has quit ["leaving"]
jcreigh has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
dark_light has joined #ocaml
<er> pango: got mmap to compile
<er> and run
<er> it works for caml-defined data types like arrays and lists
<er> but not for objects
WhatTheDeuce has joined #ocaml
jcreigh has quit ["Do androids dream of electric sheep?"]
Bigbang is now known as Bigb[a]ng
smimou has quit ["bli"]
mikeX has joined #ocaml
shawn has joined #ocaml
<pango> er: probably because it's not possible
<er> ok
WhatTheDeuce has left #ocaml []
<pango> I support objects contain some reference to method arrays, that have little chance to be at the same address in all processes
<pango> (to mention something that comes immediately to mind; there's probably more to go)
<er> pango: ok, didn't realize.
<er> on another note, how does one obtain an in/out channel from a file descriptor?
<pango> Unix.{in,out}_channel_of_descr ?
<er> ok, I must have missed that one.
<er> thanks a ton, for both pieces of info
<pango> np
<er> i think it was quite silly of me to go the mmap route, but learnt a few things in the process