KThunder wrote:
have you done any programming? assembly or otherwise?
Be serious. You have been a member of A.org for as long as I have, and that means you should know at the very least that I know my way around a C-compiler. In my case, SAS/C, AztecC and gcc.
I can also code in MC680x0 assembly, and did spend a few days in 80x86 when I had to circumvent several copy protection mechanisms. It was fun writing code for a CPU which resembles a stackmachine, although the general shortage of registers is annoying after a while. When I was a small Cymric, I learned Z80-assembly on my Schneider CPC464, although I was too young and inexperienced to make full use of it---that would now no longer be the case.
I have coded my own 'bare metal' demos on the Amiga. I have programmed dozens of utilities over the course of my PhD in order to analyse data. I have coded server-side web utilities to (ab)use CGI. I have quite some experience with compiler construction (as I find the concept of programmable virtual machines intruiging), and will delve into the mysteries of automatic memory management once my thesis is out the door.
I may not be a skilled programmer, and I certainly don't make my living from it. But I do know enough to understand what it takes, and to hold my own for a while amongst professionals.
all compillers produce slightly different code, some are more efficient than others but none is as good as hand coding.
That was the case a decade ago. Nowadays the effort of streamlining the code produced by an optimising compiler does not outweigh the time you gain by doing it yourself. You also get higher-level expression syntax, maintainability and readability nearly for free. Those are
exceedingly big plusses in my book.
some of us actually like assembly coding. with assebly you can conrol exactly how the machine runs in every respect.
That is valid argument, and if you prefer the smell of bare metal, I'm not stopping you. But that doesn't mean I have to agree with the choice of you working in assembly for a certain project. And that's precisely what I'm doing here. For some things you still need to resort to assembly language simply because they don't have a proper higher level-equivalent---things like setting up the CPU in the proper 'mode', controlling the FPU-settings, bus communication, and so forth. Those are the fun bits too. But once those routines are in place, let the compiler handle the chore of translating your ideas into assembly language.
actually operating systems are alot better if written in assembly or c, c with inline can be quite good if used carefully.
I don't know of many operating systems which
don't use a mixture of assembly and C.
all compillers produce the same code that humans would using the generalizing effect of different commands since they get their info from us. you talk as if they are artificially intellegent or something.
To some extent they are: we've programmed their logic, after all. They are as good as the ideas which go into them, and by now, those ideas are quite good. But they
excel at one thing: doing the same thing over and over again. They don't get tired. They don't get sloppy. They do the job as we tell them to. If I take a look at
this list of tips which I need to keep memorized while coding in assembly to make sure that things remain efficient, my first gut instinct is: let the computer handle this. Especially in the case of timing loops and bus accesses. If I'm working on an idea, I want to see that idea working, not be bogged down in the details of
how I should implement it.
Compilers suck at global optimisations, but that's the job of their human masters, really. A compiler cannot look at the code and tell the programmer 'Lookie here now: you're coding B-trees, but isn't a skiplist or hashtable better suited for your needs?' Compilers don't guard against bad algorithms.
ad btw it doesnt take extraordinary amounts of effort. for small projects and anything that works in an environment it usually takes less. since you dont have to worry about what library files etc will do with other programs and what ou are doing. you just write the code you want to write.
Sure. Only with a higher-level language it goes much, much, much more quickly.