Re: HLL design

"Bjarke Walling" <bjarke.walling@gmail.com>
24 Oct 2006 17:36:43 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: HLL design mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2006-10-21)
Re: HLL design int2k@gmx.net (Wolfram Fenske) (2006-10-21)
Re: HLL design DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-10-21)
Re: HLL design free4trample@yahoo.com (fermineutron) (2006-10-21)
Re: HLL design danwang74@gmail.com (Daniel C. Wang) (2006-10-24)
Re: HLL design idknow@gmail.com (idknow@gmail.com) (2006-10-24)
Re: HLL design bjarke.walling@gmail.com (Bjarke Walling) (2006-10-24)
Re: HLL design amedlock@gmail.com (DavidM) (2006-10-24)
Re: HLL design DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-10-26)
Re: HLL design bjarke.walling@gmail.com (Bjarke Walling) (2006-10-28)
| List of all articles for this month |
From: "Bjarke Walling" <bjarke.walling@gmail.com>
Newsgroups: comp.compilers
Date: 24 Oct 2006 17:36:43 -0400
Organization: Compilers Central
References: 06-10-08006-10-089
Keywords: design
Posted-Date: 24 Oct 2006 17:36:43 EDT

fermineutron skrev:
> Another question is this:
>
> If I do decide to write the new language, do you think that writing a
> compiler into asm be the better bet or will translating variables into
> C structures and handling everything on the level of C language be
> good enough? Natureally then there would be a need do use a C compiler
> to actually produce the exe file.


That depends. I am writing a compiler which produces C output from some
language I designed. Then you would compile the C code afterwards, or
my compiler could call a known C compiler itself. I chose this method
because of a number of advantages:
* It is easier for me to write this compiler instead of writing
assembly instructions (I could do it, but it would take longer time)
* I don't have to worry about specific optimization problems if I
assume that I use an optimizing C compiler.
* My language is more or less independant of the architecture and
platform if I stick to the C standard. Ie. you can use another C
compiler to compile for your specific platform.


This is only possible because my structures is representable in C. In
some of the structures I add runtime type information that I need. I
may also write a garbage collector in C if I find that I need it, and
it is easier (with my knowledge) to write it in C than writing it in
pure assembly.


I might go for compiling directly to assembly in the future. The
advantage is that you have full control about how the application is
running and maybe you are able to optimize your code better than the C
compiler.


So basicly, it is up to you - what are the advantages and what are
the drawbacks.


- Bjarke Walling



Post a followup to this message

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