Subject: [dtn] AMP comment on type hierarchy and operators

From: Brian Sipos <[email-masked]>
Date: Mon, 4 Apr 2016 20:59:05 +0000

This is a comment against "draft-birrane-dtn-amp-02".

It may be helpful to put the AMP basic/compound data types into a true hierarchy. One reason for this is to distinguish the "Numeric" types from non-numeric. A secondary reason would be to allow defining an "Any" root type for the basic/compound types.

This would then allow for specifying an ADM literal/operator which takes the "Any" base type as argument/return to perform the same behavior as the multitude of "User VAST", "User Float", ... literals of draft-birrane-dtn-adm-agent-01. It would also allow the numerical operators of the same draft to take "Number" abstract type as argument/return. As currently defined, the "adm-agent-01" operators are not actually able to be defined in AMP because they do not have operand types specified (unless I am somehow misreading the AMP spec on MID encoding).

I don't see this as a huge issue, but it would simplify ADMs by allowing literals and operators defined with an abstract type to be given a derived type at runtime and satisfy all of the (other) protocol constraints on types.

---

From: "Birrane, Edward J." <[email-masked]>
Date: Wed, 6 Apr 2016 16:27:24 +0000

I agree that we need a way to classify types, and what types are used where. Since types appear in many places in AMP, I am worried about expanding the definition of the basic types beyond a BYTE.

Currently the concept for OPS is that they up-cast their operands based on the types of the operands, which is what the current reference implementation does.  For example, for the + op, float32 + int generates a float32. operands for which there is no defined type conversion results in an expression error (e.g., 4 + "three").

The next version of the AMP spec needs to list these allowed conversions.

It would be good to brainstorm on what derived types in ADMs would look like. Do you have an example of a derived type you would like to see in one of the ADMs you are working on?

-Ed

---
Edward J. Birrane, III, Ph.D.
Embedded Applications Group Supervisor
Space Exploration Sector
Johns Hopkins Applied Physics Laboratory
(W) 443-778-7423 / (F) 443-228-3839
________________________________
From: dtn <[email-masked]> on behalf of Brian Sipos <[email-masked]>
Sent: Monday, April 4, 2016 4:59 PM
To: [email-masked]
Subject: [dtn] AMP comment on type hierarchy and operators