Date: 09 Jan 2002 20:24:27 -0800 From: swear@blarg.net (Gary W. Swearingen) To: Terry Lambert <tlambert2@mindspring.com> Cc: freebsd-chat@freebsd.org Subject: Re: Use of C++ with kernel and in embedded software. Message-ID: <qq7kqq25qc.kqq@localhost.localdomain> In-Reply-To: <3C3CCB0B.76178BF1@mindspring.com> References: <g3bsg31a6s.sg3@localhost.localdomain> <3C3CCB0B.76178BF1@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert <tlambert2@mindspring.com> writes: > The upshot of this is that the linker > does not expect to link C and C++ code together, so you have to > compile everything with C++ symbol decoration, or make specific > glue modules for the symbols to resolve correctly. So if I want to ship a system with a lightly-customized (picoBSD?) kernel and some totally custom C++ modules and drivers, can I have module initialization code or something do the mysterious C++/class init stuff and compile everything with C++ sysbol decoration (which I assume gets stripped out after linking)? If so, how would I learn to do it? Would available FreeBSD/Linux/Unix programming books give enough clues? > It depends on what you mean by "embedded". For the strictest > possible definition, almost zero code is written in Java or C++ > or languages other than assembly, Forth, and C. For less strict > definitions, you could use FreeBSD or Linux as an embedded OS, > and then the amount of code depends on what the project is (with > Perl probably beating C++ out by a wide margin). You suprise me with that "almost zero"; there's no reason I know of that a custom no-OS/mini-OS program wouldn't better be written in C++, but I trust that you know actual practices better than I. That's why I asked. I had in mind all of your definitions. Basically, software that ships with the hardware it runs on, which won't be changed by the user. But presumably most often either a single compiled program running off hardware interrupts (using custom or off-the-shelf mini-kernel) or a few compiled modules or programs running under FreeBSD or Linux. I suppose the definition streaches to include multiple programs and databases on multiple computers, etc., like I once worked on, but hardly considered "embedded"; not sure why not. > The problem with C++ -- and Java -- is the same as the problem > with C: it permits you to get around some of the protection > mechanisms which are supposedly your reason for choosing the > language in the first place. But of course its nice to have the option of protection mechanisms which are more easily enforced by C++ code review than reviewing C code for unsafe code. (I'm guessing.) And there's many other benefits. > Learning C++, you will effectively learn C, as well, so you > might as well know both. Yeh, that's what I thought, but I'm now thinking that if I'm going to go after an embedded software job I'd be silly to work on the language which has fewest jobs and takes way longer to learn well (and my time is running short). It would also probably be better to develop some skills with actual (FreeBSD) device drivers which, in C++, is apparently quite awkward and little done. > As far as the job market goes, though, the majority still require > C, rather than C++ or Java, though you can sometimes get paid a > premium for Java, I did a very little Java GUI programming and liked it, but have ruled that out as too tied to M$Win (around here anyway), too likely to be booring and repetitious, too likely to become unpopular, and too little used in embedded software. Thanks for your input. I think you confirmed that C++ won't be nearly as marketable as C (in embedded software jobs), but you didn't convince me that I should learn (and practice) C++ anyway, for now. As I write this, I seem to have already lost all doubt in the matter, but I'll keep reading this thread and I guess I should look at some job advertising which I haven't done for a long time. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?qq7kqq25qc.kqq>