From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] new to qemu with a simple question
Date: Fri, 26 May 2017 12:54:38 +0800 [thread overview]
Message-ID: <e4b8f16d-b62d-582c-2659-5e6a049a6813@linux.vnet.ibm.com> (raw)
In-Reply-To: <f5c021e4-86ce-7476-44dc-d386f2349ed0@redhat.com>
On 05/24/2017 09:30 PM, Eric Blake wrote:
> On 05/23/2017 09:56 PM, Wang Dong wrote:
>> Hi guys,
>>
>> I am new to qemu. But I need do some job in it right now.
>>
>> When I try read qmp code. I found a interesting part against it.
>>
>> Some C source code is generate from json file.
>>
>> I wonder why this? What is the benefits of this?
> Boring and repetitive code that is easy to typo is best written by
> computer, which excels at boring and repetitive tasks. Writing our
> description in a more concise higher language and generating C code from
> that lets us focus on the actual design, rather than the mundane
> correctness of the code implementing the design.
>
> It's the same reason that people use bison/yacc rather than hand-written
> parsers for complex grammars - you isolate the correctness of the code
> to the correctness of the generator, and free yourself to now only have
> to worry about the bigger picture of the input you feed to the
> generator. And on another level, it's why we write programs in C
> instead of assembly. Abstraction is good.
>
Thanks for your reply. I really appreciate it.
--
Best regards. Wang Dong
prev parent reply other threads:[~2017-05-26 4:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 2:56 [Qemu-devel] new to qemu with a simple question Wang Dong
2017-05-24 3:11 ` Fam Zheng
2017-05-24 8:37 ` Wang Dong
2017-05-24 13:30 ` Eric Blake
2017-05-26 4:54 ` Wang Dong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4b8f16d-b62d-582c-2659-5e6a049a6813@linux.vnet.ibm.com \
--to=dongdwdw@linux.vnet.ibm.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).