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


Groups > comp.unix.programmer > #1138

Re: find library in C

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.unix.programmer
Subject Re: find library in C
Date 2011-08-13 11:40 +1200
Message-ID <9alrv5Fhn3U2@mid.individual.net> (permalink)
References <j21e88$fba$1@speranza.aioe.org> <4e453be5$0$31423$a729d347@news.telepac.pt> <4e4553a2$0$5992$426a74cc@news.free.fr> <4e456ce8$0$31420$a729d347@news.telepac.pt>

Show all headers | View raw


On 08/13/11 05:58 AM, Rui Maciel wrote:
> Nicolas George wrote:
>
>> Using an existing library for a well-known syntax, such as XML or JSON,
>> has the double advantage that (1) the library will usually take care of
>> allowing corner cases, such as including the quotation character inside a
>> string, and (2) the users will usually be already be familiar with the
>> syntax.
>
> These details are irrelevant.  There are a considerable number of
> applications where a developer only needs a basic map between a key and a
> value, where the value doesn't even need to be of any specific type other
> than a basic text string.

Which is precisely what JSON gives you, in a very concise form:

{"key":"value"}

Which is trivial to parse from scratch.  So by using an well known 
syntax, the programmer has the choice between a hand written parser, or 
an existing library.

> Adding to this, when you employ languages such as XML or JSON to exchange
> information, what you are effectively doing is defining a language which is
> a proper subset of those languages.  A language which is a subset of any
> other language is still a language on it's own.

Why is that a problem?  You can still use an existing library to do the 
paring and use the parser output as the input to your interpreter.

> This means that you can
> still employ XML or JSON in your day-to-day usage but you are obviously
> better off developing your own parser for your specific language, due to
> factors such as simplicity, efficiency improvements and the ability to
> perform any sanity check right in the first parsing.

Until your language subset grows. I generally use JSON for configuration 
files and by using a generic parser, I don't have to worry about 
extending the configuration syntax.

-- 
Ian Collins

Back to comp.unix.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

find library in C ZarkXe <zarkxe@gmail.com> - 2011-08-11 22:35 +0200
  Re: find library in C "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-11 23:16 +0200
    Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 15:50 +0100
      Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 16:20 +0100
  Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 15:29 +0100
    Re: find library in C "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-12 17:03 +0200
      Re: find library in C "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-12 17:09 +0200
      Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 16:31 +0100
    Re: find library in C Nicolas George <nicolas$george@salle-s.org> - 2011-08-12 16:24 +0000
      Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 18:58 +0100
        Re: find library in C Nicolas George <nicolas$george@salle-s.org> - 2011-08-12 19:16 +0000
          Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-13 13:42 +0100
            Re: find library in C Nicolas George <nicolas$george@salle-s.org> - 2011-08-13 15:06 +0000
        Re: find library in C Ian Collins <ian-news@hotmail.com> - 2011-08-13 11:40 +1200
          Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-13 11:08 +0100
      Re: find library in C William Ahern <william@wilbur.25thandClement.com> - 2011-08-12 12:58 -0700
        Re: find library in C Nicolas George <nicolas$george@salle-s.org> - 2011-08-12 20:31 +0000
          Re: find library in C William Ahern <william@wilbur.25thandClement.com> - 2011-08-12 14:47 -0700
          Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-13 14:30 +0100
            Re: find library in C William Ahern <william@wilbur.25thandClement.com> - 2011-08-13 18:54 -0700
    Re: find library in C Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-12 18:55 +0100
      Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-12 19:37 +0100
        Re: find library in C Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-12 20:21 +0100
          Re: find library in C Rui Maciel <rui.maciel@gmail.com> - 2011-08-13 10:23 +0100
            Re: find library in C Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-08-13 14:53 +0100
  Re: find library in C "Heinrich Wolf" <invalid@invalid.invalid> - 2011-08-15 13:58 +0200

csiph-web