Would you be interested in a monthly Zoom Meeting on everything coding on RISC OS?
Paolo Fabio Zaino (28) 1882 posts |
@ Theo and Steve Fryatt guys is it ok if I take all your great suggestions and add them to the repository on GitHub? Thanks! P.S. if anyone feels like helping me, here is the link (remember to pull down the `develop` branch, we only push things on the main branch that have been reviewed, so the main branch appears empty at the moment!) https://github.com/RISC-OS-Community/CodingOnRISC-OS There is also a list of web resources, so trying to collect all the links that are being shared here. |
Rick Murray (539) 13850 posts |
I did, nine years ago. Read it at your own pace… ;) |
John Albert Bullen (1423) 2 posts |
I would like to learn to code C on RISC OS but my only coding experience is playing around with BASIC back in the day so something like this sounds great. |
Paolo Fabio Zaino (28) 1882 posts |
Thanks for your feedback John. This makes me think we may want to organise a mini course of something like “from BBC BASIC to C” maybe? (any votes on this one?) |
Paul Sprangers (346) 525 posts |
+1 |
Paolo Fabio Zaino (28) 1882 posts |
Thanks Paul! Ok, added it to the list of ideas. |
Paolo Fabio Zaino (28) 1882 posts |
@ Eevryone Is it ok for a Monthly (once a month) meeting on a Saturday at around 8pm UK time? 9:00pm Rome, Paris, Amsterdam, Berlin, Madrid – 3:00pm New York – 12:00pm San Francisco – unfortunately it will be 5:00am in Canberra, but should be 8:00am in Wellington New Zealand. We could also move it to 9:00pm, but I don’t see much of an dvantage for forlks in Australia… Please let me know, thanks! :) |
Rick Murray (539) 13850 posts |
It’s a good idea as there’s definitely a speed boost to compiled code, plus you can use it to create modules. But I think it might be a bit of a hard sell to begin with the truth: Take everything you learned programming BASIC and forget it I tend to prototype ideas in BASIC as it’s great for hacking around with (a lot of the basics of my game were originally written in BASIC), to then translate it to C. It’s not hard once you have the groundwork, but it’s a bit of a slog getting there due to the differences. Plus, there’s the eternal question of how exactly to create Wimp programs. By high level and low level… Calling a function to load a sprite into a sprite area. That’s low level. Basically a nice wrapper around the relevant OS_SpriteOp SWI. I’d say it’s definitely worthwhile learning to program in C (it’s a useful skill and not just for RISC OS), but I think it might be better to approach it as learning to program C on RISC OS and simply ditch the idea of translating BASIC to C. Once you know enough of how C behaves, doing the conversion won’t be hard. But if you enter with only the idea of translating this to that, well, basically you’re looking at it entirely wrongly. ;) |
Rick Murray (539) 13850 posts |
Hint: C only has about two dozen keywords, mostly for structure, control, and types of variables. Everything else (and I mean absolutely everything) is a library function. One of the beauties of C is that it makes absolutely no distinction between standard C libraries like printf() and anything you might choose to use (like DeskLib or even your own custom bits of code). Variable scope is logical, and so utterly different to BASIC. You can also have local variables within blocks of code (like inside an if clause) that don’t exist outside of that. Have fun with pointers. Ostensibly, a pointer is exactly what it says on the tin, it’s a variable that “points” to a block of memory. But when you consider pointers to structures, or pointers to other pointers (that take a slightly different syntax) it’s clear that C takes pointers up to eleven. It’s a massive strength, and also a massive weakness. Entire books have been written on C’s pointers (think the O’Reilly type). Everybody will tell you that necessary reading is the K&R book about C. If you like software archeology, I would recommend it, but if you want to learn to write programs in C, ignore it. There are some fundamental differences between K&R and the current ANSI/ISO standards (ISO and ANSI are functionally identical, just depends upon which side of the ocean you prefer). There are incremental versions like C99, C18, etc etc which bring more features such as using C++ style // comments, or 64 bit long long variables. Plus a bunch of other esoteric things you probably won’t need under RISC OS. ;) There are various tutorials about writing Wimp programs in C for RISC OS… but I’m not sure if anybody has done a “welcome to C, tighten your nappy and hold on tight” style tutorial? Could definitely be an opportunity here, for somebody who’s a better teacher than I will ever be (in case you think I’m volunteering). Plus, if you hadn’t noticed, I much prefer the written word. ;) |
Simon Willcocks (1499) 520 posts |
I wonder if it wouldn’t be worth jumping directly to Rust. C is still 1960’s tech (which I love), C++ 1980’s. Rust is a worthy attempt to make it harder to make mistakes (at run time at least). |
Chris Johns (8262) 242 posts |
Rust would be a welcome addidition. I know some folks at work who have used it. but I’ve not really had a chance to look. |
Rick Murray (539) 13850 posts |
The RISC OS Rust compiler? C might be old and lacking things like array bounds checking 1, but it has a huge amount of support and very many people can program in C. It’s also failed to die off when C++ arrived, Java, C#, and all sorts of faddy languages since then as somebody “fixes” what they perceive to be wrong with the current popular language. That’s where Rust came from, and it’s already happened to Rust (Swift, heavily influenced by Rust). C has the benefit on RISC OS of active mature compilers (both DDE and GCC) and equally mature interactions with the host OS (like hooking into vectors, service calls, etc), along with a well known calling standard (APCS) so that you can create custom bits of assembler that can be treated, within C, as just another function. 1 That’s going to be one of your biggest changes coming from the safety of BASIC. There’s no “Subscript out of range”. If you overshoot an array, well, depending on how the program was written and whether it’s a local or global, either your program will crash or it will behave really really strangely. If you’re using the DDE and you suddenly get odd things happening like functions simply exiting back to the caller in a way that is logically impossible, chances are it’s a local (constructed on the stack) that has been overshot and messed up adjacent data. |
Stuart Swales (8827) 1357 posts |
Why mess up memory yourself when you can just get the OS to do it for you? |
Chris Mahoney (1684) 2165 posts |
Bear in mind that soon 20:00 UK time will be 07:00 in Canberra and 09:00 in NZ due to daylight saving. Australians may be happy to get up early for that! |
Paolo Fabio Zaino (28) 1882 posts |
@ Chris Mahoney
Right! So, I guess it’s decided (for now), given that also folks on Twitter and FB agreed on that time. Next, I need few folks willing to prepare the early presentations/or mini-courses. Again, link here for a list (so far), pick what you’d like to present and let me know (also about an estimate of how-long would it take to prepare your presentation): https://github.com/RISC-OS-Community/CodingOnRISC-OS/blob/main/doc/RISCOSCodingMeetingsIdeas.md If you’d like to present soemthign else please let me know and I’ll add it to the list of the ideas, thx! :) |
John Albert Bullen (1423) 2 posts |
Thinking about what Rick was saying earlier RE C, would it make more sense to look at learning C on another platform (assuming Mac etc. users would have ‘modern’ courses / reference materials) whilst learning RISC OS specifics alongside this? Or would I be making a rod for my own back? |
Rick Murray (539) 13850 posts |
I don’t think the reference materials are particularly more modern, C is C. The development environment will be unimaginably more modern, and there’s the issue that if you get used to all of that, RISC OS will seem akin to hacking a 70s mainframe by toggling switches in comparison. Plus, I think it might be rather alienating to say “first find yourself a Mac” (or whatever). |
Paolo Fabio Zaino (28) 1882 posts |
It depends on what you mean by learning C. C as just the C language it’s a very small language. On the Programming Resource page on github I already provided a list of good books to learn C from in just the C form. What trully changes between programming in C on RISC OS and programming in C on modern platforms are some of the techniques used: 1) Cooperative multitasking implies the application programmer is responsible to return control to the OS (this simple phrase alone requires quite a bit of different programming techniques to ensure this assumption is always fullfilled correctly) With that said, it’s probably a better idea to create a separate thread with the details of learning/using a specific programming language on RO. The details provided in the answers would be useful also to future readers which may not think such info are in a thread that is about organising a set of zoom meetings for who is interested in coding on RO. just sayin… ;) |
Dave Higton (1515) 3534 posts |
Unless you’re writing a pure command-line app (which I think must be unusual these days), my opinion is that you should just do things the RISC OS way. Stuff you learn or practice on another platform that is specific to that platform, will not help you programming RISC OS, and will merely add to the amount of stuff you have to learn. |
Dave Higton (1515) 3534 posts |
That’s certainly true of the first edition of K&R; I regret wasting my money on it. But the second edition is bang on, and I refer to it frequently. |
David J. Ruck (33) 1636 posts |
Its all there was when I did the majority of my personal and professional RISC OS programs in the early 90s. It did the job, and what it lacked I was able to extend fairly easily. I found Toolbox more restrictive, even though it had a nicer structure. BTW I would not recommend moving to plain C now, you are just swapping all the limitations of BASIC for a set of different memory allocation and pointer problems. C++ makes much more sense, even if you still write mainly C style non object orientated code, by using references, string classes and exceptions you can eliminate about 90% of the most common C bugs. |
Paolo Fabio Zaino (28) 1882 posts |
@ Druck and Dave Higton Sounds like you both would like to give us a talk on (or share) your experience on coding on RISC OS :) That would be awesome, any favorite month? :) |
Theo Markettos (89) 919 posts |
@Paolo
Feel free. A few more topics that might be of interest:
(not strictly volunteering here, but if there is enthusiasm I might work on finding time for some. Others are better placed to speak about others, and equally maybe enthusiasm might encourage them) It would be very helpful if speakers were OK with their talks being recorded (maybe just audio + slides or similar), as it would then make a nice collection of resources for people who want to pick up those topics but missed the meeting. |
Paolo Fabio Zaino (28) 1882 posts |
@ Theo Thanks a lot, will add all your suggestions to the list, I am sure people are very interested in all of them :) |
Paolo Fabio Zaino (28) 1882 posts |
@ All latest updates on this here: https://github.com/RISC-OS-Community/CodingOnRISC-OS/blob/main/doc/RISCOSCodingMeetingsIdeas.md If you have other ideas, please let me know. Also I need a list of voluteers to prepare all those presentations. I am also trying to reach Chris Dewhurst in case he might be interested in preparing a mini course for BBC BASIC programming that could be associated with one of his books too. |