Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1105

Re: Best tools for writing an assembler?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.linkpendium.com!news.linkpendium.com!news.iecc.com!.POSTED!nerds-end
From Sébastien Fricker <sebastien.fricker@gmail.com>
Newsgroups comp.compilers
Subject Re: Best tools for writing an assembler?
Date Fri, 21 Feb 2014 12:00:43 +0100
Organization Guest of ProXad - France
Lines 34
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <14-02-026@comp.compilers> (permalink)
References <14-02-018@comp.compilers> <14-02-021@comp.compilers> <14-02-023@comp.compilers>
NNTP-Posting-Host news.iecc.com
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Trace miucha.iecc.com 1393098028 61570 64.57.183.58 (22 Feb 2014 19:40:28 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Sat, 22 Feb 2014 19:40:28 +0000 (UTC)
Keywords assembler
Posted-Date 22 Feb 2014 14:40:28 EST
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:1105

Show key headers only | View raw


On 20/02/2014 00:20, Robert A Duff wrote:
> Ivan Godard <ivan@ootbcomp.com> writes:
>
>> ...we use the C++ compiler as the first pass, then execute the resulting
>> program as the second pass. You write a C++ function for each machine
>> operation: "add(regNum r1, regNum r2)" or whatever.
>
> Good idea, except I'd write it in Ada or OCaml or something.  I've
> done something similar.
>

This is certainly the most important decision.
The tools/language used cannot be switched during the development.

I wrote a parser for C++ code in C and Flex/Bison. Due to the
difficulty to program complex C code, I have migrated my code to C++.
The code get 20% smaller (due to all free() and low level functions
which are no more necessary) and the code get easier to understand.
The STL contains was also permitting to implement high level
optimization and also reducing the complexity of the algorithms. Doing
this in C is more difficult.

Now, I would write the same in OCaml because:
 - The type checking is very good
 - Menhir (replacement of Flex/Bison) exists
 - The source code would be smaller without syntax glue (like the
necessity to have heaer, ....)
 - Easy possibility to program complex algorithm in few lines.
 - The OCaml code is only 2 times slower that C code (which is acceptable)
 - The startup code (time nead to reach main) is similar to C++.

But migrating an existing project is not possible.
In other words: it makes sense to take time to choose the right
framework at the beginning.

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Best tools for writing an assembler? tpphysik@gmail.com - 2014-02-18 16:04 -0800
  Re: Best tools for writing an assembler? "C. Bergström" <cbergstrom@pathscale.com> - 2014-02-19 11:14 +0700
  Re: Best tools for writing an assembler? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-02-19 04:25 +0000
  Re: Best tools for writing an assembler? Ivan Godard <ivan@ootbcomp.com> - 2014-02-18 23:23 -0800
    Re: Best tools for writing an assembler? Robert A Duff <bobduff@TheWorld.com> - 2014-02-19 18:20 -0500
      Re: Best tools for writing an assembler? Sébastien Fricker <sebastien.fricker@gmail.com> - 2014-02-21 12:00 +0100
      Re: Best tools for writing an assembler? "BartC" <bc@freeuk.com> - 2014-02-22 00:28 +0000
      Re: Best tools for writing an assembler? noitalmost <noitalmost@cox.net> - 2014-02-23 11:22 -0500
        Re: Best tools for writing an assembler? Sébastien Fricker <sebastien.fricker@gmail.com> - 2014-02-24 07:32 +0100
          Re: Best tools for writing an assembler? Louis Krupp <lkrupp@pssw.com> - 2014-02-24 15:39 -0700
          Re: Best tools for writing an assembler? Ivan Godard <ivan@ootbcomp.com> - 2014-02-24 15:04 -0800
            Re: Best tools for writing an assembler? rpw3@rpw3.org (Rob Warnock) - 2014-02-25 13:00 +0000
          Re: Best tools for writing an assembler? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-02-25 04:09 +0100
        Re: Best tools for writing an assembler? "James Harris" <james.harris.1@gmail.com> - 2014-02-24 23:18 +0000
        Re: Best tools for writing an assembler? noitalmost <noitalmost@cox.net> - 2014-02-27 18:11 -0500
          Re: Best tools for writing an assembler? George Neuner <gneuner2@comcast.net> - 2014-03-01 13:09 -0500
            Re: Best tools for writing an assembler? federation2005@netzero.com - 2014-03-26 17:57 -0700
              Re: Best tools for writing an assembler? federation2005@netzero.com - 2014-04-13 12:24 -0700
  Re: Best tools for writing an assembler? Sébastien Fricker <sebastien.fricker@gmail.com> - 2014-02-19 09:59 +0100
    Re: Best tools for writing an assembler? Robert A Duff <bobduff@shell01.TheWorld.com> - 2014-02-19 18:27 -0500
  Re: Best tools for writing an assembler? Patrik Túri <tpphysik@gmail.com> - 2014-02-20 17:15 -0800
    Re: Best tools for writing an assembler? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-02-21 12:09 +0100
      Re: Best tools for writing an assembler? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-02-24 20:42 +0000
        Re: Best tools for writing an assembler? Ivan Godard <ivan@ootbcomp.com> - 2014-02-24 15:13 -0800
        Re: Best tools for writing an assembler? hu47121@usenet.kitty.sub.org (Hannah) - 2014-02-25 00:43 +0000
          Re: Best tools for writing an assembler? Walter Banks <walter@bytecraft.com> - 2014-02-27 14:14 -0500
        Re: Best tools for writing an assembler? Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-02-25 04:23 +0100
    Re: Best tools for writing an assembler? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-02-24 20:35 +0000

csiph-web