Re: Download counts of assemblers.



På Fri, 05 Jan 2007 04:38:42 +0100, skrev David Jones <ncic@xxxxxxxxxx>:

//\\\\o//\\\\annabee <Free" <Wannabee@xxxxxxxxxxxx> wrote...
På Fri, 05 Jan 2007 03:08:59 +0100, skrev David Jones <ncic@xxxxxxxxxx>:


> However, I would definitely agree that beginners don't really care about
> the distinction between Betovian "pure" assemblers and "high-level"
> assemblers. Nor should they.

Its likly true that beginners dont care, but they really _should_.
The diffrence is much like the diffrence between SkyBucks insane or/xor
library and a real library.

You could write something that bad in either a compiler or assembler.
The name you use for the thing that converts your source files to object
code has little to do with it. Do you really think SkyBucks would have
written something better in assembly as opposed to Delphi? :)

:) Which remind me. For some time, I used to clear a flag like this:

mov eax Flag | not eax | and D$Destination eax

later I figured out I could declare a NOT of the flag

[NOT_FLAG 00_111101]

and so I did "and D$Destination NOT_FLAG"

but now i use just "and eax (NOT flag)" using the RosAsm NOT operator.

The latter is "better", but this has null relevance as to how fast the code runs.
Sure, maybe it does, but it has no relevance to the overall perceived runtime of the spesific code that I wrote. And not in anyway will the user ever know. When code runs slow, I find out the real reason, and then I try to redesign it so that it will run faster. In 3 years, this has been needed something like 4-5 times, for smaller portions of the code.

I refer to RosAsm BU_ASM (strategic optimization) for details.

Even C programmers knows of strategic optimizations. This is since long considered the only real worthy optimization, and it really is. So why does C programmer turn around when facing code optimizations? Because you can speed up an inner loop by 2-5 times using code optimizations. E.g possibly draw 3 millions lines instead of just 2 million. Yes, ok, you maybe really could, and maybe even do better like 5 million lines. But how many places in a full application do you find such intensive inner loops worthy of the extra work?

Answer : VERY FEW!!!

Should we take those very few cases, and generalize that to all of asm programming?
Should we consider them at all? Yes I think we should consider all things that makes sense. This is not my argument at all. But we should not make the _FAULTIVE_ suggestion that all of asm programming is as hard as optimizing this one or two inner loops, because _IT AINT SO_. Not by a long shot.

And that is the REAL diffrence between asmers and C people. Asmers knows this. And C programmers do not. Seems even Herbert doesnt know, which I cringe at, because he should know it. The guy has invented an assembler and a syntax of his own. How the flying spagetti could this fact escape him??

So what I am saying? 99% of all asm programming is easy, not involving any codelevel optimizations at all. And the guys that think so, are just plain wrong.

The diffrence is like the one I mentioned with the GDI api above. This
library is written in C, and no kind of asm will make it an iota better.
If you dont understand it, it can be made worse, but never better. Because
the design is so absurdly HLL thinking. It is bound to C. Only way to make
it any better is to not use it.

This is the diffrence between HLA and asm. HLA has a library that is
written in C. This library is the only reason why anyone would bother with
HLA at all, as HLA need FASM, so otherwise, they would just use FASM
directly, no?

With a high-level syntax, beginners can ease into the language by
reusing familiar constructs. You don't teach someone how to speak
French by doing all the instruction in French right away, do you? If
the student can already speak English, you typically start off by doing
most of the instruction in English but focusing on small bits like
isolated words (aka: vocabulary) and overall structure (aka: grammar)
and gradually build up. Students don't become fluent overnight.

Imagine if a beginning French student was faced with an instructor who
only spoke French in the class from day one! A few students would be
motivated to learn it faster, but I would expect the vast majority to
drop the class.

If this technique works for natural language, why is it such a terrible
thing for a programming language?

The best way to learn a foreign language is to go and live there, and spend time with people who speaks the language. Better schooling in a languge does not exists. The partial way of learning a few words is possible but the result is what makes all the priminsters of norway look patetical when they have to speak english in public.

To learn a language well, you need to speak it frequently. And to learn to program you must program in the language of the computer, and learn from your mistakes. What you learn in schools are to _dabble_ with languages.

Yes, computers can do math, and math has spesific rules that are clear and consise. But its not that way with all of programming. Computers are much to complex that you can device a formula for every program you have not yet written. You can learn some basics this way. Thats about it.

(Now, experienced programmers is a whole 'nother matter entirely.)

If you write the same thing over and over, you will get experience in that area. But you will be a beginner in 1000s of other areas, still. And there are still millions of areas for which there arent any experience yet achived, at all. And there are also likly millions of ways to achive the same thing, in more efficicent and richer (better utilizing) ways. Espesially now that the hardware limitations become less and less. Sometimes I think people forget this. Having no limitations imposed by hardware is a _good_ thing. Theres many ways to be creative outside of having to figure out how to spread a large database across 64K segments.

The problem is that a library written in C has overheads that no assembly
writer will ever consider or incur themselfes.

Um, yes, a beginner can actually write code with more overhead than a C
library would contain. Do I *really* need to mention a 2-3 page
integer-to-string function written by a certain someone when they were a
beginner? ;-) <grin>

