git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Support JSON with --json flag and provide header files
@ 2018-08-07  4:54 Alexander Mills
  2018-08-07  4:57 ` Alexander Mills
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Mills @ 2018-08-07  4:54 UTC (permalink / raw)
  To: git

@git

I hear there is a movement underway to have git support JSON for the
purposes of machine readable stdio.

That is all good and well. I want to add to that request. Imagine a
software world were serialized data could be typed. So JSON produced
by C/C++ could be described and the receiving process could have type
information about how the JSON would be deserialized.

How would that work? For every typed language, Git would provide
header files for that language that include type information for each
JSON string that would be produced by git commands.

How could that be accomplished? Someone needs to create a system to
generate type information (header files) for each language based off a
single central format. So we create a JSON format that describes the
JSON data. And from that single format we generate header files for
each typed language.

I hope you see the value in that. There could be a git command that
generates the header files for a given language, given the git
version:

$ git --generate-header-files --language=java > $dir

the above command would generate the right header files for Java given
the git version. Or the headers could be stored on the www and could
be downloadable for each git version. Perhaps Git authors wouldn't do
all this work - perhaps they just author a JSON format that describes
JSON. And the OSS community can write tools that convert the JSON
format into header files for each language. But I would like something
OFFICIAL to take place here.

Hope this makes sense. I am looking forward to a software future where
parsing stdio is easier by using machine readable JSON. Want human
readable output? Use the regular command. Want machine readable
output? use the --json flag.

-alex

-- 
Alexander D. Mills
¡¡¡ New cell phone number: (415)730-1805 !!!
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Support JSON with --json flag and provide header files
  2018-08-07  4:54 Support JSON with --json flag and provide header files Alexander Mills
@ 2018-08-07  4:57 ` Alexander Mills
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Mills @ 2018-08-07  4:57 UTC (permalink / raw)
  To: git

To make it clear, these headers files would allow for compile-time type safety.
When you are parsing serialized data into a data structure, you know
have header files that describe the data type(s).
It would be nice to not have to "guess" about the structure of the
JSON that git produces.

On Mon, Aug 6, 2018 at 9:54 PM, Alexander Mills
<alexander.d.mills@gmail.com> wrote:
> @git
>
> I hear there is a movement underway to have git support JSON for the
> purposes of machine readable stdio.
>
> That is all good and well. I want to add to that request. Imagine a
> software world were serialized data could be typed. So JSON produced
> by C/C++ could be described and the receiving process could have type
> information about how the JSON would be deserialized.
>
> How would that work? For every typed language, Git would provide
> header files for that language that include type information for each
> JSON string that would be produced by git commands.
>
> How could that be accomplished? Someone needs to create a system to
> generate type information (header files) for each language based off a
> single central format. So we create a JSON format that describes the
> JSON data. And from that single format we generate header files for
> each typed language.
>
> I hope you see the value in that. There could be a git command that
> generates the header files for a given language, given the git
> version:
>
> $ git --generate-header-files --language=java > $dir
>
> the above command would generate the right header files for Java given
> the git version. Or the headers could be stored on the www and could
> be downloadable for each git version. Perhaps Git authors wouldn't do
> all this work - perhaps they just author a JSON format that describes
> JSON. And the OSS community can write tools that convert the JSON
> format into header files for each language. But I would like something
> OFFICIAL to take place here.
>
> Hope this makes sense. I am looking forward to a software future where
> parsing stdio is easier by using machine readable JSON. Want human
> readable output? Use the regular command. Want machine readable
> output? use the --json flag.
>
> -alex
>
> --
> Alexander D. Mills
> ¡¡¡ New cell phone number: (415)730-1805 !!!
> alexander.d.mills@gmail.com
>
> www.linkedin.com/pub/alexander-mills/b/7a5/418/



-- 
Alexander D. Mills
¡¡¡ New cell phone number: (415)730-1805 !!!
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-07  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07  4:54 Support JSON with --json flag and provide header files Alexander Mills
2018-08-07  4:57 ` Alexander Mills

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).