Shop OBEX P1 Docs P2 Docs Learn Events
C is quirky, flawed, and a huge success - Page 6 — Parallax Forums

C is quirky, flawed, and a huge success

12346»

Comments

  • RossHRossH Posts: 5,505
    edited 2014-06-21 02:38
    whiteoxe wrote: »
    just a 2cent statment , I bought 'C Programming Absolute beginners Guide', recommending CODE;BLOCKS IDE. it was fun to work through. Im not so afraid of C anymore !!!!

    The Windows installation of Catalina also installs the Code::Blocks IDE, which is perhaps the best IDE available for C/C++ languages. Code::Blocks will also support many other compilers, including GCC. PropGCC can probably be supported if you are prepared to manually add all the PropGCC special options you may need.

    Ross.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-21 03:19
    I guess this is one of those isolated and living in Asia things, but I have had a lot of difficulty finding any good presentation of Code::Blocks. I didn't even know it was an IDE ore installable.

    I have seen it used in printouts of code in SimpleIDE, just presume it was yet another C++ feature to run down. Thanks for mentioning the book and clearing up that it can be included in C.

    +++++++++++++++
    About working with porting AVR code from AVR Studio.

    All the AVR includes are inside < xxxx.h file >, and all the code specific includes are inside quotes. So I started by commenting out all the AVR specific includes and reading up what those AVR Studio libaries provide.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-06-21 05:03
    Instead of commenting out the includes for the AVR files you may want to create dummy avr/io.h, avr/interrupt.h and util/delay.h files. This way you only have to change 3 files instead of a dozen. That's what I did to get the code to compile. You will have to declare dummy variables for the various AVR I/O registers that are referenced, and you also need to add a function prototype for delay_ms().

    Loopy, the reason that I suggest you learn C first before tackling GRBL code is that it's a more efficient way to attack the problem. However, it's your time that you're expending, so go for if you think it's better your way. I would suggest that you do not complain about the Propeller tools and the tutorials until you have a better grasp for what you're doing in C. I think much of your frustration comes from working on C code that is way beyond your expertise at this point. Things will be different in a month or two when you have more experience in C.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-21 10:21
    @Dave Hein
    Thanks for the tips about dummy variables. It is a good alternative to what I have been trying.
    Along with Heater's suggest to Google for discussion of the compiler error messages, I am making a bit of progress.

    I can easily do everything in C that PBasic for the BasicStamp can do and have been able to do so for quite some time.

    Arrays and pointer maths are bit confusing at times, but I do get the fundamentals. It seems that input and output serial buffers are managed as arrays in some contexts, but I doubt that I should be doing so. It is simpler to just get and put a single character at a time. Declarations of variables, arrays, and structures can be a bit confusing ... especially if the original code is of dubious style. But I do see the reasons for external versus internal variables.

    I agree with you wholeheartedly about my venting frustrations that may not reflect any real flaws in C. After all the Propeller GCC compiler seems to quite adequate and conforming well with what GCC documents. And I have tried to be candid about that.

    If I were in the USA, I would just take a junior college course in C. But here I can't do that and I just about have to import every text that I choose to buy with a high shipping cost... unless I buy ebooks.

    I have looked at the Learn tutorials and read the SimpleIDE manual. I'd still prefer to learn by a reference text rather than a series of html files that have me jumping from place to place. BELOW SEEMS TO BE ALL OF IT.
    It is all basics to me that I have no problem with.

    Unlike Jazzed and Heater, I am NOT here to promote Learn, SimpleIDE, or Propeller GCC. I am simply a customer and Propeller user. I have avoided using C on the Propeller too early just because I don't want to be a part of Alpha or Beta testing and I don't feel qualified to write documentation.

    Catalina C with a complete package of documentation in its download .zip file seems a solid alternative to the Learn web site for me personally.

    But I am in a situation similar to what I got into between Tachyon, PropForth, and pfth, only this time it is between Catalina C and Propeller GCC --- if I say anything in support of one, I upset someone else.

    I have looked at and studied ANSI C on and off over many years at different times with Kernighan and Richie's text, and never really completely mastered it as I had no vision of project that really required it.
  • Heater.Heater. Posts: 21,230
    edited 2014-06-21 10:43
    Loopy,
    Unlike Jazzed and Heater, I am NOT here to promote Learn...
    What? I don't even know what "Learn" is. Never checked it out.
    I am simply a customer and Propeller user. ...
    Same here.

    To this day I am not sure how much of propgcc or SimpleIDE is a Parallax product or something that has been created by a band of talented individuals mostly for free.

    As such, I feel it's a bit off to be constantly pouring scorn on their efforts,

    Suggestions and encouragement, yes, scorn, no,
  • David BetzDavid Betz Posts: 14,516
    edited 2014-06-21 19:18
    But I am in a situation similar to what I got into between Tachyon, PropForth, and pfth, only this time it is between Catalina C and Propeller GCC --- if I say anything in support of one, I upset someone else.
    I'm not sure who you would upset if you said something good about either. What I don't appreciate are attacks on PropGCC or Catalina C.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-06-21 19:21
    Heater. wrote: »
    To this day I am not sure how much of propgcc or SimpleIDE is a Parallax product or something that has been created by a band of talented individuals mostly for free.
    I think it's a combination of both. Parallax certainly supported PropGCC development but also a fair amount the work was done by people volunteering their time. Of course, *all* of Catalina was developed by one individual as a labor of love. At least that is my understanding.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-06-21 20:20
    David Betz wrote:
    What I don't appreciate are attacks on PropGCC or Catalina C.
    Just to clarify, "attacks" per se should be avoided if they become personal, but neither PropGCC nor Catalina C (nor Spin/PASM for that matter) is above reproach or immune to criticism. IOW there are no sacred cows in this forum, and forumistas should be encouraged to speak their minds within the bounds of decorum. I say that as a fellow forumista, as a moderator, and as a supplier to Parallax, a highly-valued customer. (I've been known, on occasion, to bite the hand that feeds me, but diplomacy has never been my strong suit. :) )

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-22 03:13
    Okay, the usual misperseptions... none of us has the time or inclination to follow anyone else 24/7 on the Forum so observations may end up if the weeds of misperceptions.

    Sorry Heater... my misperception. Your support. for SimpleIDE led me to think that you are actively involved in the development of SimpleIDE. re: porting to the Raspberry Pi and so on.

    I am certainly not against C, but C++ has been something that I very wary of. I simply don't want to deal with thousands of pages of documentation. For me it isn't fun.

    I do have to admit that C++ does over some interesting and seriously useful additions to maths, such as complex numbers. And the Arduino use of Class structure to make their coding more like a 'plug and play' environment to the end user does have a lot of people that like it.

    Actually, I am very attracted to GCC as it is what Linux uses... it seems a good integration with the Propeller, up to a point. I do realize the LInux is an OS with a Unix file system and a multi-user content. SO all of the features in GCC are never going to be feasible. (I do try to be realistic.)

    ++++++++
    I do get grumpy and frustrated and become negative at times because of such. I do make an effort to self moderation and to not post everything that comes to mind.... generally trying to evaluate if I am contributing something constructive to the thread rather than just jumping in.

    ++++++++
    The main point is that C on the Propeller has gotten a lot more interesting to me. I am just coming to terms of how it fits in.

    There do seem to be some exciting things that have yet to be fully appreciated.

    1. Heater's demonstration that he can deploy multiple cogs in a serious calculation task -- the 4 cog Fourier scheme -- to gain substantial speed. That should be even more interesting when a 16 cog device is available.

    2. Porting code projects that have previously been ignored. C is supposed to be portable. There is a wealth of code generated over many decades that suddenly becomes available. While not all of it is suitable, there is still a lot.
  • TorTor Posts: 2,010
    edited 2014-06-22 04:02
    I am certainly not against C, but C++ has been something that I very wary of. I simply don't want to deal with thousands of pages of documentation. For me it isn't fun.
    That's perfectly fine - if it isn't fun, stay away from it. To me C++ isn't fun either, so I don't write my code in C++. It's enough to occasionally have to maintain other people's code. But you can do just fine with C. You can even write object oriented code in C, after all that's how the whole Unix device driver model is done. In C.
    I do have to admit that C++ does over some interesting and seriously useful additions to maths, such as complex numbers. And the Arduino use of Class structure to make their coding more like a 'plug and play' environment to the end user does have a lot of people that like it.
    I haven't looked much at Arduino, but I've read a book - Arduino Cookbook I think it was called. It's nothing like the Perl Cookbook so I bought it by mistake (the latter is phenomenally useful). But at least it looks to me like the Arduino folks did something right about restricting their C++ environment to what they have.

    When that's said.. C99, the latest, but (afaik) still in-progress standard, has support for complex numbers. Including GCC. http://www.gnu.org/software/libc/manual/html_node/Complex-Numbers.html

    -Tor
  • David BetzDavid Betz Posts: 14,516
    edited 2014-06-22 04:19
    Just to clarify, "attacks" per se should be avoided if they become personal, but neither PropGCC nor Catalina C (nor Spin/PASM for that matter) is above reproach or immune to criticism. IOW there are no sacred cows in this forum, and forumistas should be encouraged to speak their minds within the bounds of decorum. I say that as a fellow forumista, as a moderator, and as a supplier to Parallax, a highly-valued customer. (I've been known, on occasion, to bite the hand that feeds me, but diplomacy has never been my strong suit. :) )

    -Phil
    I said "attacks" not "criticism'. Also, I'm not suggesting that attacks not be allowed. I was just responding to the comment about what might upset me. If someone says "PropGCC is Smile" or "Catalina is Smile" rather than "PropGCC needs better documentation or more example code" that bothers me. That's all.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-22 06:31
    There seems to be some claims out there than ANSI C 2011 is complete.

    AVR Studio seems to go as far as ANSI C 1999. I don't think anyone is really wanting to let go of what they already feel comfortable doing just to be up to the latest standard.

    I am having to read the AVR libc header files to figure out how to port to the Propeller and the stuff is an eye-opener. They had to get very creative to make GCC work with all the chips, the interrupts, the registers, the extra timers, the variety of pinouts, and so on.

    I am beginning to think it would be nice to clone of full set of them that just dumps all the AVR choices and gets the code to work on the Propeller. I know... I am a dreamer. .... but I am not the only one.
Sign In or Register to comment.