Well, it was a first time. And I have to remind you that it was 4 times faster then the Delphi one? For a beginner? You forgot that detail did you not? And you know what, I still use it with great pride, because it works and because it has NULL negative effects on the programs I write this far. Because of it, I can do things like this:

rdtsc
IntegerToString64
mov eax D$eax
showme eax

If I ever need faster one, I write a faster one, or just locate Wolfgangs slow one, which is 64 times as fast as the Delphi one....

The best he could do, was
to make his code run at the speed of the library. He cannot improve it.
And even a beginner asmer would improve any library on earth, if he had
written it himself, for the simple reason that he would not even add a
single useless overhead, because his implementation would be spesific to
the task at hand.

Again, you can't compare beginners to experts. Beginners can add
useless overheads because *by definition* they are inexperienced.

Those will much likly be of the kind I mentioned above. Insignificant to the program from a users perspective.

And I don't mean just performance-wise: A typical "useless overhead" I
saw when I was in university was pushing all the GPRs at the top of a
function and popping them all back off at the end... regardless of
whether the registers were actually used. And don't even get me started
with indirect addressing (pointers)! Their code was easily double the
amount actually needed to get the job done.

There are places where pusha is stupid, and there are _many more_ places where it makes sense, or at least doesnt hurt. The showme macro for instance push all regs, but this has no possible serious effects

pusha is 60 (1 byte) and pushes all regs

push eax (50)
push ecx (51)
push edx (52)

For a macro that is calling to an API for showing a messagebox, pusha seems to me more intelligent then beeing pedantic. Because it doesnt make any diffrence from the user perspective in this case.

But as we all know, using windows, there are real (insane) overheads comming at the userside for allmost all applications.

ever tried to figure out how much of a penalty 10 seconds causes when multiplied by the users? 101 manlives! if we consider 70 million users, which is now a very low estimate. Now try to imagine how many seconds are lost each time you reinstall your OS, and has to reinstall (uneedingly) all the sheep applications that each comes with its own (uneedingly) stupid installer. Plus all the other settings you must tweak. Just starting many applications takes seconds. Delphi takes 7 seconds to start on my AMD 1800. RosAsm is instant on all my hardware.

the only thing that matters is usertime. And I consider it unethical to waste even a second of usetime _if_ it can be avoided. And this I learned from Beth. And I agree.


Beginners are the biggest cargo-cult programmers, IMHO.

Maybe, if I know what that ment.



Now once the asmer beginner wrote his first
implementation, he can go on an improve for as long as he wants. But in
most cases, even his first code will be better then the C code, because he
will only care to write in what he needs, the logical and fastest way.

Beginners don't typically care about performance, nor should they. When
you learn to play the piano, you have to master scales before you move
on to concertos. Similarly, a beginner has to learn the instructions
before worrying about how fast it runs.

Asmers in general allmost never have to worry about how fast things run, because in the overwhelming cases, it runs fast enough. Those cases are _exceptions_ even to experienced programmers. (in the context of full asm applications). What you say also doesnt make sense in an other way. beginners (they way you seem to understand this word) does not even know of writing cases that needs optimizations.

Now, you could mean "fastest" in terms of writing the code instead of
strictly performance. In that case, calling a library function is way
faster -- call xxxxxx. :) There's no sense in reinventing the wheel
before you learn how to invent the wheel.

theres EVERY reason to reinvent lots of APIS (not wheels). This is also beeing done, by the designers, all the bloddy time. Each windows comes with a commersial saying "faster then ever before", but this is not the reality. While the CPU runs faster, the OS runs allways slower then the last one. It seems that games writers are amoungst the few that are able to write really fast code.

Strange is it not, how C compilers get "better" and "better" and the code they produce gets "faster" and "faster", but next to all program written with them performs so poorly. It is because the speed of a single API doesn not scale up, because of the lack of strategy, and spesifics that full asm application will have by default in all but a few cases.


David

.



Relevant Pages

  • Re: [EGN] Hoisting Loop Invariants (Was: Re: [EGN] Numerical Accuracy)
    ... outdated language, for manual optimization. ... > such as moving loop invariants outside of loops is not unmaintainable. ... > code might be trivially faster (one of your favorite micro optimizations ... > used programming language on the planet. ...
    (comp.programming)
  • Re: Beyond CL?
    ... around in the internals of the language. ... as the programmable programming language; ... Eventually a bank of many users' optimizations could be ... approach the fabled "sufficiently smart compiler". ...
    (comp.lang.lisp)
  • Re: Beginner needs help choosing microcontroller platform & software
    ... The embedded market covers the a very wide range of customers. ... The IsoPod is applicable to all, but is not limited to, the following: ... Rank beginner who is willing to sit down, learn forth, and program in an ... My experience includes programming in C, assy on the 6502 & PIC, C on the ...
    (comp.robotics.misc)
  • Re: Whats the best language to learn...
    ... Make a beginner learn C as his first language and he will struggle ... to learn good programming for YEARS to come. ...
    (comp.programming)
  • Re: Optimization for OOP
    ... programming language. ... of possible optimizations that can be performed on the code. ... language runs on a virtual machine. ... then they never override it anyway. ...
    (comp.compilers)

Loading