Re: [Anima] GRASP API in C?

Brian E Carpenter <brian.e.carpenter@gmail.com> Sat, 25 March 2017 13:26 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: anima@ietfa.amsl.com
Delivered-To: anima@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C65E512944F for <anima@ietfa.amsl.com>; Sat, 25 Mar 2017 06:26:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 sZGRHPPi9utM for <anima@ietfa.amsl.com>; Sat, 25 Mar 2017 06:26:03 -0700 (PDT)
Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 33EC9129447 for <anima@ietf.org>; Sat, 25 Mar 2017 06:26:03 -0700 (PDT)
Received: by mail-it0-x22f.google.com with SMTP id y18so14399872itc.1 for <anima@ietf.org>; Sat, 25 Mar 2017 06:26:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=5yiCuOI2vbaAHqY5EwAVDGhAuo7jfKokNXj3nn9X4Eg=; b=J5VfUAHR6c3QlnYs/rtroW3LW5+GH0CO17oa3es64c/jKODXjPdCipglSR+Vaze1uo 9MN266SKAnMUCTng1oL2QbeHoMvGSsNjlFkoiSwvX4NKmxoEbTlBRjnkaMlUCpjZemam y0icvzIrjMqBI7obfWrT+rN7j1z8+w3FSoukQshA8SJ3NotutVanF0UuqvqYhlZgmxx5 kibtDAm7Re5kx0KztJaIYJVMYNIjxpv511ftEkmDpCukcfWaYNb3+61RiK0ffY/hY/nq 7Vw1+QOhzoSYKFCgEQRY+jcfHwYGxAYAOicLz2M/Gvyz5XeL2fJHFHcIQP4/aUTrUmMI MRFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=5yiCuOI2vbaAHqY5EwAVDGhAuo7jfKokNXj3nn9X4Eg=; b=q0xVL5lxYPHMT6fSbLp+v+uT/igmAI8KAKcf38zfPFPfDxv1o7iy5+sH7YYBbpGpNu Xp4kSYQ9FmgR6GnDjXbmvHGAak2escJSE1JhhoPvuYglz7PGMEN86VHy6YiQ6s9oKSel 5i1kF5rvD6zmLCWZN4bRB5LD5buaKH5Rn79KpLzT9jiXH+tVdtZSV5Z6R1qCmZmsy7cS hNyswRYlELKLBichG+pONJ3hAMl+RZQKQonyb1jK+wrhsxudfVVM78T8oW31FQLVu/5j SYLAUlSRxvPws4JnA8RVOWQPw5ZxQjz4YoC4ofAGhzq1X5yoJxUAd815EtynCHdkcURY xj9Q==
X-Gm-Message-State: AFeK/H2EeGRTWJHpOrnsm3U92eXI8ktUiAxgU/+PtRDlO4Zclkz9GSrCQzm4Q6zOE0CMKw==
X-Received: by 10.36.215.129 with SMTP id y123mr1913206itg.17.1490448362468; Sat, 25 Mar 2017 06:26:02 -0700 (PDT)
Received: from [172.16.11.95] (50-76-68-137-static.hfc.comcastbusiness.net. [50.76.68.137]) by smtp.gmail.com with ESMTPSA id m77sm2460634ita.16.2017.03.25.06.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Mar 2017 06:26:01 -0700 (PDT)
To: Michael Richardson <mcr+ietf@sandelman.ca>
References: <83c2beba-2ad5-eb1d-b188-fe2d9e688391@gmail.com> <9809.1490283823@obiwan.sandelman.ca> <76345f98-758c-49a1-f1cd-9bb50c3c757e@gmail.com> <18940.1490381204@obiwan.sandelman.ca> <298db127-0970-68ee-dda6-0a9c0c625041@gmail.com> <8914.1490395600@obiwan.sandelman.ca>
Cc: Anima WG <anima@ietf.org>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <c6b37895-beea-ea25-0c8a-b9afd92d3ce7@gmail.com>
Date: Sun, 26 Mar 2017 02:25:59 +1300
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <8914.1490395600@obiwan.sandelman.ca>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/aHbdRo9HFZj9BGxjLC-k5e1vSm0>
Subject: Re: [Anima] GRASP API in C?
X-BeenThere: anima@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Autonomic Networking Integrated Model and Approach <anima.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima>, <mailto:anima-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima/>
List-Post: <mailto:anima@ietf.org>
List-Help: <mailto:anima-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima>, <mailto:anima-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 25 Mar 2017 13:26:05 -0000

On 25/03/2017 11:46, Michael Richardson wrote:
> 
> Brian E Carpenter <brian.e.carpenter@gmail.com> wrote:
>     > It doesn't deal well with flexible types either, a dangerous luxury in
>     > Python that I've got very fond of. But it seems to me that if a GRASP
>     > core implementation is written in C for efficiency, it will *need* to
>     > offer an API in C that higher level languages can build on.
> 
> No, because it will be monolithic: not part of a library, no sockets API, etc.

It can't be monolithic in a general-purpose device with a variety of ASAs
sharing a discovery cache, flood cache, etc. Well, I'll show you my code
later today if you like. (I will get to the hackathon at a time that depends
on service on the Red Line train...).

>     > BTW, my not-production-quality Python version of the GRASP core is now
>     > about 1800 lines of code, but if we take out the stuff for diagnostics
>     > and debugging there's maybe 1000 lines. I hope we'll find out in the
>     > hackathon how big the BUPT code is; so far they don't support an API,
>     > so they are on your model.
> 
> My understanding is that uPython is getting significant traction in some
> constrained environments: someone may want to rewrite your code to this
> very limited subset (less than python 2, I'm told).  I think that this is
> more likely to be a "library" than any C code.

I know nothing about uPython. I did look at downgrading my code to Python 2
but quickly gave up because, well, Python 3 is better. So it all depends
on what they've kept and what they've removed in uPython.

  Brian