From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id D6B605D5 for ; Thu, 25 Jul 2019 10:28:46 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.64,306,1559512800"; d="scan'208";a="393266999" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 25 Jul 2019 12:28:45 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id D518B82713; Thu, 25 Jul 2019 12:28:45 +0200 (CEST) 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 9108B826CE for ; Thu, 25 Jul 2019 12:27:47 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jocelyn.serot@uca.fr; spf=Pass smtp.mailfrom=jocelyn.serot@uca.fr; spf=None smtp.helo=postmaster@mta02.udamail.fr IronPort-PHdr: =?us-ascii?q?9a23=3AwxZeJhxDmYbpB1/XCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?1O0TIJqq85mqBkHD//Il1AaPAdyBraIewLCL+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1?= =?us-ascii?q?Ov71GonPhMiryuy+4ZLebxhWiDanYr5+Mhq6oRvRu8ILnYZsN6E9xwfTrHBVYe?= =?us-ascii?q?pW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH0169bwtRbf?= =?us-ascii?q?VwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXzmp8qFmQwLqhi?= =?us-ascii?q?gaLT406GHZhdB/gqxGrhyhqQJxzY3bb4+SL/d+YrrdfdYGSWpBQspcVypMCZ68?= =?us-ascii?q?YYsVCOoBOP5VoY36p1QSsxS+AQmtBOX3xTFVnHj2x6o60/g8GgzB3gwgGM4Bv2?= =?us-ascii?q?rQrNT1MqceS/u1w7fSzTXEc/Nbwir955TSfRw7r/GMR6t9fMzMwkchEAPFi0+f?= =?us-ascii?q?qY3jPz6N2eQNsnSb7+p9Ve20kWIotwZxoj2py8wxiYfJnpoYxk3A+Ch32oo4Kt?= =?us-ascii?q?m1RFRmbdK5EpZcrT+WO5ZuTs4hQGxkojs2x7wJtJKheCUG1o4rywDfZvCbdYWD?= =?us-ascii?q?/wjtW/yLIThigXJoYLK/iAi28Uin0uD8U9W030xWoiZbiNXMq20C2AbW6sedS/?= =?us-ascii?q?t9+l2t2TiV1wzL6+FEJ147lbbDJpI8xrM9mIAfvEvHEyPshUn6ka2bel869uS1?= =?us-ascii?q?8+jnZ6/ppp6YN496kAH+NaEul9S9AeQ/LgcBQWyb+OS61LH55k32Xq9Kjvoqkq?= =?us-ascii?q?TCrZDVOd4UqrS3Aw9Pyooj8QqwDy+60NQEmnkKNE5KdwiCj4jtIl3OJPH4Deyj?= =?us-ascii?q?g1m3izdqx/XGPqX7DZnXL3jDlq3hfbdn5EJGxgoz14MX25UBAbgEJLruQULrr5?= =?us-ascii?q?SMBRY8N0mwwv37INR7zIIXH2yVVPy3KqTX5H2P7e8rMu+7Xw4Pvyq1f/oi7PPq?= =?us-ascii?q?nHl/glIHerWBwJAeLn6iSKc1a36FaGbh149SWVwBuRAzGbSz1A+yFAVLbnP3ZJ?= =?us-ascii?q?oSoykhAdL0EIzKAI630uTYgXWLW6ZOb2UDMWiiVHflc4LdC6UJdCvKeIl8njUB?= =?us-ascii?q?XLmlDYE7h0n35V3KjoF/J++RwRU28Jfq1dx7/erWxUMv/jUyAd7Pimw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DNCQBvgzldhxV1McFmHQEBBQEHBQGBZ?= =?us-ascii?q?4MEA1ABMCqNGYgYgg+DZJcXCQEDAQwjDAEBhECCXhsHAQQ0EwEDAQEEAQECAQM?= =?us-ascii?q?DARMBAQEKCwkIKYUlDII6IoJuAQECAgFAAQE4BAsLGC5XBhODIgGBexMBCqxWg?= =?us-ascii?q?iOCegEBBYJHhGwDBoE0i2CCFoERJx+CTD6CSBkCAoFfgz2CJqpwBwKBMmqGWYh?= =?us-ascii?q?sBYRhjTeKVIxZiCmNAIMzgS84gXl0TCoBgkE+ggQMDgkUgzqBPokXPgExjkoBA?= =?us-ascii?q?Q?= X-IPAS-Result: =?us-ascii?q?A0DNCQBvgzldhxV1McFmHQEBBQEHBQGBZ4MEA1ABMCqNGYg?= =?us-ascii?q?Ygg+DZJcXCQEDAQwjDAEBhECCXhsHAQQ0EwEDAQEEAQECAQMDARMBAQEKCwkIK?= =?us-ascii?q?YUlDII6IoJuAQECAgFAAQE4BAsLGC5XBhODIgGBexMBCqxWgiOCegEBBYJHhGw?= =?us-ascii?q?DBoE0i2CCFoERJx+CTD6CSBkCAoFfgz2CJqpwBwKBMmqGWYhsBYRhjTeKVIxZi?= =?us-ascii?q?CmNAIMzgS84gXl0TCoBgkE+ggQMDgkUgzqBPokXPgExjkoBAQ?= X-IronPort-AV: E=Sophos;i="5.64,306,1559512800"; d="scan'208";a="393266916" X-MGA-submission: =?us-ascii?q?MDEsypUM8SMRR4iQGFwoODbO7US+1a6WlclBJ5?= =?us-ascii?q?YiMuUt+WInQO10Dqe27ubH8NyA4WgqB14rlH0fQ/1WrJI3t0P/xsah/s?= =?us-ascii?q?NQAh7B3+7zNK24m1pnmLvbh8llexUyl5EbRzsaDUBRz43CnTuaVk4EmZ?= =?us-ascii?q?GtQiFymRH9kxdzrvpFOcITAQ=3D=3D?= Received: from mta02.udamail.fr ([193.49.117.21]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 12:27:46 +0200 Received: from mta02.udamail.fr (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTPS id 45vT1Z3pBbzBsDN for ; Thu, 25 Jul 2019 12:27:46 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta02.udamail.fr (Postfix) with ESMTP id 45vT1Z38vhzBs1x for ; Thu, 25 Jul 2019 12:27:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mta02.udamail.fr 45vT1Z38vhzBs1x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uca.fr; s=72FD7F0C-5358-11E8-A3B7-17E0B3BFED1B; t=1564050466; bh=OaIIZ0P7O3k8wmo04DpMD+mtLepJ06e8aCLeXCJJUQA=; h=From:Date:To:Message-Id:Mime-Version; b=A+Dgbv1X6C6OBVJWW9aeg8BNOm2xaBOaUETDtiLaFrjn68+1LGIGldXyG4UjXprst 1+fltUTstO4nY34y1cOu91uMbxus4qDyqUACu/1rwVNwRiBec0KmKGglR7R5U9tUh2 CKCzkBsmD/uKwfJk78Z7bS6Ne8LMJANtZsFjhT4I= X-Virus-Scanned: amavisd-new at mta02.udamail.fr Received: from mta02.udamail.fr ([127.0.0.1]) by localhost (mta02.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id cTqlsam1N2Po for ; Thu, 25 Jul 2019 12:27:46 +0200 (CEST) Received: from proxy01.udamail.fr (unknown [193.49.117.26]) by mta02.udamail.fr (Postfix) with ESMTPS id 45vT1Z2bJ7zBs1k for ; Thu, 25 Jul 2019 12:27:46 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id 45vT1Z1rrdzBnBw for ; Thu, 25 Jul 2019 12:27:46 +0200 (CEST) Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id BYcOI_krGjTh for ; Thu, 25 Jul 2019 12:27:45 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy01.udamail.fr (Postfix) with ESMTP id 45vT1Y2YnYzBnCt for ; Thu, 25 Jul 2019 12:27:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 proxy01.udamail.fr 45vT1Y2YnYzBnCt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uca.fr; s=72FD7F0C-5358-11E8-A3B7-17E0B3BFED1B; t=1564050465; bh=OaIIZ0P7O3k8wmo04DpMD+mtLepJ06e8aCLeXCJJUQA=; h=From:Date:To:Message-Id:Mime-Version; b=Aw46gYNZ+vLSQ6JAFFX19bJeqV+hHgysrBXpHd91jMe9daX1Is6JMNZRQ+9RGhl8l nfq6is+Ck5GB28ZX7d6dr3IRM9qaGF0Vz/eIduqozmMeLOcTV4bClvuBnToKopgY1X DGgXlGMSJo8rtTTkM+fKg8X3uz4Jq8TY2A4Ess5I= X-Virus-Scanned: amavisd-new at proxy01.udamail.fr Received: from proxy01.udamail.fr ([127.0.0.1]) by localhost (proxy01.udamail.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OT8vUS_sRcSm for ; Thu, 25 Jul 2019 12:27:45 +0200 (CEST) Received: from [192.168.0.38] (lav63-2-88-164-92-250.fbx.proxad.net [88.164.92.250]) by proxy01.udamail.fr (Postfix) with ESMTPSA id 45vT1X73GJzBnBw for ; Thu, 25 Jul 2019 12:27:44 +0200 (CEST) From: =?windows-1252?Q?Jocelyn_S=E9rot?= Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: Thu, 25 Jul 2019 12:27:40 +0200 References: To: caml users Message-Id: <6300BCD6-A188-46E1-BA13-D9ACBE80FD49@uca.fr> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Validation-by: jocelyn.serot@uca.fr Subject: Re: [Caml-list] Camlp4-free implementation of stream parsers (was camlp4 & OCaml 4.08) Reply-To: =?windows-1252?Q?Jocelyn_S=E9rot?= X-Loop: caml-list@inria.fr X-Sequence: 17705 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: HI Daniil, Thanks for the example. It clearly shows how to embed a Menhir-specified = parser into an existing program. I still think, however that using Menhir for parsing arithmetic = expressions is a bit overkill. I=92m having a look at Angstrom (and all the other parser combinator = libs cited on the corresp. page). It seems simpler.=20 Jocelyn Le 24 juil. 2019 =E0 17:31, Daniil Baturin a =E9crit = : > Hi Jocelyn, >=20 > I've completed the first version of my project, so now I can start > looking into this again! >=20 > There's a third option: parser combinators like angstrom. > My experience with Menhir is very positive though. After initial > struggle, I came to like its new incremental API and declarative error > reporting. >=20 > Here's my parser for an extended BNF: > Menhir grammar: > https://github.com/dmbaturin/bnfgen/blob/master/src/bnf_parser.mly > Parser driver that feeds it tokens: > https://github.com/dmbaturin/bnfgen/blob/master/src/parse_bnf.ml > Error messages: > = https://github.com/dmbaturin/bnfgen/blob/master/src/bnf_parser.messages > Error message module build: > https://github.com/dmbaturin/bnfgen/blob/master/src/dune#L6-L8 >=20 > On 7/24/19 10:10 PM, Jocelyn S=E9rot wrote: >> Hi Daniil (and everyone interested by the subject), >>=20 >> Did you have a closer look at this ?=20 >>=20 >> I=92m still hesitating between these three approaches for replacing = the implementation of the small arithm expression parser used in Lascar = [1] : >>=20 >> i. rewrite it using the basic fns provided by the Stream library = (pro: no additionnal dependency, cons: not so trivial..) >>=20 >> ii. replace camlp4 by camlp5 (pro: straightforward, cons: long term = maintainability of camlp5 (?))=20 >>=20 >> iii. rewrite it using ocamlex/menhir and embed it in the main code = (pro: =AB standard =BB soon; cons: a bit heavy) >>=20 >> Jocelyn >>=20 >> [1] https://github.com/jserot/lascar/blob/master/src/lib/fsm_expr.ml, = lines 70=96112 >>=20 >> Le 2 juil. 2019 =E0 11:25, Daniil Baturin a = =E9crit : >>=20 >>> Hi Jocelyn, >>> Camlp5 is still sort of maintained, but I don't think it's going to = be >>> developed beyond compatibility updates. >>> For syntax extensions, everyone is switching to PPX. >>>=20 >>> =46rom a quick look, it seems like the only bit of camlp4 you use is >>> stream expressions. >>> This is one of the things PPX can't do (on purpose, since it doesn't >>> allow _arbitrary_ extensions), >>> but I don't think just using streams directly is going to make code = much >>> longer. >>>=20 >>> Or I missed some other camlp4 bits? >>>=20 >>> I'm ready to work on a patch if you are open to it. >>>=20 >>> On 7/2/19 1:44 PM, Jocelyn S=E9rot wrote: >>>> Le 29 juin 2019 =E0 17:15, Daniil Baturin a = =E9crit : >>>>=20 >>>>> Perhaps we should make some coordinated effort to help them. >>>>> I've just sent a pull request to the ocamldot maintainer that = enables >>>>> the graphviz files parsing and printing modules >>>>> to build and work with 4.08. The GTK parts have their own issues. >>>>> Next I'm going to look into LASCAR/RFSM (packages that interest me = first ;). >>>>>=20 >>>> Hi Daniil, >>>>=20 >>>> I=92ve been been thinking of removing the dependency of Lascar and = RFSM on camlp4 for a while. >>>> Is switching to CamlP5 a good alternative ?=20 >>>>=20 >>>> Jocelyn >>>>=20 >>>>=20 >>>=20 >=20 >=20