Andrew Reilly wrote:> On Thu, 06 Jul 2006 05:21:24 -0700, Rune Allnor wrote: > > > > > Martin Eisenberg wrote: > >> Rune Allnor wrote: > >> > >> > The one language that springs to mind is Java. Are there others? > >> > Does anybody have suggestions for first-read books or other > >> > literature for C++ programmers to learn Java? > >> > >> Eckel's Thinking in Java is nice and free: http://mindview.net/Books > >> However, it seems Java needs a third-party COM bridge. I wonder why > >> C++ doesn't already fit the requirements in your eyes? > > > > First, because C++ needs a commercial compiler to generate executables. > > I don't want to install my own compiler on somebody else's system, and > > I can't always bring my own laptop. Second, because it would need > > something like Qt (www.trolltech.no) to become portable. Which means > > lots of $$ spent. > > I apologise for having missed the guts of Rune's original request, but > from what I saw in the other half-thread, I have a question: why do you > need Qt,I like Qt for porting C++ GUIs between platforms. But right now, I need something that's able to handle GUIs as well as complex tasks, and is available for free.> if you're doing numerical work on CSV files for import/export to > Excel? Ordinary ANSI stdio is perfectly adequate for that, and portable > too. Obviously there was more to the query than I saw...I need to make a program to be able to handle some book-keeping, file checks, format conversions and so on. Right now I do all of that manually. The end product of my job is, by specification, excel files.> Not that there's anything wrong with Qt, from what I've read, but you do > have to pay them if you want to ship a closed-source binary.Yep. My main interest in Qt is that the ambition is to get GUI source code to be portable between Win/Linux/Mac/PDA platforms. And that the developers are Norwegians.> > Having said that, Java would be the quick'n dirty get-things-up-and- > > running-fast method. There might be a more elaborate C++ version > > of the programs I have in mind, down the road. > > > > Java is already available on most computers. If I could make it play > > my tunes... life would all of a sudden become a lot easier. > > I've only recently started using Java. I like it a whole lot better than > I ever did C++, and it comes with a pretty reasonable GUI toolkit that you > seem to be after. And it's free. I'd stick with that.Yep, that's what I thought.> I also disagree with your comments about GCC. It's a very fine compiler > (suite), these days, and increasingly standards compliant.It wasn't last time I used it, in -96.> I only use > it's C, though. Not much of a fan of C++ any more, and GCJ doesn't seem > to be quite ready for prime-time, but it's getting close. > > You might also want to investigate Eiffel, both Meyer's (ISE's) original, > which is now somehow open-source, I think, and also INRIA's SmartEiffel, > which compiles via ANSI C. Vastly nicer object model and syntax than C++, > beter large-system software engineering support and (I think) a couple of > cross-platform GUI toolkits these days. I like it on aesthetic grounds, > but I have too many reasons to stick to C to use it in anger, just yet. > > Cheers, > > -- > AndrewRune
OT: Nomad programmer needs tools
Started by ●July 6, 2006
Reply by ●July 6, 20062006-07-06
Reply by ●July 6, 20062006-07-06
Rune Allnor wrote:> Martin Eisenberg wrote: > >>Rune Allnor wrote: >> >>>Martin Eisenberg wrote: >> >>>>I wonder why C++ doesn't already fit >>>>the requirements in your eyes? >>> >>>First, because C++ needs a commercial compiler to generate >>>executables. I don't want to install my own compiler on somebody >>>else's system, and I can't always bring my own laptop. >> >>What do you mean by "commercial"? GCC is not a bad compiler, and in >>case you think otherwise, the fact that it's under the GPL puts no >>restrictions on your own executables (but remember, IANAL). > > > GCC have made my life so miserable over the years you wouldn't > believe it. Every day I can stay away from GCC is a good day. > GCC may be free, but it is anarchy-in-a-can. With GCC, you get > exactly what you pay for. >That's interesting. I would class gcc as 'amateur' in the sense of 'better than the mercenaries who get paid to do it'. Probably half of the embedded toolchains that I've worked with are based on the gcc compiler and they all work better than fine. I've run into very few quirks of gcc that can't be overcome by sticking to the ANSI C++ definition, and no more (often less) than would be found with Borland or Microsoft compilers. Certainly I've worked with some commercial embedded toolchains that made me really wish that there was a gcc port for that particular processor! -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●July 6, 20062006-07-06
Tim Wescott wrote:>> > That's interesting. I would class gcc as 'amateur' in the sense of > 'better than the mercenaries who get paid to do it'. Probably half of > the embedded toolchains that I've worked with are based on the gcc > compiler and they all work better than fine. I've run into very few > quirks of gcc that can't be overcome by sticking to the ANSI C++ > definition, and no more (often less) than would be found with Borland or > Microsoft compilers. Certainly I've worked with some commercial > embedded toolchains that made me really wish that there was a gcc port > for that particular processor! >Indeed - I've use commercial tool chains that cost �7k/seat that were so buggy as to be virtually unusable. gcc is flawless, by comparison. Paul
Reply by ●July 6, 20062006-07-06
On 6 Jul 2006 04:35:04 -0700, "Rune Allnor" <allnor@tele.ntnu.no> wrote in comp.dsp:> Hi all. > > The last few weeks have revealed that I need to learn a programming > language that fits a nomad lifestyle. By "nomad" I mean > > - The code needs to be portable to most/all relevant OS/HW platforms > (Windows, Mac, Linux) > - Compiling the programs ought to be possible without major amounts > of $$$ spent on compilers > - The programming language needs to be able to handle complex data > structures and objects > - The programming language should be clearly defined as a *language*, > not a shell script, that could be confused for an OS add-on by > owners of computer systems > - The programming language ought to be able to handle COM objects > to manipulate excel files and word documentsWhat Excel files and Word documents on Linux, Solaris, UNIX? For that matter, what COM objects on these platforms?> - The programming language needs to be easy to learn for me, who is > familiar with C++ > > The one language that springs to mind is Java. Are there others? > Does anybody have suggestions for first-read books or other literature > for C++ programmers to learn Java? > > Rune-- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://c-faq.com/ comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
Reply by ●July 6, 20062006-07-06
Tim Wescott wrote:> Rune Allnor wrote: > > > Martin Eisenberg wrote: > > > >>Rune Allnor wrote: > >> > >>>Martin Eisenberg wrote: > >> > >>>>I wonder why C++ doesn't already fit > >>>>the requirements in your eyes? > >>> > >>>First, because C++ needs a commercial compiler to generate > >>>executables. I don't want to install my own compiler on somebody > >>>else's system, and I can't always bring my own laptop. > >> > >>What do you mean by "commercial"? GCC is not a bad compiler, and in > >>case you think otherwise, the fact that it's under the GPL puts no > >>restrictions on your own executables (but remember, IANAL). > > > > > > GCC have made my life so miserable over the years you wouldn't > > believe it. Every day I can stay away from GCC is a good day. > > GCC may be free, but it is anarchy-in-a-can. With GCC, you get > > exactly what you pay for. > > > That's interesting. I would class gcc as 'amateur' in the sense of > 'better than the mercenaries who get paid to do it'. Probably half of > the embedded toolchains that I've worked with are based on the gcc > compiler and they all work better than fine. I've run into very few > quirks of gcc that can't be overcome by sticking to the ANSI C++ > definition, and no more (often less) than would be found with Borland or > Microsoft compilers.To put a long story short: I was learning C "for real", used GCC since it was free, available everywhere and all that. I knew nothing about ANSI C or ISO C. I probed my way forward, tried something, saw that it gave the result I wanted, accepted that what I had tried as "OK" and went on to the next challenge. At some point I ported my code -- which was a stated delivery in my project -- to some computer where the C compiler (not GCC) by default was set to ANSI C mode. All hell broke loose. Hardly a single line of my previous work, which had taken me six months to make, survived the ANSI C compiler. Some of my blunders were really horrible, but GCC had accepted them. It took me another four months to sort out the blunders. My contract was for 12 months.You do the maths. Rune
Reply by ●July 6, 20062006-07-06
Jack Klein wrote:> On 6 Jul 2006 04:35:04 -0700, "Rune Allnor" <allnor@tele.ntnu.no> > wrote in comp.dsp: > > > Hi all. > > > > The last few weeks have revealed that I need to learn a programming > > language that fits a nomad lifestyle. By "nomad" I mean > > > > - The code needs to be portable to most/all relevant OS/HW platforms > > (Windows, Mac, Linux) > > - Compiling the programs ought to be possible without major amounts > > of $$$ spent on compilers > > - The programming language needs to be able to handle complex data > > structures and objects > > - The programming language should be clearly defined as a *language*, > > not a shell script, that could be confused for an OS add-on by > > owners of computer systems > > - The programming language ought to be able to handle COM objects > > to manipulate excel files and word documents > > What Excel files and Word documents on Linux, Solaris, UNIX? For that > matter, what COM objects on these platforms?Ah, sorry. Right now I need to work with Excel and MSWord on the PC. But I want to use a portable language. I'm too old and jaded to learn more programming languages than absolutely necessary. Rune
Reply by ●July 6, 20062006-07-06
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message news:1152205381.516860.37270@75g2000cwc.googlegroups.com...> > To put a long story short: I was learning C "for real", used GCC since > it was free, available everywhere and all that. I knew nothing about > ANSI C or ISO C. I probed my way forward, tried something, saw that > it gave the result I wanted, accepted that what I had tried as "OK" and > > went on to the next challenge. > > At some point I ported my code -- which was a stated delivery in my > project -- to some computer where the C compiler (not GCC) by default > was set to ANSI C mode. > > All hell broke loose. Hardly a single line of my previous work, which > had > taken me six months to make, survived the ANSI C compiler. Some of my > blunders were really horrible, but GCC had accepted them. It took me > another four months to sort out the blunders. My contract was for 12 > months.You do the maths. > > Rune >Rune, I suppose you know by now that GCC can be set by something like "-std=......" to be limited to the form of C that you want - or something close to it? It sounds like your issue is more one of assuring portability than one of selecting a particular language. Since you already can program in C or C++ then I'd look at "portability" things with Google. That's a frequent topic. Fred
Reply by ●July 6, 20062006-07-06
Rune Allnor wrote:> Tim Wescott wrote: > >>Rune Allnor wrote: >> >> >>>Martin Eisenberg wrote: >>> >>> >>>>Rune Allnor wrote: >>>> >>>> >>>>>Martin Eisenberg wrote: >>>> >>>>>>I wonder why C++ doesn't already fit >>>>>>the requirements in your eyes? >>>>> >>>>>First, because C++ needs a commercial compiler to generate >>>>>executables. I don't want to install my own compiler on somebody >>>>>else's system, and I can't always bring my own laptop. >>>> >>>>What do you mean by "commercial"? GCC is not a bad compiler, and in >>>>case you think otherwise, the fact that it's under the GPL puts no >>>>restrictions on your own executables (but remember, IANAL). >>> >>> >>>GCC have made my life so miserable over the years you wouldn't >>>believe it. Every day I can stay away from GCC is a good day. >>>GCC may be free, but it is anarchy-in-a-can. With GCC, you get >>>exactly what you pay for. >>> >> >>That's interesting. I would class gcc as 'amateur' in the sense of >>'better than the mercenaries who get paid to do it'. Probably half of >>the embedded toolchains that I've worked with are based on the gcc >>compiler and they all work better than fine. I've run into very few >>quirks of gcc that can't be overcome by sticking to the ANSI C++ >>definition, and no more (often less) than would be found with Borland or >>Microsoft compilers. > > > To put a long story short: I was learning C "for real", used GCC since > it was free, available everywhere and all that. I knew nothing about > ANSI C or ISO C. I probed my way forward, tried something, saw that > it gave the result I wanted, accepted that what I had tried as "OK" and > > went on to the next challenge. > > At some point I ported my code -- which was a stated delivery in my > project -- to some computer where the C compiler (not GCC) by default > was set to ANSI C mode. > > All hell broke loose. Hardly a single line of my previous work, which > had > taken me six months to make, survived the ANSI C compiler. Some of my > blunders were really horrible, but GCC had accepted them. It took me > another four months to sort out the blunders. My contract was for 12 > months.You do the maths. > > Rune >Ah. I keep a my Harbison & Steele handy for C, and sort of struggle along with Stroustrop's "The C++ Programming Language" for C++ (anybody know a good H&S equivalent for C++?). I _always_ keep portability in mind when writing code, at least to the extent of knowing when I'm doing something that's likely to be portable and when I'm not. I rarely have problems, usually when I find I'm coding for a compiler that _isn't_ ANSI C compatible (Code Composter for the '2812, for instance, violates ANSI in a few peculiar ways which broke some 5 year old library code of mine that had worked fine on more than one processor). Gcc will take ANSI C (or C++) and compile it just the way it's intended. It also has a 'strict ansi' flag that'll make the compiler barf if you do something you shouldn't. I suspect it works pretty well. They also have some very interesting (and pretty well documented) extensions to C and C++ that it's best to avoid unless you're an absolute Gnu fanatic. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●July 6, 20062006-07-06
Fred Marshall wrote:> Rune, > > I suppose you know by now that GCC can be set by something like > "-std=......" to be limited to the form of C that you want - or something > close to it?I do now. I didn't at the time. They tell me I'm a quick learner.> It sounds like your issue is more one of assuring portability than one of > selecting a particular language. Since you already can program in C or C++ > then I'd look at "portability" things with Google. That's a frequent topic.Portability is a major concern, yes. A friend of mine wrote the most exuberant code I've ever seen. Just one snag: It was tailor-made for the DEC Alpha. Rune
Reply by ●July 6, 20062006-07-06
Hi Rune, On Thu, 06 Jul 2006 10:09:52 -0700, Rune Allnor wrote:> Jack Klein wrote: >> On 6 Jul 2006 04:35:04 -0700, "Rune Allnor" <allnor@tele.ntnu.no> >> wrote in comp.dsp: >> >> > Hi all. >> > >> > The last few weeks have revealed that I need to learn a programming >> > language that fits a nomad lifestyle. By "nomad" I mean >> > >> > - The code needs to be portable to most/all relevant OS/HW platforms >> > (Windows, Mac, Linux) >> > - Compiling the programs ought to be possible without major amounts >> > of $$$ spent on compilers >> > - The programming language needs to be able to handle complex data >> > structures and objects >> > - The programming language should be clearly defined as a *language*, >> > not a shell script, that could be confused for an OS add-on by >> > owners of computer systems >> > - The programming language ought to be able to handle COM objects >> > to manipulate excel files and word documents >> >> What Excel files and Word documents on Linux, Solaris, UNIX? For that >> matter, what COM objects on these platforms? > > Ah, sorry. > > Right now I need to work with Excel and MSWord on the PC. But I want to > > use a portable language. I'm too old and jaded to learn more > programming > languages than absolutely necessary.Now I see your original post, I can perhaps equivocate a little about my previous statement: The first and last conditions might come close to being incompatible, COM being a strictly Microsoft thing. Most people using a lot of COM seem to prefer Visual C++ or Visual Basic, neither of which fit the portability constraint. A spot of googling has found this project page: http://sourceforge.net/projects/jacob-project/ which claims to be a java-com bridge, which naturally only runs on Windows platforms, as it uses JNI to do the COM access stuff. The other place to look might be the OpenOffice.org development web site and source code: OOo is both cross-platform and knows how to play with COM data in Excel and Word documents, and I believe that the COM import/export facilities are written in Java (although I could easily be wrong about that: I haven't looked.) I don't know how reasonable it would be to extract the necessary classes to use in your own projects; there could be too many dependancies on the rest of the OOo infrastructure to make that worthwhile. Regarding Java books: I picked up "Just Java2, 6th ed" by Peter van der Linden because it appeared to cover the useful stuff and because it was there on the local bookshop shelf. It's a reasonable book, but I found that I didn't actually use it much. Instead I wrapped my brain around the standard library class set by just starting coding, with the class documentation open in a browser on my desktop. The language itself is so simple that it doesn't needs much study to figure it out. The standard class library is big, though. There are a lot of good tutorials on the web too, although some are getting a bit out of date now, with respect to the current versions of the language and GUI libraries. Other relatively popular, free, cross-platform GUI programming environments include C++ (gcc) with wxWindows, Python + wxWindows and Python + tk. (For DSP work, you probably also want the Python Numeric package, or numpy, or SciPy or whatever it is now, or something like Atlas+FFTW under C++.) The main trouble with all of these, IMO, is that it takes quite a bit of effort to put all of the pieces together from their different respective sources, and they have incompatible version upgrades often enough that maintaining a stable platform over a long period of time can be painful. I did a little control GUI in Python + wxWindows about a year ago, and while it was fun to write, it was hard to deploy on other people's Windows machines (I'd done the development on Mac OS X and FreeBSD), and when I came back to it a year later I discovered that the then-current versions of Python (and more significantly wxWindows) had changed so much that my code didn't work any more. That experience pushed me towards Java... Java isn't perfect either, by any stretch of the imagination, but I think that it's the least broken option available at the moment. With the most recent Sun JVMs performance on numerical code is, IMO, reasonable to excellent, and my coding productivity is significantly higher than under C++, thanks largely to the wealth of abstract data structure libraries and the convenience of using them that garbage collection offers. Cheers, -- Andrew






