Re: Mechanism vs policy Alaric Snell-Pym 26 Sep 2019 08:45 UTC
On 25/09/2019 23:25, John Cowan wrote:

>> I'd like to have 100% text/binary equivalence and a rich set of data
>> types for the same reason. Just simple (read) and (write) with a choice
>> of text and binary, no need to be concerned with other options,
>
> I continue to think that not letting (read) limit the amount of input is
> Very Bad Indeed.  Not all programming languages are memory safe, far from
> it.  Not even all Scheme or CL implementations if you set the compiler
> options correctly.

I think that such limits are useful, but are implementation limits, but
not limits to the spec.

For instance, there's no reason why a user with a big enough storage
device can't have a string literal that's several terabytes long, if
they want to. The format spec should allow that; it should be a valid
instance of the format.

However, it's also perfectly valid for an implementation to say "Hey, I
can't read strings more than 256 bytes big and I flat out ignore floats
and I only have 4KiB of RAM to store anything, because I'm running on a
16-bit embedded controller".

> Here's my current idea.
>
> First of all, I want a more compact syntax for bytevectors.  My current
> notion is for them to match/\[([0-9A-Fa-f][0-9A-Fa-f][-])*\]/.  That is,
> hex digits with optional hyphens between each byte so you can group things
> as you like, and then wrapped in square brackets.  I'm not particular about
> the square brackets.
>
> After that, the content of each ASN.1 LER object is one of three things:
> bytes, characters, or sub-objects.  So let's write # followed by either a
> registered name or hex digits that represent the type code, followed by one
> of a string, a bytevector, or a list.  So a vector would be #vec(1 2 3) or
> #20(1 2 3), a duration would be #dur"1Y2M35D" or #1F22"1Y2M35D", and float
> 0.0 would be #float[0000-0000-0000-0000] or #DBt[0000-0000-0000-0000],
> although a decimal float would be more interoperable.  I have some
> registered names in the new column B of <http://tinyurl.com/asn1-ler>, but
> this would allow private-use typecodes, which don't have registered names,
> to be encoded as text.

Allowing numeric type codes in the text format? *wince* is that a useful
feature?

ABS

--
Alaric Snell-Pym   (M7KIT)
http://www.snell-pym.org.uk/alaric/