Re: Intermediate forms (again?): worthwhile?

"Tony" <nospam@myisp.net>
Wed, 19 Jan 2011 12:11:37 -0600

          From comp.compilers

Related articles
[2 earlier articles]
Re: Intermediate forms (again?): worthwhile? comp.compilers@inglorion.net (Robbert Haarman) (2011-01-14)
Re: Intermediate forms (again?): worthwhile? gene.ressler@gmail.com (Gene) (2011-01-15)
Re: Intermediate forms (again?): worthwhile? nospam@myisp.net (Tony) (2011-01-18)
Re: Intermediate forms (again?): worthwhile? comp.compilers@inglorion.net (Robbert Haarman) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? steshaw@gmail.com (Steven Shaw) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? nospam@myisp.net (Tony) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? nospam@myisp.net (Tony) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? nospam@myisp.net (Tony) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? cr88192@hotmail.com (BGB) (2011-01-19)
Re: Intermediate forms (again?): worthwhile? cr88192@hotmail.com (BGB) (2011-01-22)
Re: Intermediate forms (again?): worthwhile? ehog.hedge@googlemail.com (chris dollin) (2011-01-22)
Re: Intermediate forms (again?): worthwhile? nospam@myisp.net (Tony) (2011-01-22)
Re: Intermediate forms (again?): worthwhile? bc@freeuk.com (Bartc) (2011-01-23)
[8 later articles]
| List of all articles for this month |

From: "Tony" <nospam@myisp.net>
Newsgroups: comp.compilers
Date: Wed, 19 Jan 2011 12:11:37 -0600
Organization: TeraNews.com
References: 11-01-082 11-01-088
Keywords: code
Posted-Date: 21 Jan 2011 22:07:34 EST

Steven Shaw wrote:
> I'd like to second cr88192. i.e. either write a simple interpreter -
> probably an AST evaluator since you're not concerned about
> performance - or compile to C. Another option is to compile to
> another HLL. C is kinda high-level but other choices might be
> JavaScript (works in browsers and nodejs etc), Java or C#. If you
> stay high-level enough, you might be able to compile to something
> C-ish and only have small differences to your generator to get
> Cish->JS, Cish->Java, Cish->C# etc.
>
> If you want to be close to the metal, as John said, there's LLVM. The
> new front-runner.
>
> Another option at some point may be HLVM - a abstraction layer on
> LLVM as I understand it. It's currently in early stages and it's
> primary author seemed to have dropped it until some recent activity.


I am surprised (kinda) to see how many people consider C a suitable
compile-to language when it really is only good for C-derivatives. C++
is one of those, so cfront was adequate, for awhile. For languages
that depart from C-likeness, it is not suitable at all.


I'll have to go back and see (again) what LLVM affects and what the
limitations are because it just doesn't stick in my mind why I reject it
so often. I don't want to compromise my front end (such as using someone
else's AST for example) just to use a particular IR.


Everything seems harder than assembly and the coupling to 3rd party
technology is an issue also. I know enough assembler just to get by
and am learning more each day, but it's not like I have to program in
it, just generate it, so it is doable and a good stepping-stone, and
there are "lots" of examples. I'll probably want to do the 64-bit
version that way too. The IR thing is a consideration for
optimization, cross-platform, concurrency, etc. if that is too complex
(time consuming) to tackle, that is.
[C can be a perfectly reasonable intermediate language so long as you don't
expect the C code to be readable by humans or to look anything like the
source code. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.