From: David Given <dg@cowlark.com>
To: "ELKS (linux-8086)" <linux-8086@vger.kernel.org>
Subject: Re: SDCC porting feasibility study, part 1: the assembler
Date: Mon, 27 Feb 2012 18:52:02 +0000 [thread overview]
Message-ID: <4F4BD0D2.7030005@cowlark.com> (raw)
In-Reply-To: <CAGc3vb3-cifBUWkhrkyf4MrBAm_ss8sMUsOgN7qOOaho_xhVQg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2285 bytes --]
Brad Normand wrote:
[...]
> What scares me there is writing a whole toolchain isn't trivial. In
> college, I took a class where we wrote the most basic of basic
> compilers in java (using a nice grammar parsing library), reading in a
> simplified ALGOL and targeting mips and doing no optimization or real
> register allocation at all.
I've been doing stuff with compilers for years (ask me about my C to
Perl compiler!), and this is so true. C compilation is painful. Doing C
compilation *well* is a life's work. You *seriously* don't want to write
one from scratch.
If you want to do an 8086 C compiler, I'd strongly recommend looking at
LLVM --- it's apparently got a really nice backend model, although the
documentation isn't brilliant. Better still, it may be possible to start
with the excellent 386 backend and cut it down, which should be a much
easier job than building one from scratch.
Other compiler backends I know about:
- gcc: unspeakable.
- Sparse: the engine behind the Linux kernel linter, which I used for
the above C to scripting engine compiler. It's not really intended as a
code generator but actually does a reasonable job.
- vbcc: I did a Z-machine backend for this; it's got a very nice
architecture, and is simple to work with and produces reasonable code,
but has a painful source-available-but-not-open-source license.
- the ACK: has the advantage of being a complete turnkey toolchain and
compiler, including assembler, linker, librarian, libc, etc, *and* it
already supports the 8086, but doesn't produce great code and is tough
to work on.
- tcc: very very very fast. Produces very very very crap code. It
started life as an IOCCC entry, and boy does it show.
Then there's TenDRA, which I've never had anything to do with but which
seems to have vanished. And there are C and C++ parsing libraries like
Elkhound which I've tried to look at but have been unable to get started
with.
--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-02-27 18:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 0:18 SDCC porting feasibility study, part 1: the assembler Brad Normand
2012-02-27 10:05 ` Gábor Lénárt
2012-02-27 15:43 ` Brad Normand
2012-02-27 15:46 ` Jody Bruchon
2012-02-27 17:53 ` Brad Normand
2012-02-27 18:52 ` David Given [this message]
2012-02-27 19:04 ` Chad
2012-02-27 19:33 ` Brad Normand
2012-02-27 19:37 ` Harley Laue
2012-02-27 20:42 ` Brad Normand
2012-02-27 21:34 ` Jody Bruchon
2012-02-27 22:26 ` David Given
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=4F4BD0D2.7030005@cowlark.com \
--to=dg@cowlark.com \
--cc=linux-8086@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.