[qcc] QCC project code

Rob Landley rob at landley.net
Fri Apr 24 16:02:06 PDT 2015


On 04/24/2015 02:01 AM, Bruce Ewing wrote:
> So,
> the QCC project seems to have gotten a few inches off the ground.

Yay!

> It
> looks like Rob and I will be collaborating on it to some degree -- since
> we are in agreement on basic design goals, structure, and aesthetics.

I'm all for it.

> The old TinyCC code (in either Rob's fork or the original fork) is hard
> to understand (and maintain, since it's hard to understand). There is
> also the whole licensing issue. So the decision has been made to abandon
> the old code and begin fresh with a complete rewrite that will contain
> no TinyCC code in the end. TinyCC will provide an inspiration and
> perhaps a template or two, but no more than that. At the moment, the
> licensing on QCC is 2-clause BSD (almost public domain) -- but it may be
> changed at some point to some other almost-public-domain license.

Can I point you at the toybox license:

https://github.com/landley/toybox/blob/master/LICENSE

Which differs from the 2-clause (netbsd) license by the removal of half
a sentence:

https://github.com/landley/toybox/commit/ee86b1d8e25cb0ca9d418b33eb0dc5e7716ddc1e

This makes it effectively public domain, _and_ a bsd license. If you'r
ok with BSD licenses then you should have no objection to this one, but
if you want to combine it with unlicense.org or CC0 or something you
don't have to pull this kind of nonsense:

https://android.googlesource.com/platform/system/core.git/+/05c92d2b4fa7e96f6e64384f197e12916ed1d821/toolbox/NOTICE

(Why several dozen copies of essentially the same license? Different
copyright dates, and you "must reproduce the above copyright notice,
this list of conditions and the following disclaimer". You think that's
nuts, the "kindle paperwhite" has OVER 300 PAGES of this nonsense under
its about menu. Now try actually using this mess for anything if you
ever wind up in court.)

> The current code is hosted at:
> https://github.com/bewing0/qcc

Cloned.

Ok, what do I _do_ with it? (cd into what directory, type what? You have
LICENSE but no README, and the top level config.h does not appear to be
part of "./configure; make; make install", nor menuconfig...

> This code runs, but does not currently produce output. It makes 3 major
> passes over the input source code so far, in the form of a preprocessor
> pass, a tokenizing pass, and then one more pass that I'm calling a
> prototyping pass.

I thought the tinycc code was a 1-pass compiler? (That's part of why it
was so simple and fast.)

That said, if you can fork() and have each pass pipe into the next
internally, you can take advantage of SMP. (You'll probably still lose
out to cache locality on the preprocessing pass, but eh...)

> In the end, the logic that I am using should make it significantly
> faster than TCC ever was, and a million times faster than GCC. Writing
> high-speed code is a specialty of mine.

I look forward to this.

> To some degree, this compiler is also an experiment in what extensions
> are easy to put into a compiler, so it does have a few non-standard
> extensions already -- which will be noted in the documentation.

Oh dear. The reason C survived as long as it did is all the various
vendor extensions were ruthlessly killed off. (If anybody ever actually
uses them, then their code won't compile with anyone else's compiler.)

> Donated code will be happily accepted, with the caveat that the donor
> grants full permission to relicense or reuse that code in the future in
> any fashion, for any reason.

The "zero clause BSD" I pointed at above pretty much reserves that
right. It's a blanket permission grant that doesn't require you to use
any specific license text in derived works.

> If you should choose to actually read the code, then I suppose you
> should know some of my programming idiosyncrasies:
> I'm mostly an ASM programmer, so I tend to put in a lot of comments as a
> habit -- and because I think it's a good habit.
> 
> I rather dislike the "for (; ;){}" construct -- a little too much
> punctuation, and it makes you stop to puzzle out the details of how the
> loops works -- which is always a bad thing. So I make a small effort not
> to use it. I'd rather use while()s or gotos.

So you're a C programmer who doesn't like for loops.

> I absolutely detest the "? x:x" ternary construct -- it's a million
> times worse than a for() loop in every way, so I go far out of my way
> never ever to use it. It mostly needs to be killed with fire.

I use 'em all over the place. :)

> When the code actually starts compiling things, I will certainly post a
> message to this list to let everyone know.

Good luck with it. Somebody writing code trumps somebody not writing
code, I don't get to complain...

Rob

 1429916526.0


More information about the qcc mailing list