public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@transmeta.com>
To: "Jim Blandy" <jimb@red-bean.com>
Cc: "Dave Brolley" <brolley@redhat.com>,
	ttn@glug.org, 	cgen@sources.redhat.com
Subject: Re: [patch][commit] New (if (...) (...) (...)) Test Allowed at Top Level of the Input
Date: Thu, 11 May 2006 20:52:00 -0000	[thread overview]
Message-ID: <17507.41991.445233.121586@casey.transmeta.com> (raw)
In-Reply-To: <8f2776cb0605110945i75d9402bp6743ae22da38d0cb@mail.gmail.com>

Jim Blandy writes:
 > The larger question is, why aren't CGEN machine description files just
 > arbitrary Scheme code that happens to call some functions to register
 > machine description pieces?  Then you'd have the full Scheme language
 > at your disposal, not just pmacros.

I can explain why things are the way they are today.
The powers that be can of course change things however they please.

I didn't (and still don't) want (arbitrary) Scheme in .cpu files.
Maybe CGEN will be written in multiple language some day
(once one has a .cpu database reader, the choice of language
for file generators and such is less important).
I'd hate to have to rewrite all the .cpu files, or maintain multiple
versions, or etc.; or implement all of Scheme just to read the .cpu file in.
I look at .cpu files as a description of the cpu, and I don't
want the reading of that description to be excessively complicated.

Another consequence in allowing arbitrary Scheme is that .cpu files
would become harder to read and maintain.

[
One can quibble of course over whether and how much of Scheme is
already in .cpu files :-).  I think there's even some places where
I provided too much of an escape hatch in order to get something done
(e.g. .eval).  But I think one would be hardpressed to argue
that using a different language would be no harder after N years of
allowing arbitrary Scheme to appear in .cpu files.  As things stand today,
reading the database is rather simple compared with being required
to understand all of Scheme.  I can even imagine having just one database
reader in C(/C++) and then having all generators use it, regardless
of language.

Of course, if one wants to stick with just Scheme then there is
less reason for not allowing it in .cpu files.
]

Having said that, I wouldn't switch from Scheme myself.
But the point is others can for a particular file generator
once the database reader is written.
I WOULD switch from Guile to something better.
One dream I have is to have a Scheme implementation that does dynamic
compilation using a framework built from CGEN.

 > None of this would complicate the interesting parts of CGEN --- the
 > code for producing encoders, decoders, and simulators.  They would
 > operate on the same data structures they do now.  You'd just have a
 > lot more flexibility in how those structures are produced.

IMO (and this is just my opinion) I'd rather restrict the description
of the cpu, and make it easier to use that description.

[Hmmm,
One could have a generator that read in a .cpu with arbitrary Scheme
and spit out a copy ready for consumption by a different language,
but it feels like the wrong way to go.]

      reply	other threads:[~2006-05-11 20:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 17:57 Dave Brolley
2006-05-10 18:11 ` Doug Evans
2006-05-11 11:52   ` Thien-Thi Nguyen
2006-05-11 14:12     ` Dave Brolley
2006-05-11 16:45       ` Jim Blandy
2006-05-11 20:52         ` Doug Evans [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=17507.41991.445233.121586@casey.transmeta.com \
    --to=dje@transmeta.com \
    --cc=brolley@redhat.com \
    --cc=cgen@sources.redhat.com \
    --cc=jimb@red-bean.com \
    --cc=ttn@glug.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 read-only IMAP folder(s) and NNTP newsgroup(s).