Feature: C Programming Editorial
Posted by Nick on 13 May 2000, 07:06 GMT
Scott Dial of the TCPA (both of which are down because Dim-TI's server is acting up again =[ ) has written our next (belated) feature on C programming on calculators. It's opinionated, so I have to say that Scott's opinions don't reflect my opinion or that of ticalc.org's. The use of C on a calculator is a horrible waste of space. I love the idea as much as the next guy, but there simply isn't enough space for all the bloated code. GCC doesn't produce the most optimized code by far. *gasp* I understand using it to ruff in some program that you need real quick, but any complex program is going to bloat that much more. I even particurally like the fact that I can port a program for my pc to the 89 relatively easily.
What I can't stand is how many people think that C is so much better than asm... There are some real complex things you can do with C that I would be wary of attempting with ASM, but it still could be done cleaner in ASM. The GCC compiler isn't exactly optimal either. Anyone ever looked at the source (-S) it produces? Who in their right mind would use moveq.l #0,d0 to clear it? It has no clue that there is even a better choice... Or how about it moves values on the local stack that don't even need to be preserved or referenced in that method... movew d0,-2(a6) \ tst.w -2(a6). No one can replace the human mind.
I would hate to see all the programmers of tomorrow using C because it is easier... nothing great is ever easy. C is the lazy mans excuse to not learn to really program the calculator. What's that you say? The AMS was written in C... well yes it was and I hate TI for it. Space is not a luxury on such a small memory capacity. If every new programmer that comes in starts writing everything in C then space becomes even less of a luxury. Long live assembly!
|
|
|
The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.
|
|
Re: Feature: C Programming Editorial
|
Beta
|
Small memory capacity? I sure hope he wasn't talking about the TI-89!
|
|
14 May 2000, 02:44 GMT
|
|
Re: Feature: C Programming Editorial
|
David Browne
(Web Page)
|
sorry, i dont know anything about programming in c for calculator, although i know a little borland c++ for dos;
anyway, in response to the AP exam, i took the calculus AB(only one person in my class took BC, the same person that got 4 out of 5 800s on sat I and II tests) and statistics tests. i personally thought that the calculus was easier than statistics, and although some people who took it (10 of us in a class of 30) thought the calculator part was harder than the non-calc part, i though it was very easy. but maybe because i know how to use my calculator, beyond nDeriv and fnInt. i'll be surprised if i got less than a 4 on the calc test.
|
|
14 May 2000, 03:05 GMT
|
|
Re: Feature: C Programming Editorial
|
Edward Behn
|
Speaking of C programming: Does anyone have any idea when TI will be releasing their SDK for the 89? Their website says early 2000. (It's May for crying out loud!!!)
|
|
14 May 2000, 07:45 GMT
|
|
Re: Feature: C Programming Editorial
|
Gatorball7
|
Hey guys, I know this doesn't have much to do with C but I was wondering is Visual Basic harder than the Basic that I program on my Ti-86 calculator?
|
|
14 May 2000, 16:58 GMT
|
|
Re: Feature: C Programming Editorial
|
Free_Bird
(Web Page)
|
I totally agree. But when I posted this during the GCC stuff, people just yelled: ,,yeah, it's easier, blah, blah'', but they didn't realize that C sux. Asm rules, and always will. BASIC is smaller for math, so C can't beat either of them. C should be buried!
|
|
14 May 2000, 21:59 GMT
|
|
|
|
|
Re: Re: Feature: C Programming Editorial
|
HydroCarbon10
|
Yes, lets bury C and all programs written in C...that will be Windows, Linux (oh, wait, you're too l33t for Linux, so we will also have to bury the BSDs). Now lets go back to when all you could program was asm. We'll all sit around on the floor staring at our TV screens playing with our commodore 64s...but wait, people used C then too, we will have to go back to ummm, well ENIAC sounds good. The whole idea behind C is to make more complex programs eisier to write. Asm will always rule for speed, but it has limits in the complexity dept. that C takes care of nicely. Oh, and by the way, I hope you have a nuclear reactor in your back yard because those ENIACs were a little bit of a power hog :P.
|
|
14 May 2000, 22:32 GMT
|
|
|
|
|
|
|
|
Re: Re: Re: Feature: C Programming Editorial
|
Free_Bird
(Web Page)
|
OHHHH PUH-LEEZE stop this "thanks to C our civilization has reached incredible heights" stuff. First of all, I meant C should be buried for use on calcs (this is a calc site after all, right?), but let's ignore that for now. You make it sound as if C helped improve hardware and all, but that's not true. I can still use asm on any CPU I want, so why should I use an ENIAC? It sux, and there is no reason for me to use it. C has got nothing to do with that. More importantly, C has caused many people to forget asm, which is a Bad Thing®, because they will now also use C for projects that do not require it, or even in cases when C is too slow, and that has really decreased the speed of software over the years.
|
|
15 May 2000, 17:23 GMT
|
|
Re: Feature: C Programming Editorial
|
mmu_man
(Web Page)
|
Hey, nobody mentionned Prosit (http://prosit.ticalc.org/) ! It's written in C, AND ASM. It seems nobody knows you can mix C and ASM together ?
There are several problems:
* The 'linker' TIGCC uses is not really a true one, a real one would allow linking ASM objects with C objects (maybe the last version does it).
* TIGCC for Windows is a broken GCC, which doesn't have all the features real GCCs have (calling simply with register passing...)
Not to flame it, it's a GREAT tool anyway. (Prosit is compiled with it, waiting for the Linux version to be ok).
* The compiler Ti used is (or maybe it's their fault, which is even worse) so bad that the rom functions clobber registers, not allowing GCC to do all the optimisations it could...
I should sometime write a wrapper for that, so I've a message : ALWAYS save the registers in your libraries, don't take the TI's example !!!
As someone already mentionned, UNIX, LINUX, ... and even Windows(not a reference) is written in C...
For the memory point, keep online... You can sometime have a surprise...
|
|
15 May 2000, 11:55 GMT
|
|
Re: Feature: C Programming Editorial
|
Jeff Jensen
(Web Page)
|
I think your really stupid. C is a great programming language. Computers wouldn't be where they are today without it. CODING IN ASSEMBLY IS PATHETIC! I understand that if you know it, that's great, and you should use it, but PROGRAMMING IN ASM IS INSANE! ASM is for computers to understand, not programmers.
I hope that people don't waste their time learning some language that is that difficult. I am also glad that TI didn't write TI-OS in assembly. The TI-89 still wouldn't have even been released!
If you are into wasting your time with a language impossible to grasp, then good luck. But I recommend C.
|
|
15 May 2000, 18:53 GMT
|
|
1 2 3 4 5 6
You can change the number of comments per page in Account Preferences.
|