From: Eleanor McHugh Date: 2008-07-11T23:51:00+09:00 Subject: Re: Why Ruby interpreter is writed in c (not in c++)? On 11 Jul 2008, at 15:23, M. Edward (Ed) Borasky wrote: > Eleanor McHugh wrote: >>> All system-level engines are written in C, not C++. C has been a >>> Standard for much longer, and has more compliant compilers. So any >>> engine that wants to run on the widest number of platforms must >>> use C. It compiles for everything from wristwatches to Mars Rovers. >> It may well compile for them, but there are systems where even diet >> libc would be too heavy a runtime requirement which is why many >> embedded applications still use assembly language. > > There's also another light-weight libc -- I forget the name, but > there is a whole "buildroot" toolchain as well for embedded systems. > Then, of course, there's Forth, which usually has an assembler built > in. Not to mention Forth can be compiled to a very minimal memory footprint if necessary - even with OO extensions. >> The point of OOP is that it cleanly encapsulates code and data to >> form discrete black boxes. This makes it easier to design complex >> systems and ideally reduces the volume of code which has to be >> remembered. This can have the added benefit of enabling rapid code >> changes, but it's by no means the main advantage. >> The slow uptake of C++ for system-level coding owes much to the >> historic poor performance of compilers in optimising virtual >> function calls and the memory footprint of the runtime. In recent >> years both considerations have become less important, but in the >> embedded sector there is still a preference for assembly language >> and imperative languages such as C or BASIC. > > There actually was a time when even the use of C was in doubt for > embedded systems. An awful lot of Forth, Pascal, PL/M and assembler > code was written before C compilers were good enough. Now, of > course, the C compilers are good enough to build a high-performance > Forth environment in C. :) Heretic ;p Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason