poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JSON Representation


From: Jose E. Marchesi
Subject: Re: JSON Representation
Date: Tue, 05 May 2020 23:56:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

[People: Konstantinos is a student participating in this year's GSOC,
 and I will be mentoring him in the project/task of adding a fucking
 AWESOME machine-interface to poke.  Just wait and see :)]

Hi Konstantinos.

Great start :)
Please find some comments below.

    libpoke/pvm-val.json :
    
    {
        "$schema": "http://json-schema.org/draft-06/schema#";,
        "$id": "",
        "title" : "PVMValuesRepresentation",
        "description" : "JSON Representation for PVM values",
        
Please call them "Poke Values".  The PVM is an implementation detail of
libpoke/poke and should not make its way to the JSON/interface level.
We will be talking about "Poke values", "Poke types" and the like.

        "definitions" : {
            "Integral": {

I would call it "Integer".
We need two: "Integer" and "UnsignedInteger".
Does JSON support the notion of signed and unsigned integers?
Also, does JSON support the notion of integer types with different valid
ranges?

                "type": "object",
                "properties": {
                    "value": {
                        "type": "integer"

This should be a signed integer for Integer, and an unsigned integer for
UnsignedInteger.

                    },
                    "size": {
                        "type": "integer"

This should be a 32-bit unsigned integer.  (Note, _not_ a Poke integer.)

                    }
                },
                "required": [
                    "size",
                    "value"
                ],
                "title": "Integral"
            },
            "Null": {
                "type": "object",
                "properties": {
                    "nullValue": {
                        "type": "null"
                    }
                },
                "required": [
                    "nullValue"
                ],
                "title": "Null"
            },
            "Offset": {
                "type": "object",
                "properties": {
                    "identifier": {
                        "type": "string"
                    },
                    "size": {
                        "type": "integer"
                    }
                },

The Offset properties seem wrong to me.  A Poke offset is composed by:
- A "magnitude", which is itself a Poke integer, either signed or
  unsigned, of any size.
- A "base", which is a 64-bit unsigned Poke integer.

                "required": [
                    "identifier",
                    "size"
                ],
                "title": "Offset"
            },
            "String": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "string"
                    }
                },
                "required": [
                    "value"
                ],
                "title": "String"
            }
        }
    }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]