The high level language conspiracy.

vapourmile · 6839

Offline vapourmile

  • ZX80
  • *
    • Posts: 17
on: April 05, 2009, 03:01:40 pm
Nobody these days seriously considers programming substantial applications in Assembler. Why? I once asked a professional C++ programmer this questions, he said "Because I'd have to write all the device drivers myself, it would be horrible".

So, what he's saying is, to him the thought of low-level programming is horrible. Device drivers can be accessed through library's, and they can and are likely themselves to be written in C, the systems programming language, but to program entirely in assembler cannot be separated from writing device drivers as Assembly itself is essentially the base-level device language. All substantial assembly language programs are classed as device drivers of sorts. The assembly language code 3D games designers use to speed up rendering cores are essentially ways of intervening on the portions of the video device driver code which would normally be addressed via a high level interface. DirectX is essentially a 3D video hardware device driver, designed to protect programmers from the vagaries of different 3D hardware low-level designs. The theory is, it lets you get on with designing your software, without having to think too hard about the hardware.

Excellent... isn't it?

Back with my friend and his dislike of device drivers with an assembler product, especially if it's 100% assembler, you have to think about the hardware. In fact, you have to think about the hardware most of the time because you're using it all the time. Assembler language itself is usually, with very rare exceptions, a hardware issue. The hardware being the aspects of your computer environment you cannot change using software.

But, doesn't this imply, one of the important issues which are at stake if you choose a high level language, which is so much of what is not hardware, can be made different with software. If you use a third party device driver, you forfeit some of what you can change. If you program for an operating system, in particular, you lose the right to change a great deal. Is having almost every program on your desktop looking almost exactly the same as all the others something to celebrate? Is it good that the look of these programs is decided not by the users, nor by the software designers but by a single operating system supplier? Just how much of your screen space was designed not by you, nor by the makers of the software you're using, but by one company, right down to that little Microsoft(tm) logo there in the bottom left hand corner on the Windows(tm) start button? Are then high-level programmers among the group of people involved in design least likely to say "Things don't have to be this way"? because they're so accustomed to outsourcing so many of their decisions they don't stop to wonder how things could be if they didn't? Of course, they may stop to think for a long time about how things could be different if they coded those other things themselves, but they don't, because programming the hardware would be horrible. Right? I mean, you know, from experience, just what it is like to program the hardware?

No? Well, how do you know what it's like?

Actually, I can program the PC in machine-code and I can tell you, it is pretty awful.

The thing about programming the hardware is that it is the level of the most powerful, most fundamental decisions on what you, the computer owner, can actually do with your computer. Has it ever occured to you just how much power you are giving away by conspiring to trust all that power to an outside source?

Just how big are Microsoft right now? Did it occur to you that the reason they have got so big is down to one simple fact: They know how your hardware works and you don't. Furthermore, so many people are put of by just how horrible it would be to learn how their hardware works that nobody does and Microsoft have no serious competition in that area at all.

Who do you think really pushed the whole idea of just how difficult and horrible it is to program your hardware? Intel did. Just after they lost their world-famous court battle with AMD who had duplicated their instruction code and made compatible CPUs, a loss which is still costing INTEL Billions of dollars. Before that Intel would happily send books of their instruction codes out to potential programmers for free from their HQ in America, I know, because I wrote to them about it and they sent me one.

Here is a quote from an Internet blog from a graphics hardware expert:

"I keep my copy of the Savage3D's register and hardware spec close by, to remind me how unlikely it would ever be to get similar documents for a modern GPU".

If you don't know how a piece of hardware works, that's good for the manufacturers because they keep control of it. It isn't good for you. But they are happy to tell you it is. They want you to be in the dark about the business-end of your computer because it protects the business-end of their business, which is to take a huge financial advantage of knowledge you do not have access to.

So take their advice: Don't go round learning the low level details of your hardware because it's boring, it's hard to learn and you don't stand to gain anything from knowing. Look at Bill Gates, it never did him any good.

Why bother to learn how your CPU works. After all, what's it done for Intel?

Better to just keep on learning what the worlds most powerful people tell you to.


http://www.intel.com/pressroom/archive/releases/20050111corp.htm



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #1 on: April 05, 2009, 09:36:43 pm
Love it mate... that is so true..

Though (and there is always one of them) high level languages do have a couple of plus's - rapid app development and easy portability.

Though I also agree that the use of high level languages has hidden the nuances of the system away from the programmer.. this can be a good thing sometimes though LOL

Coding for the love of it!


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #2 on: April 06, 2009, 12:08:16 am
I think there are places for both higher and lower level languages although I think the latter is becoming less and less useful. A good example is Warhawk DS, since the ARM has a fairly basic instruction set and to do things it's mostly pushing bits into hardware registers it's actually a great platform for coding in assembly. Same can be said with the old consoles and you know that running your app on one machine will do the same on another which can't be said for PC's.

I just don't think it would be advantageous to any Windows programmer to code in pure assembly. I am a fan on .NET for example, and being a JIT compiled language you can run a 32-bit version of your program on a 32-bit machine and a 64-bit version on a 64-bit machine. Something you could never dream of doing using assembly or even C/C++ without compiling two different versions. Also the usefulness of namespaces that take away the need to write code for common everyday tasks cannot be underestimated. Think of writing an app to copy files from one directory to another. You would have to write a routine to break up a file path into pieces, recursively read each file and then contatinate the filename to the new directory and then perform the copy. In .NET this is simple to do in a few lines of code, in assembly it's not unless you have years of writing assembly and have built up your own library of routines.

The thing is there are just too many different types of hardware and issues with software compatibilty and legacy issues that writing in assembler is going to create more work for you in the long run. These days is just doesn't pay to code in assembler. Now with the enormous mobile phone industry in front of us, there is a perfect opportunity to bring back assembly. But again, you have portability issues which is why with SDK's such as Android the language is Java not even C/C++ let alone assembler. So industry is moving away from assembly whether we like it or not, so as a programmer we have no choice but to follow. Personally I would prefer .NET but since this is Google's baby obviously Java would be their better choice. I believe the reason they choose a higher level language is so more people are capable of writing software for it, otherwise you limit your platform to code junkies. It is a shame they don't allow for different languages but I guess it makes sense to choose one.

Going back to the example of Warhawk which is written in 99.9% assembler we learn more about the hardware than you ever could from using something like libnds. Similarly with something like PALib you are obfuscating what the hardware is capable of but at the same time making it easier for new developers to do what they want which is write an app that does something. They don't necessarily want to know how the hardware works even if it makes you a better programmer.
« Last Edit: April 06, 2009, 12:13:22 am by headkaze »



Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #3 on: April 17, 2009, 10:51:44 pm
I have to admit that I agree on both sides here...

A good example is "WANK"....

To have coded that on the DS (or PC) in ASM would have been a MAJOR undertaking, and HK has done such a wonderful job in such a short amount of time (though lesser C coders would have taken weeks).

The main point is that everything has a place. It all depends on what you want from your code..... even ID will use ASM when it is needed (recently doom 3 btw)....

ok... gotta run "STEAK" :)

Coding for the love of it!