Proposal: A book for PropGCC?
mindrobots
Posts: 6,506
I might not be able but I think I'm ready and willing. I'm not sure how best to tackle this than just jump with both feet.
It's time for a book about using PropGCC and the Propeller! There's been occasional talk on the forums and I've been thinking about it for quite a while.
In case you want to read something I've written:
The Toggle Tutorials
The Zero Tutorial
Blinky
Blink2
Blinky3
I'm attaching a pdf of an outline I'm putting together. At this point, it's mostly off the top of my head with things I remember not knowing or having questions about (many I still don't know). It will more than likely just be an ebook (unless O'reilly comes up with an offer and an animal for the cover).
If you have a chance and have a care, let me know what kinds of things you'd like to see covered (or thing that shouldn't be covered)
If I stay on it and hurry, I may finish it before I start on the Propeller 2 and PASM2 book!
P.S. I know I often go off topic on threads (I'm trying to do better) - if you could stay on topic with any comments, I'd appreciate it. THANKS!!
It's time for a book about using PropGCC and the Propeller! There's been occasional talk on the forums and I've been thinking about it for quite a while.
In case you want to read something I've written:
The Toggle Tutorials
The Zero Tutorial
Blinky
Blink2
Blinky3
I'm attaching a pdf of an outline I'm putting together. At this point, it's mostly off the top of my head with things I remember not knowing or having questions about (many I still don't know). It will more than likely just be an ebook (unless O'reilly comes up with an offer and an animal for the cover).
If you have a chance and have a care, let me know what kinds of things you'd like to see covered (or thing that shouldn't be covered)
If I stay on it and hurry, I may finish it before I start on the Propeller 2 and PASM2 book!
P.S. I know I often go off topic on threads (I'm trying to do better) - if you could stay on topic with any comments, I'd appreciate it. THANKS!!
Comments
-Phil
Not funny.
ouch! I guess that's on-topic. It DOES mention PropGCC!
Anything that helps the adoption of Propellers by anyone is a good thing!
Maybe it can the Perl for Propellers!
I think there is more than one audience for a Propeller GCC book.
C is not just a piano key.
Microcontroller is not a fire breathing high-school teacher.
What about our Italian friend?
Devil in the details and C is fun
There are many programming text books that make good examples to follow.
A bit rich coming from a Perl monger.
Lets get rid of propgcc, and by inference GCC, and by inference C/C++.
Fine with me. No more C programming on the Prop. No more C++ programming on the Arduino. No more Windows or Linux or Android or BSD etc
Best of all no more Perl (It's written in C I guess)
Life will be so much better when we get rid of C/C++.
When I wrote my article with in-depth information about Propeller C/C++ programming, I definitely also had in mind that it might one day be part of a book. I figured, there are probably many embedded software engineers who are ignoring or avoiding the Propeller because they are unaware of GCC and SimpleIDE. There should be an audience for a book about the Propeller for C and C++ programmers (with perhaps varying degrees of experience writing embedded software) but with little or no knowledge of the Propeller. When Ken invited me to write more articles, I started thinking about the possibility of working towards a series of articles and tutorials that might be bundled into a book some day, although I never found the time to write any more articles :-(.
The book that I had in mind, had chapters similar to yours, though I probably had them in a different order in my head. For example, I would make a rough overview of the Propeller's architecture into Chapter One and your outline doesn't get to that subject until Chapter Two. But that's probably because I had in mind that the audience would be those who already know C and/or C++ so I probably wouldn't have included your Chapter One (intermediate C programming) at all. I'm not saying it doesn't belong there, I'm saying I would find it difficult to write such a chapter because I've used C and C++ for such a long time myself that I would have trouble stepping into the shoes of a beginning C programmer. It's just because it's been too long since I was one myself. But I didn't discover the Propeller until a couple of years ago, so I think I still have a pretty good idea of which Propeller architecture details I was wondering about back then. And I remember learning Spin and PASM and trying to imagine how the Propeller-specific hardware features would be implemented in a C/C++ compiler or in a C/C++ program, if there would have been a C/C++ compiler back then.
Anyway, the bottom line is, apparently unlike some others (ahem) I would like to encourage you to write your book, and I would like to offer my assistance if you need it (but judging from your outline, it looks like you got this). If you want to use my article as a chapter or an appendix, feel free to do so (all I ask is that you credit me for writing it). If you have any questions or if you want me to propose any improvements to the article, let me know (I think the part about calculating stack size is still pretty weak).
And I think I speak for everyone here when I say: keep us posted! If you put up a draft of the book for review, we'd be more than happy to review it!
===Jac
If it were me, I'd want to write for professional developers and I would additionally include:
1. Debugging techniques (hardware level, compiling on PC, serial output, GDB, ASM output)
2. Optimization techniques (and measurement)
3. Timing (how to schedule things, interrupt, etc.)
4. Power performance (sleep modes, speed vs current, etc.)
5. Comparison to other MCUs (power and performance)
6. Bootloading (aka, replacing the current program with something newer)
7. Multi core communication and synchronization
8. C++
Personally, I don't like the learn site. By breaking into all those pages I don't know what's there, I can't find my way around, and I get frustrated and leave. I suppose the content is good, but I rarely ever get to that point in my browsing. It would be better if there was a "Download Learn as PDF Book" option that bundled everything together with a nice TOC.
My audience is most likely other hobbyists. I don't think I have the knowledge or experience to write for professional developers or engineers.
I have mixed reactions to Learn. I hadn't been there for a while , so today I'm covering it from front to back.
It's amazing. They never even say that you program an Arduino in C++. No, they talk about "sketches" and such.
Now, C++ is a huge and complex language, so much so that I don't believe any single human being understands how it all works together.
But in the Arduino documentation they keep it really simple. Which is helped by the really easy to use libraries they have.
Professionals can take care of themselves.
Phil, I find this very interesting (and probably feel the same, not being a C/C++ fanboy but a reluctant adopter and band wagon jumper). I'd like to pursue this in another thread or probably more constructively off forum if we could. I don't have practical experience to support my suspicion but you do. I would hope it could be fixed somehow to make the C experience painless and productive. My first two attempts at teaching a Robotics were mixed disappointments but not because of the tools.
Thanks for your support! I knew you'd come around!
The Arduino documentation is a wonderful example. Yes the simplicity of the library wrappers is a big part of that. But as I say C++ is a huge and tortuous language and they go out of their way not to even hint at the hard parts in those tutorials.
I do agree about the book format. On the web or in print if someone can take you by the hand and lead you "linearly" through the maze that is great.
Phil, I never suggested that one would want program a Prop in Perl. Any more than anyone would want to program any machine in Perl. Only that if you exterminate C, as you suggested, you exterminate Perl with it. Along with all those other "P" languages. Python, PHP...
Which might be a good deal.
More seriously, why not? Is it such a crappy language?
I'm kind of dedicated to getting JavaScript working on the P2 at least. Another stupid slow interpreted language. We will see how that goes.
Note: All language war comments are expected to be accepted in good humour.
First:
I definitely like the idea of the book and think that the introductory/hobbyist level is the best place to start.
Second:
I'd like to see the discussion with Phil continue, probably on another thread though, but that's up to you and Phil.
The first hand experience Phil is having with teaching the class will be very valuable in helping steer the educational aspect of PropGCC is a positive direction.
C.W.
A collection of interesting articles on why you should learn C (and not C#, C++, Objective-C or any of the other C derivative languages) as your first language: http://www.softintegration.com/academic/why-learn-c-as-first-programming-language.html
I'm not sure I agree with them all (and you do have to keep in mind that this web site is promoting it's own C-like scripting language!) but I do think the case for students learning C first in the context of a microcontroller like the Propeller is even more compelling than it would be in a desktop environment.
However, I don't think that C can or should ever displace Spin. Spin is a great language for giving hobbyists and newcomers to microelectronics and/or programming a taste of what the Propeller can do, whereas C is more appropriate for people who are studying to make a profession of computers or programming.
C++ of course, should simply have been drowned at birth
Ross.
-Phil
I would not quote softintegration. They sound like a bunch of illiterate sharks.
No LISP, No Perl!
This is about PropGCC and how to document it and help folks get a grip on using it with the Propeller.
If you'd like to provide a Lisp interpreter as part of the PropGCC Demo package, go for it! If you want to discuss the merits of any other language with regards to PropGCC, please take it outside.
If you have things about PropGCC you've been confused about or would like to see better explained in a BOOK, then you are in the right thread to comment!
Thanks for playing along!
Looking at this excerpt from the Learn pages:
At what level is this OBVIOUS and would not stop someone writing C code for a Propeller and make them pause to think how to do this?
1) Someone who has just completed a C programming class
2) Someone who has just graduated
3) Someone who has been in the industry programming MCUs in C for 2 or 3 years?
4) Most people considering themselves "expert" programmers (10+ years) would still not have all this pop into their head as the solution needed.
My first reaction when I started playing with multiCOG C was "What is all this and why is it some clumsy, cumbersome, verbose?"
I assume that at most levels, it's just easiest if you are told these kinds of things with the appropriate level of detailed discussion.
Thanks!
I'm not sure about the "clumsy cumbersome and verbose" part. Even in Spin you have to pick a stack size for example.
Sorry about hijacking the thread. Just having fun. I think that perl or lisp on a prop would be silly.
Thanks, David! That's the kind of feedback I need. The "clumsy, cumbedsome, verbose" was a bit of hyperbole - by the nature of launching a cog, all languages go through something similar.
So I have the basics of structure. I grasp pointers, not so able to use them well yet. What I want to know is specific key words for the Prop, a good explanation of what each of the header files brings to the code. I am a hobbyist, not looking to make the next greatest and bestest, just want to make the Prop do what I want in parallel.
So differences in the language related specifically to Prop (for example why print instead of printf ?). I end up getting lost searching for small answers and am having a heck of a time gathering all the information I need in one spot. I would PAY for a hardcover, paperback, kindle. For example I would want to know what that list of defines in simpletools.h such as CLREOL (11) is and where the function is so I can read it and use all of it's designated child functions. I suppose this sounds rambling, sorry I do that.
My point is there does indeed need to be a good referencing/learning tool out there that is chronological and informative. I myself would ask baby programmers what they seek, what they don't understand related to this chip.
Thank you for the input. This is the kind of information I am looking for.
It should be one book (for efficiency sake) but it is hard to target and write to both audiences, hobbyists (like you and me) and serious, professional engineers. Structuring the layers will be a challenge.
Your questons are many of the same things I keep going out and looking for.