Re: [Cbor] CDDL Codegen in production

Carsten Bormann <cabo@tzi.org> Fri, 04 September 2020 09:05 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3E5B43A0D9B for <cbor@ietfa.amsl.com>; Fri, 4 Sep 2020 02:05:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x3pgrXOXag8w for <cbor@ietfa.amsl.com>; Fri, 4 Sep 2020 02:05:14 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F14743A0BCA for <cbor@ietf.org>; Fri, 4 Sep 2020 02:05:13 -0700 (PDT)
Received: from [192.168.217.102] (p5089ae91.dip0.t-ipconnect.de [80.137.174.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4BjWwS0w9Xz102v; Fri, 4 Sep 2020 11:05:12 +0200 (CEST)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAFhANbEhUFV23t_MCEO372NcpfAeeSLZREE8f0BtY7DBhjCP_Q@mail.gmail.com>
Date: Fri, 4 Sep 2020 11:05:11 +0200
Cc: cbor@ietf.org, Nicolas Arqueros <nicolas@emurgo.io>, rob@emurgo.io
X-Mao-Original-Outgoing-Id: 620903111.6868531-ba346e702bbeb2348c2858eca83d5c81
Content-Transfer-Encoding: quoted-printable
Message-Id: <799522E6-EB4D-4A3F-80B8-4477ECE623C1@tzi.org>
References: <CAFhANbEhUFV23t_MCEO372NcpfAeeSLZREE8f0BtY7DBhjCP_Q@mail.gmail.com>
To: Sebastien Guillemot <sebastien@emurgo.io>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/ljEzUPfPsfRx9yLXIMXYb4edk8o>
Subject: Re: [Cbor] CDDL Codegen in production
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 04 Sep 2020 09:05:17 -0000

Hi Sebastien,

this is very encouraging news!

Yes, I’m very curious.  We are seeing a lot of pickup of CBOR in the Fintech space, and it is nice to see that CDDL is being embraced, too.

I see that you have open-sourced the code generator at https://github.com/Emurgo/cddl-codegen (with MIT License).
I’m impressed to see that you achieved all that in ~2700 lines of code.

> There are still rough edges to our codegen library because some features of CDDL don't work well with codegen (hopefully CDDL can improve this going forward!), 

We are certainly interested in hearing what CDDL features are troublesome to implement in a code generator.  The github repo lists a number of features that are not implemented, but doesn’t say whether you just didn’t need them or they are simply too much work.

Some of these features could be addressed by CDDL-to-CDDL preprocessors.
E.g., maybe one of the functions I could add to the cddlc tool is a Generics resolver, as well as a topological rule sorter (which might then also do the necessary work for sockets).

Grüße, Carsten