From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 334407EE99 for ; Mon, 20 Jan 2014 10:12:45 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcCAGXn3FLU4xEMnGdsb2JhbABZugeCS4MEgQkWDgEBAQEBBg0JCRQogiUBAQEEOj8QCxgJJQ8FKCEuh1UBGL0fH4YOF44uAQFPB4MkgRQEmCGGMRKPBIFw X-IPAS-Result: ArcCAGXn3FLU4xEMnGdsb2JhbABZugeCS4MEgQkWDgEBAQEBBg0JCRQogiUBAQEEOj8QCxgJJQ8FKCEuh1UBGL0fH4YOF44uAQFPB4MkgRQEmCGGMRKPBIFw X-IronPort-AV: E=Sophos;i="4.95,689,1384297200"; d="scan'208";a="53968112" Received: from mout.web.de ([212.227.17.12]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 20 Jan 2014 10:12:44 +0100 Received: from frosties.localnet ([37.49.32.119]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Lb25F-1Vcfis42Nl-00kgvA for ; Mon, 20 Jan 2014 10:12:44 +0100 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1W5AuR-000737-3j; Mon, 20 Jan 2014 10:12:43 +0100 Date: Mon, 20 Jan 2014 10:12:43 +0100 From: Goswin von Brederlow To: Anders Peter Fugmann Cc: caml-list@inria.fr Message-ID: <20140120091242.GC26447@frosties> References: <20140113154808.GA21567@frosties> <20140116083541.GA27229@frosties> <52D84944.8090108@fugmann.net> <20140118113316.GA13285@frosties> <52DC086D.2080508@fugmann.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52DC086D.2080508@fugmann.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:CKQ2kqAlsJZpK8O8QF/Y8ISrfpwEKbDvG4yVXg7bIDTo/6SOBMD ngUtLv3S4ZgeIvm6CLGmF2nNRbDABDJ/1q9tsBDQHKJcZXH+oIzMsjgrUZD8d0MFxCu3gm1 KOXefVH2K1ZQFIZG4jqlNS1M1hanYfjs1bp84sPdglnYU6ITSFRY1DhPcBsC22FfBOFRo4u QtZMVtNR+6T809ECatXsQ== Subject: Re: [Caml-list] Who was working on ocaml bindings for zeromq? On Sun, Jan 19, 2014 at 06:16:29PM +0100, Anders Peter Fugmann wrote: > Hi Goswin, > > Please see my reply below. For completeness your original mail is > also included in full at the end of the mail. > > On 18/01/14 12:33, Goswin von Brederlow wrote: > >3) sockets have phantom types, use them > Agreed. > > >4) Polling is ugly > Indeed this could be made simpler. Yesterday I actually run into a problem with this. Creating a socket gave me a odd type (from memory): val stream: _[> `Push | `Pull | `Pub | `Sub | `Stream] ZMQ.Socket.t val dealer: _[> `Push | `Pull | `Pub | `Sub | `Dealer] ZMQ.Socket.t A few problems with that: 1) A stream socket should be just `Stream. 2) Note the _ there. The type is not polymorphic and gives an error that it can't be unified or something. Don't have the exact error in memory. I think there is something wrong with the way the socket types are specified that cause this. First time I ever got that kind of error. 3) Polling takes an ('a ZMQ.Socket.t, ZMQ.Socket.event) array. Trying to poll a stream and dealer socket causes type errors. I think phantom typed sockets are incompatible with putting them into an array outside the module. This needs an interface where you have a poller instance and can add sockets to it one at a time. Internally the phantom type is known to be "phantom" and the sockets can be put into an array, hashtbl or list. I didn't have time yet to look into those problems. Currently I used Obj.magic to make it work because I wanted to work on the application instead of on zmq. But that certainly isn't a solution. So in summary: We need a new polling interface (or phantom typing). Not just because I don't like it but because it doesn't work for combining different socket types. MfG Goswin