Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Uncategorized
  3. This is from the JSON-LD spec.

This is from the JSON-LD spec.

Scheduled Pinned Locked Moved Uncategorized
activitypubactivitystreamsjsonldrfc7159rfc8259
5 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
    @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
    @reiver ⊼ (Charles) :batman:
    wrote last edited by
    #1

    This is from the JSON-LD spec.

    ActivityPub / ActivityStream are based on JSON-LD.

    I think it was a very bad idea for JSON-LD to define "number" this way!

    It makes it so numbers with fractional values are inexact & lossy.

    This include values that are common for money.

    For example, neither 0.10 and 0.20 can be represented exactly. So, 0.10 + 0.20 does NOT equal 0.30!

    It should have used FIXED-point numbers rather than FLOATING-point.

    #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

    @reiver ⊼ (Charles) :batman:R JenniferplusplusJ 2 Replies Last reply
    2
    0
    • R AodeRelay shared this topic
      R ActivityRelay shared this topic
    • @reiver ⊼ (Charles) :batman:R @reiver ⊼ (Charles) :batman:

      This is from the JSON-LD spec.

      ActivityPub / ActivityStream are based on JSON-LD.

      I think it was a very bad idea for JSON-LD to define "number" this way!

      It makes it so numbers with fractional values are inexact & lossy.

      This include values that are common for money.

      For example, neither 0.10 and 0.20 can be represented exactly. So, 0.10 + 0.20 does NOT equal 0.30!

      It should have used FIXED-point numbers rather than FLOATING-point.

      #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

      @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
      @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
      @reiver ⊼ (Charles) :batman:
      wrote last edited by
      #2

      This is likely (directly or indirectly) the fault of a single paragraph in IETF RFC-7159 / RFC-8259 (shown in the attached screen-shot).

      (And note that, there is a difference between JSON and IETF JSON. JSON did not have this. IETF JSON does.)

      That paragraph (in the IETF RFC) was NOT a requirement. But, others made it a requirement — including JSON-LD.

      RE: https://mastodon.social/@reiver/115956356584464586

      #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

      @reiver ⊼ (Charles) :batman:R 1 Reply Last reply
      0
      • @reiver ⊼ (Charles) :batman:R @reiver ⊼ (Charles) :batman:

        This is likely (directly or indirectly) the fault of a single paragraph in IETF RFC-7159 / RFC-8259 (shown in the attached screen-shot).

        (And note that, there is a difference between JSON and IETF JSON. JSON did not have this. IETF JSON does.)

        That paragraph (in the IETF RFC) was NOT a requirement. But, others made it a requirement — including JSON-LD.

        RE: https://mastodon.social/@reiver/115956356584464586

        #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

        @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
        @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
        @reiver ⊼ (Charles) :batman:
        wrote last edited by
        #3

        There is a larger discussion about fixed-point numbers versus floating-point numbers.

        And that, ALL programming-languages should have fixed-point numbers built into them.

        And that, programmers should be warned against using floating-point numbers in all but a set of very specialized situations — where inexact math is OK.

        For most programmers in most situations inexact math is NOT OK. And, they should NOT use floating-point numbers.

        #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

        1 Reply Last reply
        0
        • @reiver ⊼ (Charles) :batman:R @reiver ⊼ (Charles) :batman:

          This is from the JSON-LD spec.

          ActivityPub / ActivityStream are based on JSON-LD.

          I think it was a very bad idea for JSON-LD to define "number" this way!

          It makes it so numbers with fractional values are inexact & lossy.

          This include values that are common for money.

          For example, neither 0.10 and 0.20 can be represented exactly. So, 0.10 + 0.20 does NOT equal 0.30!

          It should have used FIXED-point numbers rather than FLOATING-point.

          #ActivityPub #ActivityStreams #JSONLD #RFC7159 #RFC8259

          JenniferplusplusJ This user is from outside of this forum
          JenniferplusplusJ This user is from outside of this forum
          Jenniferplusplus
          wrote last edited by
          #4

          @reiver that's a json thing, which is itself a JavaScript thing. JS doesn't have an integer type, only number, which is a double precision floating point. Json is a serialization spec for JavaScript objects, and jsonld is spec for pretending that adding one property to a json document makes it a collection of rdf triples and then getting mad about it when the rest of the world just wants things to be parseable

          @reiver ⊼ (Charles) :batman:R 1 Reply Last reply
          2
          0
          • JenniferplusplusJ Jenniferplusplus

            @reiver that's a json thing, which is itself a JavaScript thing. JS doesn't have an integer type, only number, which is a double precision floating point. Json is a serialization spec for JavaScript objects, and jsonld is spec for pretending that adding one property to a json document makes it a collection of rdf triples and then getting mad about it when the rest of the world just wants things to be parseable

            @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
            @reiver ⊼ (Charles) :batman:R This user is from outside of this forum
            @reiver ⊼ (Charles) :batman:
            wrote last edited by
            #5

            @jenniferplusplus

            AFAIK, it is an IETF JSON thing, and wasn't part of the original (pre-IETF) JSON.

            Here's the oldest version of the JSON spec I could find:

            https://web.archive.org/web/20030228034147/http://www.crockford.com/JSON/index.html

            It defines "number" as in the screen-shot, and doesn't say anything about floating-point numbers.

            ...

            I do agree with you that the reason IETF JSON talked about floating-point numbers is almost certainly because of JavaScript.

            1 Reply Last reply
            1
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups