public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: Craig Burley <burley@gnu.org>
To: law@cygnus.com
Cc: martynas@nm3.ktu.lt, alan@spri.levels.unisa.edu.au,
	gcc2@cygnus.com, egcs@cygnus.com, gas2@cygnus.com
Subject: Re: ASM_COMMENT_START and gas divide operator
Date: Thu, 14 May 1998 10:17:00 -0000	[thread overview]
Message-ID: <199805141715.NAA21358@melange.gnu.org> (raw)
In-Reply-To: <6525.895163640@hurl.cygnus.com>

>Actually I would recommend against that -- I've had the pleasure of
>writing a gas port (HPPA) where certain characters had different
>meanings depending on their exact placement in a line.  To this day
>it still doesn't work 100% correctly -- the grammar is inherently
>ambigious.  In my case the character is a '!', and is used in
>comparison operations, as a gas built-in operator *and* as a line
>continuation character.

Oh, that's easy to handle.  It's a built-in operator if it isn't
the first character in the line, otherwise it's a line-continuation
character if the line being continued would be syntactically and
semantically correct, also produced faster code, than if it was
interpreted as a line-comment character, otherwise it's a line-
comment character.

Yes, I'm being sarcastic.  Especially regarding HPPA assembler
syntax as provided by HP, which was designed by someone who
should not have been let near a language-design project like
that, too often "little languages", whether assemblers, tools,
or C++, are designed by people who are unaware of, or give little
thought to, the outright readability of code written in the
language, in the sense that the basic semantics should be fairly
obvious *without* the reader having to memorize lots of semantic
information.

(In HPPA assembler's case, one glaring stupidity was the
nullified branches, which have completely different semantics
depending on whether the label being branched to happens to assemble
to a negative or positive offset!  A smarter design would have
required the programmer to specify whether such a branch was
a "forward" or "backward" branch explicitly, then the assembler
and/or linker would complain if reality didn't match the programmer's
specification.  I've never looked into whether GNU's HPPA as fixes
this botch; I gather GNU as fixes many botches, though, so it
wouldn't surprise me if it did, even though that might make
for some compatibility problems with existing HP as code.)

As far as characters meaning something special only when they're
in column 1: sometimes that's barely reasonable (C's "#" directives,
excluding #pragma), but most often it really just makes the
little language look more like the bad old days of Fortran,
in the sense that even *Fortran* no longer has such a weird
syntax in its modern incarnation (Fortran 90's "free" format).

        tq vm, (burley)

  reply	other threads:[~1998-05-14 10:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-30 22:29 Alan Modra
1998-05-06 18:34 ` Jeffrey A Law
1998-05-07  1:53   ` Andreas Schwab
1998-05-07  3:59     ` Alan Modra
1998-05-07  2:39       ` Andreas Schwab
1998-05-14  0:35 ` Martynas Kunigelis
1998-05-14  9:37   ` Jeffrey A Law
1998-05-14 10:17     ` Craig Burley [this message]
1998-05-14 13:08       ` Jeffrey A Law
1998-05-14 15:07         ` Craig Burley

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=199805141715.NAA21358@melange.gnu.org \
    --to=burley@gnu.org \
    --cc=alan@spri.levels.unisa.edu.au \
    --cc=egcs@cygnus.com \
    --cc=gas2@cygnus.com \
    --cc=gcc2@cygnus.com \
    --cc=law@cygnus.com \
    --cc=martynas@nm3.ktu.lt \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).