Re: Intermediate forms (again?): worthwhile?

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

          From comp.compilers

Related articles
[3 earlier articles]
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)
Re: Intermediate forms (again?): worthwhile? steshaw@gmail.com (Steven Shaw) (2011-01-24)
[7 later articles]
| List of all articles for this month |

From: "Tony" <nospam@myisp.net>
Newsgroups: comp.compilers
Date: Wed, 19 Jan 2011 12:21:28 -0600
Organization: TeraNews.com
References: 11-01-045 11-01-047 11-01-082 11-01-087
Keywords: code
Posted-Date: 21 Jan 2011 22:08:18 EST

Robbert Haarman wrote:
>> Everytime I look into some intermediate LANGUAGE, I feel I am
>> getting too 3rd-party proprietary so I may as well just emit the
>> assembly language and forego the IL. That or invent my own based
>> upon quadruples or something.
>
>> Writing to the hardware (assembly language) gives me the warm
>> fuzzies about being a safe thing to do. i.e., Intel x86 is much the
>> commodity whereas ILs are esoteric.
>
> It depends on what you want to achieve. x86 has been around for a
> long time, is still widely used, and will be provided for
> compatibility for yet more time. On the other hand, recognize that we
> don't actually hardly do 8086 anymore; it's more 386 or even 686
> these days, and we're in the middle of
> a transition to AMD64, which, like 8086 vs 386, is similar, but not
> actually the same.
>
> In the meantime, mobile phones are getting hotter and hotter as
> a platform, and are mostly based on ARM. Also, calling conventions
> (and therefore the assembly you would need to generate) differ
> depending on operating system (e.g. Windows uses different
> conventions from everyone else on AMD64).
>
> So, if you generate assembly, you will either have to content
> yourself with supporting only one instruction set / calling
> convention combination, or you will have to do extra work for every
> additional combination you want to support.


The above can be categorized as "preaching to the choir".


>> Something just a tad higher level than assembly and a bit more
>> regular would be nice, but so far, I haven't seen anything I'd want
>> to commit to. Surely if I could just concentrate on the compiler
>> front end and attach it to a back end black box supporting multiple
>> platforms, that would be great.
>> [The usual suggestion these days is LLVM. -John]
>
> John is right. And I wonder what your experiences with LLVM have been,
> that have made you decide it wasn't what you were looking for. Also, I
> would like to invite you to take a look at Voodoo and tell me what you
> think. Voodoo _is_ that slightly higher level than assembly black box
> supporting multiple platforms, or at least that's what I mean for it
> to
> be. If you could tell me what you think about it, and what might be
> improved to make it more useful to you, that would be a great help to
> me. You can read about Voodoo at
> http://inglorion.net/documents/designs/voodoo/


By "a tad higher", I mean a higher-level assembly language and not
something akin to a HLL. Something still instruction-based and not
statement-based. Just enough to remove the quirks and not necessarily
encompassing all platforms. I'm talking about this too early and that's
why I'm "all over the map" about it. I just need to get it done and THEN
reflect back on it to see if there is a better way of doing it than
generating assembly. I may just want to create the reference
implementation and leave the compiler makers to do the high-perf
implementations. TBD.


As I write this, I am thinking that the front end written to the back end
is the wrong approach: the back end should be written to the front end!
As in, "Here is the AST specification that the front end produces. Have a
ball with it Mr. Compiler Company".



Post a followup to this message

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