Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #54998

Re: Moving JSON around.

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: Moving JSON around.
Date 2017-02-19 01:38 -0800
Organization A noiseless patient Spider
Message-ID <877f4mmsfs.fsf@nightsong.com> (permalink)
References <9520efbe-f7e6-46b9-a052-7c0b99b0a352@googlegroups.com> <87bmtymty0.fsf@nightsong.com> <7b0d720e-787a-4e81-93df-b386c9e7f487@googlegroups.com>

Show all headers | View raw


Julian Fondren <julian.fondren@gmail.com> writes:
> The thing about JSON, in my experience, is that it's all destined to
> get read by JavaScript running in a webpage. 

I don't find that at all--it's a very widely used format now, showing up
in all kinds of places, like REST APIs that are used by many sorts of
clients.  I'm constantly pulling json data from places and generally
munching it with python scripts, though the docs are usually much
smaller.  Databases like MongoDB use Json as their communication format,
and a more compact binary version internally.

> So it can't really ever be much of a threat to server memory -- if it
> were that big, the browser would be even less pleased by it.

Heh, most of my servers are 128MB VPS's and browsers are monstrous
compared to that.  It's like the 1990s joke that computers kept getting
faster and faster, so Microsoft kept making MS Word slower so you'd have
to upgrade your Wintel hardware.  Finally computers got so fast that
Microsoft could no longer bog them down with Word while keeping a
straight face.  So now we have browsers eating more and more resources
instead.  People are running whole OS's in browsers now.  Like if you go
to Archive.org, you can run various classic computer games through JS
emulation of the x86 machine code in the old MSDOS and 68k Macintosh
binaries.

> Although I'm sure that gigabytes of JSON exist, somewhere.

I mess with terabyte XML documents sometimes, using a streaming parser.
I guess those could be jsonized.  The file you linked to is around
180MB.  Its main object is a list of something like 200k smaller
dictionaries.  I'd probably write them each out as a separate document
of 1MB or so, rather than 1 giant document.

http://rapidjson.org/ has a streaming json parser in C++ that claims to
be super fast.  I might give it a try.

I use Expat (a fast streaming C parser) for XML processing but it still
takes some time on very large documents, so maybe converting them to
JSON (or a binary format) isn't crazy.

I wonder if a Forth 2000x recognizer could handle JSON.  { } [ ] " and ,
would all be separate words that pushed items to and popped them from
a parsing stack, calling user functions at each event.

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-18 23:37 -0800
  Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 10:07 +0200
    Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 00:35 -0800
      Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 12:12 +0200
        Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 13:17 +0200
          Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 13:33 +0200
            Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-19 16:25 +0200
              Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 11:57 +0200
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-20 02:03 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 12:56 +0200
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-21 16:18 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-22 06:39 +0200
                Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-24 22:36 -0800
                Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-25 01:50 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-25 20:02 +0200
                Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-25 23:13 -0800
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 10:13 +0200
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 13:01 +0200
                Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-26 16:05 +0200
  Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 01:05 -0800
    Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 01:17 -0800
      Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 01:38 -0800
        Re: Moving JSON around. franck.bensusan@gmail.com - 2017-02-19 16:08 -0800
          Re: Moving JSON around. Paul Rubin <no.email@nospam.invalid> - 2017-02-19 17:16 -0800
          Re: Moving JSON around. Julian Fondren <julian.fondren@gmail.com> - 2017-02-19 17:52 -0800
            Re: Moving JSON around. Ron Aaron <rambamist@gmail.com> - 2017-02-20 07:26 +0200
            Re: Moving JSON around. franck.bensusan@gmail.com - 2017-02-20 03:01 -0800

csiph-web