home .. forth .. misc mail list archive ..

Re: shitty programming [WAS: Chucks address]


At 05:19 20000615 -0700, M. Simon wrote:
>At 10:08 PM 6/14/00 +0200, Jaap van Ganswijk wrote:
>>At 17:04 20000614 -0700, M. Simon wrote:
>> >At 10:06 PM 6/13/00 -0400, vic plichota wrote:
>> >> > >my 2 cents    - vic
>> >> >
>> >> > True. But sometimes that is good enough.
>> >>
>> >>
>> >>Please don't take it personally, it was just a general observation --
>> >>in fact I appreciate your point -- but I am in an absolutely terrible
>> >>mood today (had to tell an abusive client to fuck off).
>> >>
>> >>
>> >>cheers   - vic
>> >
>> >
>> >No problem.
>> >
>> >In fact I agree.
>> >
>> >The sorry state of current hardware and software is because the two 
>> disciplines
>> >have become relatively isolated.
>> >
>> >The MISC group are the only ones trying to think about this subject in any
>> >deep way.
>> >
>> >I read about a group trying to impliment C in hardware. What a hoot.
>> >C internals are ugly and require LOTS of registers to make things even
>> >quasi efficient.
>>
>>C is quite easy to compile for the conventional and RISC
>>processors as long as they are orthogonal etc.
>>
>> >Then there is that ugly 'stack frame' . What an terrible use
>> >of a stack.
>>
>>What is the alternative?
>
>FORTH.

Forth is not the world's programming language, but C and it's
derivatives are. C is a language that's much more adapted to
humans than to the underlying hardware and is therefore much
more writable and readable and rereadable and checkable
than a reversed polish notation one-type-only based language.

But even if you should be one the sekte that disagrees, any
generally employable processor should be able to handle
compiled C programs quite well also.

>Preferably running on a MISC chip. But the MISC chip
>is not an absolute requirement.

Yes, Chuck is God, Jess is Jezus and Dr. Ting is the holy
spirit!

>>Procedures/functions will need local
>>memory so they will need some sort of stack mechanisme.
>>It's also very inexpensive, just decrement the stack pointer
>>and push the instruction pointer.
>
>Sucks for passing data on the stack.

Everything is cachable in this world. I'm just saying that a
stack is needed. See it in a more abstract way.

>And of course the programmer is no longer  in charge. The compiler writer is.

Yes and the programmer lives in an easier more abstract world.
Only bit-fuckers don't like this. Believe me, I probably know
more assembly languages than you, have used them and have
written more disassemblers, assemblers and compilers for them,
but it has always been my conviction that programmers should
waste their time as less as possible writing in assembler.

>I have spent many an hour when designing in C discussing
>what the compiler might or might not be doing to our code.

You shouldn't have to discuss that. When you're an application
programmer just trust the compiler and go for portability.
When you really need the most optimum speed out of your
hardware, look at how the compiler has translated things
and rewrite those parts in assembler or rewrite the compiler.
Been there, done that.

>>When you want you can
>>also use a frame pointer but for C it's not strictly needed.
>>All displacements on the stack (compared to the stack
>>pointer) are always known.
>
>At the compiler level. God forbid you might have to interface some
>assy language to this kludge.  Can be done of course. Just bring
>big buckets of $$$$$$.

You're thinking of CISC. In RISC, the SP isn't changed
within a function. The compiler can provide variable names
for the variables that are easily usable on the assembler level.
The compiler/assembler combination that I used (and wrote
myself) did that. It was for the 6811. But I managed to write
almost everything efficiently in C. Only taskswitching and
interrupt handling required some (in C embedded) assembler
statements.

But the 6811 is a very easy processor to write a good C
compiler for.

>I LOVE C.

C is the optimum in a certain class of languages (C, Basic,
Algol, Cobol, Fortran, Pascal, PL/1 etc.).


Groeten/Greetings,
Jaap

-- Chip Directory
-- http://www.chipdir.com/chipdir/
-- http://www.fh-kl.de/~rscherer/chipdir/ - New in Germany
-- And about 30 other mirror sites world-wide...
--
-- To subscribe to a free 'chip issues, questions and answers'
-- mailing list send a message to listguru@fatcity.com with
-- in the body subscribe chipdir-L