Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <v2hlu2$gno0$1@dont-email.me>
Deutsch   English   Français   Italiano  
<v2hlu2$gno0$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Mikko <mikko.levanto@iki.fi>
Newsgroups: comp.lang.c
Subject: Re: Add JSON, XML, CSV to Baby X resource compiler
Date: Tue, 21 May 2024 11:27:46 +0300
Organization: -
Lines: 52
Message-ID: <v2hlu2$gno0$1@dont-email.me>
References: <v2cjht$3b3om$1@dont-email.me> <v2dv70$3jm1q$1@dont-email.me> <v2f4qg$3tm9m$1@dont-email.me> <v2facc$3up6a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 21 May 2024 10:27:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a24d781d64b3d9431fe436d8401297f2";
	logging-data="548608"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19TtNyVapQ3Gad3y/j7gnAN"
User-Agent: Unison/2.2
Cancel-Lock: sha1:t2+vQ70tJPAE8a6CENmHRhKTl9E=
Bytes: 3346

On 2024-05-20 10:58:20 +0000, Malcolm McLean said:

> On 20/05/2024 10:23, Mikko wrote:
>> On 2024-05-19 22:41:36 +0000, bart said:
>> 
>>> On 19/05/2024 11:16, Malcolm McLean wrote:
>>>> The Baby X resource compiler takes data - fonts, images, audio, strings 
>>>> - and converts them into C source so that they can be read by C 
>>>> programs without relying on external data files.
>>>> 
>>>> An obvious extension is to take in structured data. Adding SQL and 
>>>> querying a database would unfortuately mean extending the program so 
>>>> that it could only run on a large machine with a SQL server running, 
>>>> and isn't really a viable proposition. However JSON, XML, and CSV are 
>>>> commonly used to pass small to medium amounts of data about.
>>>> 
>>>> I've made a start on supporting CSV with the "<dataframe>" tag. CSV 
>>>> data is tabular and two dimensional, and lends itself to an arrray of 
>>>> simple structures. JSON And XML can of course represent more complex 
>>>> data, with hierarchy. The dataframe tag is still very experimental. 
>>>> I've never used it for anything practical.
>>>> 
>>>> So what would be the best approach to putting in JSON and XML support?
>>> 
>>> I've only briefly used XML.
>>> 
>>> The problem with XML is that the data it represents is not just 
>>> hierarchical, but it can be chaotic. You can have one lot of data, 
>>> followed by another for something else with a different structure, 
>>> followed by other. It is just a container for disparate sets of data.
>> 
>> Not just XML. JSON and may other formats have the same features.
>> 
>> In order to put a resouce to a C program my preference is to convert
>> the resource to an array of characters or bytes and process it the
>> same way it would be processed if it were read from a file.
>> 
>> 
> And of course the Baby X resource compiler already supports that. You 
> can convert XML or JSON to a string, and then run your own parser over 
> it at runtime.
> 
> But that isn't really a very good solution.

Depends on the problem. If an application needs a resource that is
not needed by many other applications an ad hoc parser can produce
a result structure that a generic parser cannot do. Even then it may
be desiderable to use a format that could be parsed as XML or JSON.

-- 
Mikko