Re: ISA-independent programming language
- From: Andrew Reilly <andrew-newspost@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 09:17:25 +1000
On Tue, 16 Aug 2005 15:35:18 +0000, Hank Oredson wrote:
> "Anton Ertl" <anton@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:2005Aug16.075744@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> "Hank Oredson" <horedson@xxxxxxxxxxxxx> writes:
>>>It doesn't matter, the compiler takes care of it.
>>>A number is a number.
>>>It must have a defined range, whether there are one
>>>or two representations for zero should not matter to me.
>>
>> It does, if the language supports bitwise operations on integers.
>
> The language needs the correct data types for the operations
> it supports. If a bitset is needed, the language should provide it.
This is a foolish position to hold, in my opinion. Bitwise operators are
fundamentally mathematical, and sensibly operate on integers (mostly
unsigned, but there are uses on signed integers, if you can assume the
representation, 2-s complement being the most common.)
Do you suggest that evenness be tested by actual division and
multiplication, rather than masking off the LSB?
Sure, lots of the sorts of operations that result in "arithmetic" and
"logical" operations being mixed in expressions can alternatively be
written in terms of multiplication, division and modulo operations. You
even get to use arbitrary length buffers and intervals. However in real
systems efficiency matters. One can recognise that by making one's
modulo arithmetic based on powers of two, many of these operations
simplify to bit-wise operations, and a dramatic reduction in execution
cost can be achieved, in some circumstances.
It is concievable that many of the common patterns of use could be
recognised by compilers as peep-hole optimisations, and the efficient
bit-wise operations made where arithmetic operations are specified.
Frankly, I don't want to have to rely on that sort of algorithm selection
behind my back. If the language advocates are going to rely on that sort
of thing, then those transformations must be part of the language
specification so that they can be relied on by programmers.
Or, more simply, just allow intermixing of arithmetic and logical
operations.
> Of course my tongue is in my cheek as usual, and I personally
> would find such a language useless. But I'm willing to write the
> underlying "stuff" like FP operations and ISRs for each hardware
> I encounter, and do that in assembler. But I'm a hardware person
> first and a software person second (smile).
I wonder whether it is indeed possible to design a language that is
simultaneously "safe", or "portable", or whatever the original poster was
looking for, and also useful. I'll choose sharp and useful, myself, as a
general rule, but I do find myself mixing Matlab, Python, Scheme and Java
into my C and assembler these days. Safe and easy are useful benefits in
situations where speed isn't important. Many things that wait for a human
come into that category.
Cheers,
--
Andrew
.
- Follow-Ups:
- Re: ISA-independent programming language
- From: Ken Hagan
- Re: ISA-independent programming language
- From: Anton Ertl
- Re: ISA-independent programming language
- From: Hank Oredson
- Re: ISA-independent programming language
- References:
- ISA-independent programming language
- From: mihai cartoaje
- Re: ISA-independent programming language
- From: Hank Oredson
- Re: ISA-independent programming language
- From: Anton Ertl
- Re: ISA-independent programming language
- From: Hank Oredson
- ISA-independent programming language
- Prev by Date: Re: PART 3. Why it seems difficult to make an OOO VAX competitive (really long)
- Next by Date: Re: Compiler/Architecture course on modern hardware
- Previous by thread: Re: ISA-independent programming language
- Next by thread: Re: ISA-independent programming language
- Index(es):
Relevant Pages
|