ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: Feature: C Programming Editorial

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  Account Info
(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  Account Info

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: Re: Feature: C Programming Editorial
Zeljko Juric  Account Info
(Web Page)

I think that the main reason for delaying SDK is in the fact that "pretty" protections which TI planed in the calculator are broken, and a lot of their ideas are based exclusively on these ugly protections.

     14 May 2000, 20:38 GMT


Re: Re: Re: Feature: C Programming Editorial
Sebastian Reichelt  Account Info

Speaking of protections, I just broke the protection that functions can't access programs. I made a little C program that acts as a function and executes a line you give it as a parameter. Hopefully it will be posted soon; it's available at my E-Mail also.

I know this is off-topic, but I just had to tell you guys. And hey, it's in C. Long live C and TIGCCLIB!

     15 May 2000, 00:31 GMT


Re: Re: Feature: C Programming Editorial
Beta

Hopefully the SDK will be very good. How long can it possibly take a large company such as TI so long to make a developer's kit?

     15 May 2000, 07:11 GMT

Re: Feature: C Programming Editorial
Gatorball7  Account Info

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: Re: Feature: C Programming Editorial
johnmcd3

Yes, it is harder, but more importantly it is totally different. Learning a real programming language like Visual Basic takes time and effort. Your knowlege of calculator basic will help you understand basic (that is elementry) ideas of whats going on, such as for loops, assignments to variables, etc, but you will have to basically start from scratch to learn Visual Basic. If you are really interested in learning, I would recomending buying one of those big thick books like "Learn Visual Basic in 21 Days," They helped me a great deal.

John McDowell

     14 May 2000, 21:26 GMT

Re: Feature: C Programming Editorial
Free_Bird Account Info
(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  Account Info

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 Account Info
(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: Re: Re: Re: Feature: C Programming Editorial
Paulo Marques  Account Info
(Web Page)

Look, this HAS been discused, A LOT! I GOT IT ALREADY! Enough. Make a FAQ or something.

Cd_Slayer

     16 May 2000, 00:18 GMT


Re: Re: Re: Re: Feature: C Programming Editorial
Sebastian Reichelt  Account Info

It's not C that makes modern programs so slow. It's their complexity. Do you think impossible is better than slow?

     16 May 2000, 02:11 GMT


Re: Re: Re: Feature: C Programming Editorial
Samir Ribic  Account Info
(Web Page)

For celebration of 50 years of ENIAC, the ENIAC compatible was constructed in one chip. So no need for powerplant.

     18 May 2000, 10:12 GMT


Re: Re: Re: Re: Feature: C Programming Editorial
Free_Bird Account Info
(Web Page)

Well a Z80 is fine to me...

     19 May 2000, 23:22 GMT


Re: Re: Feature: C Programming Editorial
Sebastian Reichelt  Account Info

Don't you hear people yelling? This whole issue is controversial, I know, but at least you should see both sides and accept people who want to program at high levels. YOU don't have to download those huge (???) and slow (?????) C programs, but many others will. Why shouldn't they?

     15 May 2000, 00:37 GMT

Re: Feature: C Programming Editorial
mmu_man  Account Info
(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: Re: Feature: C Programming Editorial
Scott Dial
(Web Page)

I have toyed with this idea an I think it is a much more effective use to have a program linked like this. Btw, the version of tigcc that I have links fine, although I do remember having problems before. And I never said C was a sin, and I believe this mislead view is Nick's fault by the way he named this article. The name was supposed to be, "C has no place on calculators." I wouldn't dare try to write in ASM on my computer, but for a calculator, most definantly. COMPUTER != CALCULATOR... at least not for the purpose of this discussion.

     15 May 2000, 22:53 GMT


Re: Re: Feature: C Programming Editorial
Free_Bird Account Info
(Web Page)

Linking C and asm is definitely a good thing, even though it'll still push and pop all the registers. When used intelligently by intelligent persons (on PCs, that is) I have no objection against C in this form.

     19 May 2000, 23:24 GMT

Re: Feature: C Programming Editorial
Jeff Jensen  Account Info
(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


Re: Re: Feature: C Programming Editorial
Free_Bird Account Info
(Web Page)

>Computers wouldn't be where they are today without it.
Oh yes they would. Hardware != software

>CODING IN ASSEMBLY IS PATHETIC!
Wrong again. You do not understand assembly, and therefore you dismiss it as pathetetic. That makes you very short-sighted. You are pathetic, not assembly!

>ASM is for computers to understand, not programmers.
And who do you think wrote the compiler?

     19 May 2000, 23:27 GMT

1  2  3  4  5  6  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer