Sign up
Forgot password?
FAQ: Login

Machanick P. Mips2C: programming from the machine up

  • pdf file
  • size 4,15 MB
  • added by
  • info modified
Machanick P. Mips2C: programming from the machine up
Grahamstown: RAMpage Research, 2015. — 352 p.
Programming in managed C# takes a lot of pain out of programming, but also takes away the need to understand at a deep level what is going on. Often, that is good enough. Memory languages like Java, Python and You just want to get the job done with minimum pain, and with minimal chance of programmer error.
By “managed-memory language”, I mean one where you do not have to deallocate memory explicitly. Such languages also often include large libraries of carefully-worked-out data structures and algorithms, so you don’t have to code these rather basic things from scratch.
Why, anyway, would anyone want to get rid of such conveniences as automatic memory management, high-level abstractions of data structures and classes with inheritance? There are times when extreme efficiency is a concern, such as programming a very small device, or where a task has to finish within a predicted time.
Don’t most computers you buy today have multiple cores running at over 2GHz and RAM measured in Gbytes? Wrong. Most computers sold today are very small devices that are part of another machine. There are obvious ones like MP3 players, that you would know are in essence a scaled-down computer, and slightly less obvious ones like a home ADSL router. But small computers are part of many other things in less obvious ways – washing machines, cars, smaller home appliances – to quote a few examples. When a computer is part of another machine, it is called an embedded system and embedded systems may have severe cost and power-use constraints. What’s more, they may have to continue running unattended for years in the field, so they need to be simple and robust – and not run out of memory or processing speed because of minor efficiency issues.
What of systems where time to complete is critical? A real-time system is one where specific tasks have hard time limits. A hard read-time task is one where failure to complete in time means the system is broken. Think anti-lock brakes on a car. If the computer controlling the anti-lock system doesn’t react in time, the system is flawed. A soft real-time task is one where there is an acceptable failure mode if you run out of time. Think digital TV that pixellates when the signal is lost – quality suffers but to a point you can tolerate that sort of failure.
While real-time and embedded systems can be programmed with managedmemory languages, there are times when efficiency and timing predictability are important enough to justify a language close to the hardware so you know exactly what is going on without a few layers hiding how things work from the programmer.
  • Sign up or login using form at top of the page to download this file.
  • Sign up
Up