Re: ISA-independent programming language



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

.



Relevant Pages

  • Re: ISA-independent programming language
    ... the compiler takes care of it. ... >> or two representations for zero should not matter to me. ... Any language is a "CLOSED ENVIRONMENT." ...
    (comp.arch)
  • Re: any regex gurus out there?
    ... > No matter what number or combination of backslashes I used it didn't work. ... - The compiler wouldn't take it otherwise. ... or escape each backslash with a backslash, ... > French language, the letter A may have three different accents. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: book - jQuery
    ... Of course it isn't a language, languages are only in my analogy. ... In other words, jQuery is 50K of junk code, not a ... Matter of taste, if you ask me. ... You obviously dislike js frameworks and you're unhappy about where is ...
    (comp.lang.javascript)
  • Perry Marshall DNA is language MP3 transcribed
    ... To have information you need matter, energy and will. ... ATCG letters of the DNA alphabet. ... What makes a language. ...
    (talk.origins)
  • Re: Perry Marshall DNA is language MP3 transcribed
    ... To have information you need matter, ... ATCG letters of the DNA alphabet. ... What makes a language. ... The essential distinction between patterns and designs is language. ...
    (talk.origins)